mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-11 22:56:41 +08:00
Fix label templates seelctor in print modal [SCI-10632]
This commit is contained in:
parent
d5665b9c14
commit
7b3e5a06e0
4 changed files with 8 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ class LabelTemplatesController < ApplicationController
|
||||||
include TeamsHelper
|
include TeamsHelper
|
||||||
|
|
||||||
before_action :check_feature_enabled, except: %i(index zpl_preview)
|
before_action :check_feature_enabled, except: %i(index zpl_preview)
|
||||||
before_action :load_label_templates, only: %i(index datatable)
|
before_action :load_label_templates, only: %i(index datatable list)
|
||||||
before_action :load_label_template, only: %i(show set_default update template_tags)
|
before_action :load_label_template, only: %i(show set_default update template_tags)
|
||||||
before_action :check_view_permissions, except: %i(create duplicate set_default delete update)
|
before_action :check_view_permissions, except: %i(create duplicate set_default delete update)
|
||||||
before_action :check_manage_permissions, only: %i(create duplicate set_default delete update)
|
before_action :check_manage_permissions, only: %i(create duplicate set_default delete update)
|
||||||
|
|
@ -29,6 +29,10 @@ class LabelTemplatesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def list
|
||||||
|
render json: @label_templates, each_serializer: LabelTemplateSerializer, user: current_user
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { render json: @label_template, serializer: LabelTemplateSerializer, user: current_user }
|
format.json { render json: @label_template, serializer: LabelTemplateSerializer, user: current_user }
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ export default {
|
||||||
templateOption(option) {
|
templateOption(option) {
|
||||||
return `
|
return `
|
||||||
<div class="label-template-option" data-toggle="tooltip" data-placement="right" title="${option.params.description}">
|
<div class="label-template-option" data-toggle="tooltip" data-placement="right" title="${option.params.description}">
|
||||||
${option.params.icon}
|
<img src="${option.params.icon}"></img>
|
||||||
${option.label}
|
${option.label}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
data-print-url="<%= print_repositories_path %>"
|
data-print-url="<%= print_repositories_path %>"
|
||||||
data-zebra-progress-url="<%= print_zpl_repositories_path %>"
|
data-zebra-progress-url="<%= print_zpl_repositories_path %>"
|
||||||
data-printers-url="<%= label_printers_path(format: :json) %>"
|
data-printers-url="<%= label_printers_path(format: :json) %>"
|
||||||
data-label-templates-url="<%= label_templates_path(format: :json) %>"
|
data-label-templates-url="<%= list_label_templates_path(format: :json) %>"
|
||||||
data-rows-url="<%= rows_to_print_repositories_path %>"
|
data-rows-url="<%= rows_to_print_repositories_path %>"
|
||||||
data-print-validation-url="<%= validate_label_template_columns_repositories_path %>"
|
data-print-validation-url="<%= validate_label_template_columns_repositories_path %>"
|
||||||
data-label-preview-url="<%= zpl_preview_label_templates_path %>"
|
data-label-preview-url="<%= zpl_preview_label_templates_path %>"
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ Rails.application.routes.draw do
|
||||||
post :set_default
|
post :set_default
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
|
get :list
|
||||||
post :duplicate
|
post :duplicate
|
||||||
delete :delete
|
delete :delete
|
||||||
get :datatable
|
get :datatable
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue