Add print label button in view repository role [SCI-7097] (#4351)

This commit is contained in:
ajugo 2022-08-12 14:55:14 +02:00 committed by GitHub
parent e4a7aa3dad
commit 8dec17f606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 10 deletions

View file

@ -28,6 +28,11 @@
margin-left: 0;
}
}
.view-only-label {
align-items: center;
margin: auto 0;
}
}
.toolbar-right-block {

View file

@ -33,6 +33,8 @@
<span class="button-text"><%= t("repositories.hide_reminders") %></span>
</button>
<% end %>
<% else %>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% end %>
<div class="archived-label" data-view-mode="archived">
<%= render partial: 'repositories/toolbar/archive_label' %>

View file

@ -0,0 +1,10 @@
<button type="button" id="toolbarPrintLabel"
data-toggle="tooltip"
data-placement="bottom"
title="<%= t('repositories.show.button_tooltip.print_label') %>"
class="btn btn-light print-label-button auto-shrink-button"
data-dismiss="modal" data-url="<%= print_modal_repository_repository_rows_path(@repository) %>"
data-rows="[]" style="display: none">
<span class="fas fa-print"></span>
<span class="button-text"><%= t('repository_row.modal_print_label.print_label') %></span>
</button>

View file

@ -32,16 +32,7 @@
<span class="fas fa-download"></span>
<span class="button-text"><%= t("repositories.index.options_dropdown.export_items") %></span>
</button>
<button type="button" id="toolbarPrintLabel"
data-toggle="tooltip"
data-placement="bottom"
title="<%= t('repositories.show.button_tooltip.print_label') %>"
class="btn btn-light print-label-button auto-shrink-button"
data-dismiss="modal" data-url="<%= print_modal_repository_repository_rows_path(@repository) %>"
data-rows="[]" style="display: none">
<span class="fas fa-print"></span>
<span class="button-text"><%= t('repository_row.modal_print_label.print_label') %></span>
</button>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% if can_delete_repository_rows?(@repository) %>
<button type="button"
data-toggle="tooltip"
@ -76,5 +67,8 @@
</button>
</span>
<% elsif @repository.shared_with_read?(current_team) %>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<p class="view-only-label"><%= t('repositories.index.view_only_permission_label') %></p>
<% elsif can_read_repository?(@repository) %>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% end %>