From 8dec17f60645cdaaa9e6923674a505aa98c9a0a4 Mon Sep 17 00:00:00 2001 From: ajugo Date: Fri, 12 Aug 2022 14:55:14 +0200 Subject: [PATCH] Add print label button in view repository role [SCI-7097] (#4351) --- .../stylesheets/repository/repository_toolbar.scss | 5 +++++ app/views/repositories/_toolbar_buttons.html.erb | 2 ++ .../toolbar/_print_label_button.html.erb | 10 ++++++++++ .../repositories/toolbar/_row_actions.html.erb | 14 ++++---------- 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 app/views/repositories/toolbar/_print_label_button.html.erb diff --git a/app/assets/stylesheets/repository/repository_toolbar.scss b/app/assets/stylesheets/repository/repository_toolbar.scss index 1d6ea43d3..a5ace364e 100644 --- a/app/assets/stylesheets/repository/repository_toolbar.scss +++ b/app/assets/stylesheets/repository/repository_toolbar.scss @@ -28,6 +28,11 @@ margin-left: 0; } } + + .view-only-label { + align-items: center; + margin: auto 0; + } } .toolbar-right-block { diff --git a/app/views/repositories/_toolbar_buttons.html.erb b/app/views/repositories/_toolbar_buttons.html.erb index 47436ccc9..f2fb0c140 100644 --- a/app/views/repositories/_toolbar_buttons.html.erb +++ b/app/views/repositories/_toolbar_buttons.html.erb @@ -33,6 +33,8 @@ <%= t("repositories.hide_reminders") %> <% end %> + <% else %> + <%= render partial: 'repositories/toolbar/print_label_button' %> <% end %>
<%= render partial: 'repositories/toolbar/archive_label' %> diff --git a/app/views/repositories/toolbar/_print_label_button.html.erb b/app/views/repositories/toolbar/_print_label_button.html.erb new file mode 100644 index 000000000..f1ec090ff --- /dev/null +++ b/app/views/repositories/toolbar/_print_label_button.html.erb @@ -0,0 +1,10 @@ + diff --git a/app/views/repositories/toolbar/_row_actions.html.erb b/app/views/repositories/toolbar/_row_actions.html.erb index c03e39238..9d80835d8 100644 --- a/app/views/repositories/toolbar/_row_actions.html.erb +++ b/app/views/repositories/toolbar/_row_actions.html.erb @@ -32,16 +32,7 @@ <%= t("repositories.index.options_dropdown.export_items") %> - + <%= render partial: 'repositories/toolbar/print_label_button' %> <% if can_delete_repository_rows?(@repository) %>