mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
Merge pull request #3504 from artoscinote/ma_SCI_6025
Amended label template, truncate item name before print [SCI_6025]
This commit is contained in:
commit
a847f68de4
2 changed files with 8 additions and 5 deletions
|
@ -4,6 +4,8 @@ class RepositoryRowsController < ApplicationController
|
|||
include ApplicationHelper
|
||||
include MyModulesHelper
|
||||
|
||||
MAX_PRINTABLE_ITEM_NAME_LENGTH = 64
|
||||
|
||||
before_action :load_repository, except: :show
|
||||
before_action :load_repository_row, only: %i(update assigned_task_list)
|
||||
before_action :check_read_permissions, except: %i(show create update delete_records copy_records)
|
||||
|
@ -99,7 +101,7 @@ class RepositoryRowsController < ApplicationController
|
|||
label_printer,
|
||||
LabelTemplate.first.render( # Currently we will only use the default template
|
||||
item_id: repository_row.code,
|
||||
item_name: repository_row.name
|
||||
item_name: repository_row.name.truncate(MAX_PRINTABLE_ITEM_NAME_LENGTH)
|
||||
),
|
||||
params[:copies].to_i
|
||||
).job_id
|
||||
|
|
|
@ -24,10 +24,11 @@ class CreateLabelTemplates < ActiveRecord::Migration[6.1]
|
|||
content:
|
||||
<<~HEREDOC
|
||||
^XA
|
||||
^CF0,21
|
||||
^FO10,0^FD{{item_id}}^FS
|
||||
^FO5,3^BY3,3.0,25^BQN,2,4^FDMA\\{{item_id}}^FS
|
||||
^FO100,39^FB190,20,5,L^FD{{item_name}}^FS^FS
|
||||
^LH20,20
|
||||
^CF0,23
|
||||
^FO0,0^FDIT68329^FS
|
||||
^FO0,20^BQN,2,4^FDMA\{{item_id}}^FS
|
||||
^FO95,30^FB180,4,0,L^FD{{item_name}}^FS^FS
|
||||
^XZ
|
||||
HEREDOC
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue