scinote-web/app/views/repositories/_toolbar_buttons.html.erb

90 lines
3.9 KiB
Text
Raw Normal View History

<div id="toolbarButtonsDatatable" class="sci-btn-group">
2020-06-17 20:05:23 +08:00
<% if @repository.active? %>
<% if @repository.repository_snapshots.provisioning.any? %>
<div class='repository-provisioning-notice'>
<i class="fas fa-info-circle"></i>
<%= t('repositories.index.snapshot_provisioning_in_progress') %>
</div>
<% end %>
<% if can_create_repository_rows?(@repository) %>
2020-06-17 20:05:23 +08:00
<button type="button" class="btn btn-primary editAdd" id="addRepositoryRecord" data-view-mode="active">
<span class="fas fa-plus"></span>
<span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
</button>
<% end %>
<% if can_manage_repository_rows?(@repository) %>
<span id="editDeleteCopy" data-toggle="buttons" style="display:none">
<%if can_update_repository_rows?(@repository) %>
2020-06-17 20:05:23 +08:00
<button type="button" class="btn btn-light editAdd" id="editRepositoryRecord" disabled data-view-mode="active">
<span class="fas fa-pencil-alt"></span>
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
</button>
<% end %>
<% if can_create_repository_rows?(@repository) %>
2020-06-17 20:05:23 +08:00
<button type="button" class="btn btn-light copyRow" id="copyRepositoryRecords" disabled data-view-mode="active">
<span class="fas fa-copy"></span>
<span class="hidden-xs-custom"><%= t("repositories.copy_record") %></span>
</button>
<% end %>
<% if can_delete_repository_rows?(@repository) %>
<button type="button" class="btn btn-light"
2020-06-17 20:05:23 +08:00
id="archiveRepositoryRecordsButton" disabled data-view-mode="active">
<span class="fas fa-archive"></span>
<span class="hidden-xs-custom"><%= t'repositories.archive_record' %></span>
</button>
<% end %>
2020-06-17 20:05:23 +08:00
<button type="button" class="btn btn-light" id="restoreRepositoryRecords" disabled data-view-mode="archived">
<span class="fas fa-undo"></span>
<span class="hidden-xs"><%= t("repositories.restore_record") %></span>
</button>
<% if can_delete_repository_rows?(@repository) %>
<button type="button" class="btn btn-light" id="deleteRepositoryRecords" disabled data-view-mode="archived">
<span class="fas fa-trash"></span>
<span class="hidden-xs"><%= t("repositories.delete_record") %></span>
</button>
<% end %>
</span>
<span id="saveCancel" data-toggle="buttons" style="display:none">
2020-06-15 21:52:50 +08:00
<button type="button" class="btn btn-success" id="saveRecord" data-view-mode="active">
<span class="fas fa-save"></span>
<%= t("repositories.save_record") %>
</button>
2020-06-15 21:52:50 +08:00
<button type="button" class="btn btn-light" id="cancelSave" data-view-mode="active">
<span class="fas fa-times-circle"></span>
<%= t("repositories.cancel_save") %>
</button>
</span>
<% elsif @repository.shared_with?(current_team) %>
<p class="view-only-label"><%= t('repositories.index.view_only_permission_label') %></p>
<% end %>
2020-06-17 20:05:23 +08:00
<% end %>
<button type="button" id="toolbarPrintLabel" class="btn btn-light print-label-button" data-dismiss="modal" data-url="<%= print_modal_repository_repository_rows_path(@repository) %>" data-rows="[]" style="display: none">
<span class="fas fa-print"></span>
<%= t('repository_row.modal_print_label.print_label') %>
</button>
2020-06-17 20:05:23 +08:00
<div class="archived-label" data-view-mode="archived">
<% if @repository.active? %>
<%= t('repositories.show.archived_view_label.active', repository_name: @repository.name) %>
<% else %>
<table>
<tr>
<td><%= t('repositories.show.archived_view_label.archived_on') %></td>
<td><%= I18n.l(@repository.archived_on, format: :full) %></td>
</tr>
<tr>
<td><%= t('repositories.show.archived_view_label.archived_by') %></td>
<td><%= @repository.archived_by.full_name %></td>
</tr>
</table>
<% end %>
</div>
</div>