scinote-web/app/views/repositories/show.html.erb
aignatov-bio 31554d0fd9
Merge pull request #4472 from aignatov-bio/ai-sci-7255-add-label-validation-to-print-modal
Add label validation and preview in print modal [SCI-7255][SCI-7256]
2022-09-28 11:32:39 +02:00

149 lines
6.5 KiB
Text

<% content_for :head do %>
<meta name="turbolinks-cache-control" content="no-cache">
<% end %>
<% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
<%= stylesheet_link_tag 'datatables' %>
<% provide(:container_class, "no-second-nav-container") %>
<% provide(:sidebar_url, sidebar_repositories_path) %>
<% provide(:sidebar_title, t('sidebar.repositories.sidebar_title')) %>
<%= content_for :sidebar do %>
<%= render partial: "sidebar", locals: { repositories: @repositories, archived: @repository.archived? } %>
<% end %>
<div id="alert-container"></div>
<div class="content-pane repository-show <%= @repository.active? ? "active" : "archived" %>" data-table-url="<%= load_table_repository_path(@repository) %>">
<div id="repository-toolbar" class="content-header">
<div class="title-row">
<% if @repository.active? %>
<div class="repository-title-name" data-view-mode="active">
<h1 class="name-container">
<% if @inline_editable_title_config.present? %>
<%= render partial: "shared/inline_editing",
locals: {
initial_value: @repository.name,
config: @inline_editable_title_config
} %>
<% else %>
<div class="read-only-name">
<%= @repository.name %>
</div>
<span class="repository-share-icon">
<%= inventory_shared_status_icon(@repository, current_team) %>
</span>
<% end %>
</h1>
<% if @repository.shared_with_anybody? %>
<% team_name = @repository.team == current_team ? t('repositories.show.your_team') : @repository.team.name %>
<div class="repository-subtitle"><%= t('repositories.show.subtitle', team_name: team_name) %></div>
<% end %>
</div>
<% end %>
<div class="repository-archived-title-name" data-view-mode="archived">
<% if @repository.archived? %>
<i class="fas fa-archive"></i>&nbsp;
<%= t('repositories.show.archived_inventory', repository_name: @repository.name) %>
<% else %>
<%= t('repositories.show.archived_inventory_items', repository_name: @repository.name) %>
<% end %>
</div>
<div class="repo-datatables-buttons">
<div class="share-repository-button" data-view-mode="active">
<% if can_share_repository?(@repository) %>
<%= link_to team_repository_share_modal_path(current_team, repository_id: @repository),
class: 'btn btn-light share-repo-option', remote: true, id: 'shareRepoBtn' do %>
<span class="fas fa-user-plus"></span>
<span class="hidden-xs"><%= t('repositories.index.share_inventory') %></span>
<% end %>
<% end %>
</div>
<button class="btn btn-light manage-repo-column-index"
data-modal-url="<%= repository_repository_columns_path(@repository) %>"
data-action="new">
<span class="fas fa-cog"></span>&nbsp;<%= t('repositories.index.columns') %>
</button>
<% unless @repository.is_a?(BmtRepository) %>
<%= render layout: "shared/view_switch", locals: {disabled: @repository.archived?} do %>
<li class="view-switch-archived" data-view-mode="active">
<i class="fas fa-archive button-icon"></i>
<%= t('repositories.show.show_archived_items') %>
</li>
<li class="view-switch-active" data-view-mode="archived">
<i class="fas fa-rocket button-icon"></i>
<%= t('repositories.show.show_active_items') %>
</li>
<% end %>
<% end %>
</div>
<div class="toolbar-delimiter"></div>
</div>
</div>
<!-- These buttons are appended to table in javascript, after table initialization -->
<div class="toolbar-filter-buttons" style="display:none">
</div>
<div class="print-label-modal-container"
data-print-url="<%= print_repository_repository_rows_path(repository_id: @repository) %>"
data-zebra-progress-url="<%= print_zpl_repository_repository_rows_path(repository_id: @repository)%>"
data-printers-url="<%= label_printers_path(format: :json) %>"
data-label-templates-url="<%= label_templates_path(format: :json) %>"
data-rows-url="<%= rows_to_print_repository_repository_rows_path(repository_id: @repository) %>"
data-print-validation-url="<%= validate_label_template_columns_repository_repository_rows_path(repository_id: @repository) %>"
data-label-preview-url="<%= zpl_preview_label_templates_path %>"
data-fluics-info-url="<%= Constants::SCINOTE_FLUICS_URL %>"
data-zebra-enabled="<%= Rails.configuration.x.zebra_print_enabled %>"
>
<print-modal-container
:show-modal = "showModal"
:row_ids = "row_ids"
:urls = "urls"
:zebra-enabled = "zebraEnabled"
@close="closeModal"
></print-modal-container>
</div>
<%= javascript_pack_tag 'vue/repository_print_modal' %>
<%= render partial: "repositories/repository_table",
locals: {
repository: @repository,
repository_index_link: repository_table_index_path(@repository)
}
%>
</div>
<%= render partial: 'repositories/import_repository_records_modal',
locals: { repository: @repository } %>
<%= render partial: "repositories/delete_record_modal" %>
<%= render partial: 'repositories/export_repository_modal',
locals: { repository: @repository } %>
<%= render partial: 'repository_columns/manage_column_modal', locals: { my_module_page: false } %>
<%= render partial: "repository_stock_values/manage_modal" %>
<%= render partial: "toolbar_buttons" %>
<% if @repository.is_a?(BmtRepository) %>
<%= render partial: 'save_bmt_filter_modal' %>
<%= javascript_pack_tag 'vue/bmt_filter' %>
<% else %>
<%= render partial: 'repository_filters' %>
<%= render partial: 'save_repository_filter_modal' %>
<% end %>
<%= javascript_include_tag 'repositories/edit' %>
<%= javascript_include_tag 'repositories/repository_datatable' %>
<%= javascript_include_tag "repositories/show" %>
<%= javascript_pack_tag 'custom/inputmask' %>
<%= javascript_pack_tag 'emoji_button' %>
<%= javascript_pack_tag 'pdfjs/pdf_js' %>
<%= stylesheet_pack_tag 'pdfjs/pdf_js_styles' %>
<script type="text/javascript" charset="utf-8">
var formatJS = "<%= datetime_picker_format_date_only %>"
</script>