scinote-web/app/views/repositories/toolbar/_row_actions.html.erb

72 lines
3.5 KiB
Text
Raw Normal View History

<% if can_manage_repository_rows?(@repository) %>
<span id="editDeleteCopy" data-toggle="buttons" style="display:none">
<% if can_manage_repository_rows?(@repository) %>
<button type="button" title="<%= t('repositories.show.button_tooltip.edit') %>"
class="btn btn-light editAdd auto-shrink-button"
id="editRepositoryRecord" data-view-mode="active">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-edit"></span>
<span class="button-text"><%= t("repositories.edit_record") %></span>
</button>
<% end %>
<% if can_create_repository_rows?(@repository) %>
<button type="button"
data-toggle="tooltip"
data-placement="bottom"
title="<%= t('repositories.show.button_tooltip.duplicate') %>"
class="btn btn-light copyRow auto-shrink-button"
id="copyRepositoryRecords" disabled data-view-mode="active">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-duplicate"></span>
<span class="button-text"><%= t("repositories.copy_record") %></span>
</button>
<% end %>
<button class="btn btn-light auto-shrink-button"
data-toggle="tooltip"
data-placement="bottom"
title="<%= t('repositories.show.button_tooltip.export') %>"
id="exportRepositoriesButton">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-export"></span>
<span class="button-text"><%= t("repositories.index.options_dropdown.export_items") %></span>
</button>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% if can_delete_repository_rows?(@repository) %>
<button type="button"
data-toggle="tooltip"
data-placement="bottom"
title="<%= t('repositories.show.button_tooltip.archive') %>"
class="btn btn-light auto-shrink-button"
id="archiveRepositoryRecordsButton" disabled data-view-mode="active">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-archive"></span>
<span class="button-text"><%= t'repositories.archive_record' %></span>
</button>
<% end %>
<button type="button" class="btn btn-light auto-shrink-button" id="restoreRepositoryRecords" disabled data-view-mode="archived">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-restore"></span>
<span class="button-text"><%= t("repositories.restore_record") %></span>
</button>
<% if can_delete_repository_rows?(@repository) %>
<button type="button" class="btn btn-light auto-shrink-buttons" id="deleteRepositoryRecords" disabled data-view-mode="archived">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-delete"></span>
<span class="button-text"><%= t("repositories.delete_record") %></span>
</button>
<% end %>
</span>
<span id="saveCancel" data-toggle="buttons" style="display:none">
<button type="button" class="btn btn-success prevent-shrink" id="saveRecord" data-view-mode="active">
<span class="fas fa-save"></span>
<%= t("repositories.save_record") %>
</button>
<button type="button" class="btn btn-light prevent-shrink" id="cancelSave" data-view-mode="active">
2023-06-08 23:33:50 +08:00
<span class="sn-icon sn-icon-close"></span>
<%= t("repositories.cancel_save") %>
</button>
</span>
<% elsif @repository.shared_with_read?(current_team) %>
<p class="view-only-label"><%= t('repositories.index.view_only_permission_label') %></p>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% elsif can_read_repository?(@repository) %>
<%= render partial: 'repositories/toolbar/print_label_button' %>
<% end %>