2018-07-19 23:56:42 +08:00
|
|
|
<% content_for :head do %>
|
|
|
|
<meta name="turbolinks-cache-control" content="no-cache">
|
|
|
|
<% end %>
|
|
|
|
|
2016-07-21 19:11:15 +08:00
|
|
|
<% provide(:head_title, t("protocols.index.head_title")) %>
|
|
|
|
|
2018-05-25 23:14:22 +08:00
|
|
|
<% if current_team %>
|
2020-03-20 02:43:20 +08:00
|
|
|
<div class="content-pane" id="protocols-index">
|
2018-05-08 22:33:42 +08:00
|
|
|
<ul class="nav nav-tabs nav-settings">
|
|
|
|
<li role="presentation" class="<%= "active" if @type == :public %>">
|
|
|
|
<%= link_to t("protocols.index.navigation.public"), protocols_path(team: @current_team, type: :public) %>
|
|
|
|
</li>
|
|
|
|
<li role="presentation" class="<%= "active" if @type == :private %>">
|
|
|
|
<%= link_to t("protocols.index.navigation.private"), protocols_path(team: @current_team, type: :private) %>
|
|
|
|
</li>
|
2019-06-12 13:19:14 +08:00
|
|
|
<li role="presentation" class="<%= "active" if @type == :external_protocols %>">
|
|
|
|
<%= link_to t("protocols.index.navigation.external_protocols"),
|
|
|
|
protocols_path(team: @current_team, type: :external_protocols) %>
|
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<li role="presentation" class="<%= "active" if @type == :archive %>">
|
2018-05-12 00:02:17 +08:00
|
|
|
<%= link_to t("protocols.index.navigation.archive"), protocols_path(team: @current_team, type: :archive) %>
|
2018-05-08 22:33:42 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
2019-06-20 04:54:20 +08:00
|
|
|
<div class="tab-pane tab-pane-settings tab-pane-protocols active <%= @type %>" role="tabpanel">
|
2018-05-08 22:33:42 +08:00
|
|
|
<!-- Buttons container -->
|
|
|
|
<% if @type.in? [:public, :private] %>
|
|
|
|
<div class="protocols-description">
|
|
|
|
<%= t(@type == :public ? "protocols.index.public_description" : "protocols.index.private_description") %>
|
|
|
|
</div>
|
2019-12-04 18:27:22 +08:00
|
|
|
<div class="sci-btn-group" role="group">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button class="btn btn-primary" <%= can_create_protocols_in_repository?(@current_team) ? "data-action=create-new" : "disabled" %> data-url="<%= create_new_modal_protocols_path(team: @current_team, type: @type) %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-plus"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.create_new") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="edit">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-pencil-alt"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.edit") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="clone">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-copy"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.clone_btn") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if @type == :public %>
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="make-private" data-url="<%= make_private_protocols_path %>">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-eye-slash"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.make_private") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% elsif @type == :private %>
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="publish" data-url="<%= publish_protocols_path %>">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-eye"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.publish") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2019-12-04 18:27:22 +08:00
|
|
|
<div id="import-export-protocols" class="sci-btn-group" role="group">
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light btn-open-file <%= 'disabled hidden' unless can_create_protocols_in_repository?(@current_team) %>"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false">
|
2019-12-04 18:27:22 +08:00
|
|
|
<span class="fas fa-download"></span><span class="hidden-xs"> <%= t("protocols.index.import") %></span></button>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if can_create_protocols_in_repository?(@current_team) %>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li>
|
|
|
|
<a class="btn-link-alt btn-default-link btn-open-file" <%= can_create_protocols_in_repository?(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
2018-08-14 19:26:48 +08:00
|
|
|
<span class="fas fa-paperclip"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"><%= t("protocols.index.import_alt") %></span>
|
|
|
|
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
|
|
|
data-team-id="<%= @current_team.id %>"
|
|
|
|
data-type="<%= @type %>" data-import-url="<%= import_protocols_path %>"
|
|
|
|
<%= 'disabled="disabled"' unless can_create_protocols_in_repository?(@current_team) %>>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2018-08-21 17:35:22 +08:00
|
|
|
<%= link_to "#modal-import-json-protocol", data: { toggle: 'modal' } do %>
|
|
|
|
<span class="fas fa-paperclip"></span>
|
|
|
|
<span class="hidden-xs"><%= t("protocols.index.import_json") %></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="export" data-export-url="<%= export_protocols_path() %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-upload"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.export") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
</div>
|
2016-07-21 19:11:15 +08:00
|
|
|
|
2019-12-04 18:27:22 +08:00
|
|
|
<div class="sci-btn-group" role="group">
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="archive" data-url="<%= archive_protocols_path %>">
|
2018-08-14 19:26:48 +08:00
|
|
|
<span class="fas fa-archive"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.archive_action") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
</div>
|
2019-06-12 13:19:14 +08:00
|
|
|
<% elsif @type == :archive %>
|
2018-05-08 22:33:42 +08:00
|
|
|
<div class="protocols-description">
|
|
|
|
<%= t("protocols.index.archive.description") %>
|
|
|
|
</div>
|
2019-12-04 18:27:22 +08:00
|
|
|
<div class="sci-btn-group" role="group">
|
2020-09-03 23:05:25 +08:00
|
|
|
<button class="btn btn-light disabled hidden" data-action="restore" data-url="<%= restore_protocols_path %>">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-sync-alt"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-xs"> <%= t("protocols.index.restore") %></span>
|
2019-12-04 18:27:22 +08:00
|
|
|
</button>
|
2018-05-08 22:33:42 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-07-21 19:11:15 +08:00
|
|
|
|
2019-06-12 13:19:14 +08:00
|
|
|
<%# Main tab content %>
|
|
|
|
<% if @type == :external_protocols %>
|
|
|
|
<%= render partial: "protocols/index/external_protocols_tab.html.erb" %>
|
|
|
|
<% else %>
|
|
|
|
<%= render partial: "protocols/index/protocols_datatable.html.erb" %>
|
|
|
|
<% end %>
|
|
|
|
|
2016-07-21 19:11:15 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-25 23:14:22 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2018-05-08 22:33:42 +08:00
|
|
|
|
2017-09-19 21:02:16 +08:00
|
|
|
<div id="protocolsio-preview-modal-target"></div>
|
|
|
|
<%= render partial: "protocols/import_export/import_json_protocol_modal.html.erb" %>
|
2016-07-21 19:11:15 +08:00
|
|
|
|
|
|
|
<%= render partial: "protocols/index/create_new_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/make_private_results_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/publish_results_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/confirm_archive_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/archive_results_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/restore_results_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/import_results_modal.html.erb" %>
|
|
|
|
<%= render partial: "protocols/index/linked_children_modal.html.erb" %>
|
2016-12-13 17:39:18 +08:00
|
|
|
<%= render partial: "protocols/index/protocol_preview_modal.html.erb" %>
|
2016-07-21 19:11:15 +08:00
|
|
|
|
|
|
|
<%= render partial: "protocols/import_export/import_elements.html.erb" %>
|
|
|
|
|
2021-05-04 22:05:19 +08:00
|
|
|
<%= javascript_include_tag "handsontable.full" %>
|
2016-12-22 18:43:11 +08:00
|
|
|
|
|
|
|
<!-- Libraries for formulas -->
|
2019-05-13 16:45:12 +08:00
|
|
|
<%= render partial: "shared/formulas_libraries.html.erb" %>
|
2018-11-26 21:05:02 +08:00
|
|
|
|
|
|
|
<%= stylesheet_link_tag 'datatables' %>
|
2019-04-24 19:34:56 +08:00
|
|
|
<%= javascript_include_tag "assets/wopi/create_wopi_file" %>
|
2018-11-26 21:05:02 +08:00
|
|
|
<%= javascript_include_tag "protocols/index" %>
|
|
|
|
<%= javascript_include_tag "protocols/steps" %>
|
2020-12-22 22:25:30 +08:00
|
|
|
<%= javascript_pack_tag 'pdfjs/pdf_js' %>
|
|
|
|
<%= stylesheet_pack_tag 'pdfjs/pdf_js_styles' %>
|