scinote-web/app/views/my_modules/protocols.html.erb

180 lines
7.7 KiB
Text

<% if flash["repository_snapshot_error"] %>
<%= render 'shared/dialog',
id: "snapshot-error",
type: "error",
shown: true,
title: t("my_modules.modals.transition_snapshot_error.title"),
body:
t(
"my_modules.modals.transition_snapshot_error.body_html",
repository: Repository.find(flash["repository_snapshot_error"]["repository_id"]).name
)
%>
<% end %>
<% provide(:head_title, t("my_modules.protocols.head_title", project: h(@project.name), module: h(@my_module.name)).html_safe) %>
<% content_for :open_mobile_app_button do %>
<span class="open-mobile-app-container">
<%= link_to(pwa_mobile_app_url(@current_team.id, @project.id, @experiment.id, @my_module.id, @protocol.id, @protocol.first_step_id, request.host),
class: 'btn btn-light-link open-mobile-app-button') do %>
<%= t('my_modules.open_mobile_app') %>
<% end %>
</span>
<% end %>
<% provide(:sidebar_title, t("sidebar.my_module.sidebar_title")) %>
<%= content_for :sidebar do %>
<%= render partial: "shared/sidebar/#{@my_module.archived_branch? ? 'archived_my_module' : 'my_module'}.html.erb",
locals: {
my_modules: @experiment_my_modules,
experiment: @my_module.experiment,
current_my_module: @my_module
}
%>
<% end %>
<%= render partial: 'shared/drag_n_drop_overlay' %>
<%= render partial: 'shared/secondary_navigation', locals: { render_breadcrumbs: true, project: @experiment.project, experiment: @experiment } %>
<div class="content-pane my-modules-protocols-index" data-task-id="<%= @my_module.id %>">
<div class="my-module-position-container">
<!-- Details -->
<div class="task-section task-information hidden">
<div id="task-details" class="task-section-header">
<div class="task-flows">
<%= render partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module } if @my_module.my_module_status_flow %>
</div>
<div class="task-details-container">
<a class="task-section-caret collapsed" role="button" data-toggle="collapse" href="#details-container" aria-expanded="false" aria-controls="details-container">
<i class="fas fa-caret-right"></i>
<span id="taskDetailsLabel" class="task-section-title">
<h2>
<%= t('my_modules.details.title') %>
</h2>
</span>
</a>
<span class="dropdown task-details-dropdown-container">
<a href="#"
id="taskDetailsButton"
class="block-icon task-details-button dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="true">
<i class="fas fa-info-circle"></i>
</a>
<div class="dropdown-menu" aria-labelledby="taskDetailsButton">
<%= render partial: "module_header_details_popover.html.erb" %>
</div>
</span>
</div>
</div>
<div id="details-container" class="task-details collapse">
<%= render partial: 'my_module_details' %>
</div>
</div>
<!-- Notes -->
<div class="task-section hidden">
<div class="task-section-header">
<a class="task-section-caret" role="button" data-toggle="collapse" href="#notes-container" aria-expanded="true" aria-controls="notes-container">
<i class="fas fa-caret-right"></i>
<span class="task-section-title">
<h2><%= t('my_modules.notes.title') %></h2>
</span>
</a>
</div>
<div class="collapse in" id="notes-container" aria-expanded="true">
<%= render partial: "my_module_notes" %>
</div>
</div>
<!-- Assigned items -->
<div class="task-section hidden">
<div class="task-section-header">
<a class="task-section-caret" role="button" data-toggle="collapse" href="#assigned-items-container" aria-expanded="true" aria-controls="assigned-items-container">
<i class="fas fa-caret-right"></i>
<span class="task-section-title ">
<h2 class="assigned-items-title" data-assigned-items-count="<%= @assigned_repositories.map(&:assigned_rows_count).sum %>">
<%= t('my_modules.assigned_items.title') %>
</h2>
</span>
</a>
<div class="actions-block">
<% if can_assign_my_module_repository_rows?(@my_module) %>
<div class="dropdown repositories-assign-container sci-dropdown" data-repositories-url="<%= my_module_repositories_dropdown_list_path(@my_module) %>">
<a href="#" id="repositories-assign-button" class="btn btn-secondary btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="fas fa-file-signature"></span>
<span><%= t('my_modules.assigned_items.assign_from') %></span>
<span class="caret pull-right"></span>
</a>
<ul class="dropdown-menu repositories-dropdown-menu perfect-scrollbar" aria-labelledby="repositories-assign-button">
</ul>
</div>
<% end %>
</div>
</div>
<div class="collapse in panel-group" id="assigned-items-container" aria-expanded="true"
data-repositories-list-url="<%= my_module_repositories_list_html_path(@my_module) %>">
<%= render partial: "my_modules/repositories/repositories_list" %>
</div>
<%= render partial: "my_modules/repositories/full_view_modal" %>
<%= render partial: "my_modules/modals/update_repository_records_modal" %>
</div>
<!-- Protocol -->
<div class="task-section">
<div
id="protocolContainer"
data-protocol-url="<%= protocol_my_module_path(@my_module) %>"
data-date-format="<%= datetime_picker_format_date_only %>"
data-user-utc-offset="<%= ActiveSupport::TimeZone.find_tzinfo(current_user.time_zone).utc_offset %>"
>
<protocol-container
:protocol-url="protocolUrl"
/>
</div>
</div>
</div>
</div>
<%= render partial: "my_modules/protocols/print_protocol_modal", locals: { protocol: @protocol, comments_enabled: true} %>
<!-- URL for status bar refreshing -->
<div class="hidden" data-role="protocol-status-bar-url" data-url="<%= protocol_status_bar_protocol_path(@protocol) %>"></div>
<!-- Confirm link update modal -->
<%= render partial: "my_modules/protocols/confirm_link_update_modal.html.erb" %>
<!-- Load from repository modal -->
<%= render partial: "my_modules/protocols/load_from_repository_modal.html.erb" %>
<!-- Copy to repository protocol modal -->
<%= render partial: "my_modules/protocols/copy_to_repository_modal.html.erb" %>
<!-- Import protocol elements -->
<%= render partial: "protocols/import_export/import_elements.html.erb" %>
<!-- Status flow modal -->
<% if @my_module.my_module_status_flow %>
<%= render partial: 'my_modules/modals/status_flow_modal.html.erb' %>
<% end %>
<!-- Create new office file modal -->
<%= render partial: 'assets/wopi/create_wopi_file_modal.html.erb' %>
<!-- Delete file modal -->
<%= render partial: 'assets/asset_delete_modal.html.erb' %>
<%= render partial: 'my_modules/repositories/consume_stock_modal.html.erb'%>
<%= stylesheet_link_tag 'datatables' %>
<%= javascript_include_tag "handsontable.full" %>
<%= render partial: "shared/formulas_libraries.html.erb" %>
<%= javascript_include_tag("my_modules/protocols") %>
<%= javascript_include_tag("my_modules/status_flow") %>
<%= javascript_pack_tag 'emoji_button' %>
<%= javascript_include_tag("my_modules/repositories") %>
<%= javascript_include_tag("my_modules/pwa_mobile_app") %>
<%= javascript_pack_tag 'pdfjs/pdf_js' %>
<%= stylesheet_pack_tag 'pdfjs/pdf_js_styles' %>
<%= javascript_pack_tag 'vue/protocol' %>