mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 17:30:32 +08:00
Add img2zpl gem for ZPL image code generation [SCI-7551]
This commit is contained in:
parent
a0682f962a
commit
95baaefd7a
3 changed files with 11 additions and 3 deletions
1
Gemfile
1
Gemfile
|
@ -97,6 +97,7 @@ gem 'devise-async',
|
||||||
git: 'https://github.com/mhfs/devise-async.git',
|
git: 'https://github.com/mhfs/devise-async.git',
|
||||||
branch: 'devise-4.x'
|
branch: 'devise-4.x'
|
||||||
gem 'image_processing', '~> 1.12'
|
gem 'image_processing', '~> 1.12'
|
||||||
|
gem 'img2zpl', git: 'https://github.com/scinote-eln/img2zpl'
|
||||||
gem 'rufus-scheduler', '~> 3.5'
|
gem 'rufus-scheduler', '~> 3.5'
|
||||||
|
|
||||||
gem 'discard', '~> 1.0'
|
gem 'discard', '~> 1.0'
|
||||||
|
|
|
@ -39,6 +39,13 @@ GIT
|
||||||
devise-async (0.10.2)
|
devise-async (0.10.2)
|
||||||
devise (>= 4.0)
|
devise (>= 4.0)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/scinote-eln/img2zpl
|
||||||
|
revision: 23d61cfc3e90ac4caa62dd08546fa0d7590a5140
|
||||||
|
specs:
|
||||||
|
img2zpl (1.0.1)
|
||||||
|
mini_magick (~> 4.9)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
|
|
@ -61,14 +61,14 @@ module LabelTemplates
|
||||||
@repository_row.created_by.full_name
|
@repository_row.created_by.full_name
|
||||||
when 'ADDED_ON'
|
when 'ADDED_ON'
|
||||||
I18n.l(@repository_row.created_at, format: :full)
|
I18n.l(@repository_row.created_at, format: :full)
|
||||||
when 'LOGO'
|
when /^LOGO/
|
||||||
logo
|
logo(key)
|
||||||
else
|
else
|
||||||
raise ColumnNotFoundError, I18n.t('label_templates.repository_row.errors.column_not_found')
|
raise ColumnNotFoundError, I18n.t('label_templates.repository_row.errors.column_not_found')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def logo
|
def logo(_key)
|
||||||
raise LogoNotFoundError, I18n.t('label_templates.repository_row.errors.logo_not_supported')
|
raise LogoNotFoundError, I18n.t('label_templates.repository_row.errors.logo_not_supported')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue