mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 05:05:55 +08:00
138 lines
7.3 KiB
Text
138 lines
7.3 KiB
Text
|
<% provide(:head_title, t("protocols.index.head_title")) %>
|
||
|
|
||
|
<% if @organizations.count > 0 %>
|
||
|
<%= render partial: "protocols/breadcrumbs.html.erb", locals: { organizations: @organizations, current_organization: @current_organization, type: @type } %>
|
||
|
|
||
|
<ul class="nav nav-tabs nav-settings">
|
||
|
<li role="presentation" class="<%= "active" if @type == :public %>">
|
||
|
<%= link_to t("protocols.index.navigation.public"), protocols_path(organization: @current_organization, type: :public) %>
|
||
|
</li>
|
||
|
<li role="presentation" class="<%= "active" if @type == :private %>">
|
||
|
<%= link_to t("protocols.index.navigation.private"), protocols_path(organization: @current_organization, type: :private) %>
|
||
|
</li>
|
||
|
<li role="presentation" class="<%= "active" if @type == :archive %>">
|
||
|
<%= link_to protocols_path(organization: @current_organization, type: :archive) do %>
|
||
|
<span class="glyphicon glyphicon-briefcase"></span>
|
||
|
<% end %>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<div class="tab-content">
|
||
|
<div class="tab-pane tab-pane-settings tab-pane-protocols active" role="tabpanel">
|
||
|
<!-- Buttons container -->
|
||
|
<% if @type.in? [:public, :private] %>
|
||
|
<div class="protocols-description">
|
||
|
<%= t(@type == :public ? "protocols.index.public_description" : "protocols.index.private_description") %>
|
||
|
</div>
|
||
|
<div class="btn-group" role="group">
|
||
|
<a class="btn btn-default" <%= can_create_new_protocol(@current_organization) ? "data-action=create-new" : "disabled=disabled" %> data-url="<%= create_new_modal_protocols_path(organization: @current_organization, type: @type) %>">
|
||
|
<span class="glyphicon glyphicon-plus"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.create_new") %></span>
|
||
|
</a>
|
||
|
<a class="btn btn-default" data-action="edit">
|
||
|
<span class="glyphicon glyphicon-pencil"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.edit") %></span>
|
||
|
</a>
|
||
|
<a class="btn btn-default" data-action="clone">
|
||
|
<span class="glyphicon glyphicon-duplicate"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.clone_btn") %></span>
|
||
|
</a>
|
||
|
<% if @type == :public %>
|
||
|
<a class="btn btn-default" data-action="make-private" data-url="<%= make_private_protocols_path %>">
|
||
|
<span class="glyphicon glyphicon-eye-close"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.make_private") %></span>
|
||
|
</a>
|
||
|
<% elsif @type == :private %>
|
||
|
<a class="btn btn-primary" data-action="publish" data-url="<%= publish_protocols_path %>">
|
||
|
<span class="glyphicon glyphicon-open"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.publish") %></span>
|
||
|
</a>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
|
||
|
<div class="btn-group" role="group">
|
||
|
<a class="btn btn-default btn-open-file" <%= can_import_protocols(@current_organization) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
||
|
<span class="glyphicon glyphicon-import"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.import") %></span>
|
||
|
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
||
|
data-organization-id="<%= @current_organization.id %>"
|
||
|
data-type="<%= @type %>" data-import-url="<%= import_protocols_path %>"
|
||
|
<%= 'disabled="disabled"' unless can_import_protocols(@current_organization) %>>
|
||
|
</a>
|
||
|
<a class="btn btn-default" data-action="export">
|
||
|
<span class="glyphicon glyphicon-export"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.export") %></span>
|
||
|
</a>
|
||
|
</div>
|
||
|
|
||
|
<div class="btn-group" role="group">
|
||
|
<a class="btn btn-default" data-action="archive" data-url="<%= archive_protocols_path %>">
|
||
|
<span class="glyphicon glyphicon-trash"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.archive_action") %></span>
|
||
|
</a>
|
||
|
</div>
|
||
|
<% else %>
|
||
|
<div class="protocols-description">
|
||
|
<%= t("protocols.index.archive.description") %>
|
||
|
</div>
|
||
|
<div class="btn-group" role="group">
|
||
|
<a class="btn btn-default" data-action="restore" data-url="<%= restore_protocols_path %>">
|
||
|
<span class="glyphicon glyphicon-refresh"></span>
|
||
|
<span class="hidden-xs"> <%= t("protocols.index.restore") %></span>
|
||
|
</a>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
|
||
|
<div id="protocols-datatable-spinner">
|
||
|
<div class="protocols-datatable">
|
||
|
<table id="protocols-table" class="table" data-organization-id="<%= @current_organization.id %>" data-type="<%= @type %>" data-source="<%= datatable_protocols_path(organization: @current_organization, type: @type) %>">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th id="select-all"><input name="select_all" value="1" type="checkbox"></th>
|
||
|
<th id="protocol-name"><%= t("protocols.index.thead_name") %></th>
|
||
|
<th id="protocol-keywords"><%= t("protocols.index.thead_keywords") %></th>
|
||
|
<th id="protocol-nr-of-linked-children"><%= t("protocols.index.thead_nr_of_linked_children") %></th>
|
||
|
<% if @type == :public %>
|
||
|
<th id="protocol-published-by"><%= t("protocols.index.thead_published_by") %></th>
|
||
|
<th id="protocol-published-on"><%= t("protocols.index.thead_published_on") %></th>
|
||
|
<% elsif @type == :private %>
|
||
|
<th id="protocol-added-by"><%= t("protocols.index.thead_added_by") %></th>
|
||
|
<th id="protocol-created-at"><%= t("protocols.index.thead_created_at") %></th>
|
||
|
<% else %>
|
||
|
<th id="protocol-archived-by"><%= t("protocols.index.thead_archived_by") %></th>
|
||
|
<th id="protocol-archived-on"><%= t("protocols.index.thead_archived_on") %></th>
|
||
|
<% end %>
|
||
|
<th id="protocol-updated-at"><%= t("protocols.index.thead_updated_at") %></th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody></tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<% else %>
|
||
|
<!-- Show link to organization management if member of
|
||
|
no organizations -->
|
||
|
<div class="jumbotron">
|
||
|
<h2><%= t("protocols.index.no_orgs.title") %></h2>
|
||
|
<p><%= t("protocols.index.no_orgs.text") %></p>
|
||
|
<p>
|
||
|
<%= link_to t("protocols.index.no_orgs.btn"), organizations_path, class: "btn btn-primary" %>
|
||
|
</p>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
|
||
|
<%= 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" %>
|
||
|
|
||
|
<%= render partial: "protocols/import_export/import_elements.html.erb" %>
|
||
|
|
||
|
<%= stylesheet_link_tag 'datatables' %>
|
||
|
<%= javascript_include_tag "protocols/index" %>
|