2022-12-19 20:18:24 +08:00
|
|
|
<template id="protocolGeneralToolbar">
|
|
|
|
<div class="left-general-toolbar">
|
2023-03-14 16:12:54 +08:00
|
|
|
<% if can_create_protocols_in_repository?(@current_team) %>
|
|
|
|
<button data-toggle="modal"
|
|
|
|
data-target="#newProtocolModal"
|
|
|
|
class="btn btn-primary only-active"
|
2023-06-19 14:04:58 +08:00
|
|
|
title="<%= t("protocols.index.create_new_tooltip") %>"
|
2023-03-14 16:12:54 +08:00
|
|
|
>
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-new-task"></span>
|
2023-03-14 16:12:54 +08:00
|
|
|
<span class="hidden-xs"><%= t("protocols.index.create_new") %></span>
|
2022-12-19 20:18:24 +08:00
|
|
|
</button>
|
2023-03-14 16:12:54 +08:00
|
|
|
|
2023-07-10 19:57:13 +08:00
|
|
|
<div id="protocol-import-group" class="relative sci-btn-group only-active" role="group">
|
2023-10-03 15:11:27 +08:00
|
|
|
<button class="btn btn-light protocol-import-dropdown-button" title="<%= t("protocols.index.import_tooltip") %>"
|
2023-03-14 16:12:54 +08:00
|
|
|
data-toggle="dropdown"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="false">
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-import"></span><span class="hidden-xs"><%= t("protocols.index.import") %></span>
|
2023-03-14 16:12:54 +08:00
|
|
|
</button>
|
|
|
|
|
2023-09-21 20:07:34 +08:00
|
|
|
<ul class="dropdown-menu rounded !p-2.5 sn-shadow-menu-sm">
|
2022-12-19 20:18:24 +08:00
|
|
|
<li>
|
2023-09-18 19:15:55 +08:00
|
|
|
<a class="btn-open-file !pl-3 !py-2.5 hover:!bg-sn-super-light-blue rounded !text-sn-blue data-action='import'" >
|
|
|
|
<span><%= t('protocols.index.import_eln') %></span>
|
|
|
|
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
2023-03-14 16:12:54 +08:00
|
|
|
data-team-id="<%= @current_team.id %>" data-import-url="<%= import_protocols_path %>">
|
2022-12-19 20:18:24 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2023-10-02 16:28:29 +08:00
|
|
|
<% if Protocol.docx_parser_enabled?%>
|
2023-09-18 19:15:55 +08:00
|
|
|
<li>
|
2023-09-21 20:07:34 +08:00
|
|
|
<a class="btn-open-file btn-beta-icon !pl-3 mt-px !py-2.5 hover:!bg-sn-super-light-blue !text-sn-blue rounded data-action='import'" >
|
2023-09-18 19:15:55 +08:00
|
|
|
<span><%= t('protocols.index.import_docx')%></span>
|
|
|
|
<input type="file" value="" accept=".docx" data-role="import-file-input"
|
|
|
|
data-team-id="<%= @current_team.id %>" data-import-url="<%= import_protocols_path %>">
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<li>
|
|
|
|
<%= link_to t("protocols.index.import_protocols_io"),
|
|
|
|
'',
|
2023-09-21 20:07:34 +08:00
|
|
|
class: '!pl-3 !py-2.5 hover:!bg-sn-super-light-blue mt-px !text-sn-blue rounded',
|
2023-09-18 19:15:55 +08:00
|
|
|
data: { target: '#protocolsioModal', toggle: 'modal' } %>
|
2022-12-19 20:18:24 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
2023-03-14 16:12:54 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2022-12-19 20:18:24 +08:00
|
|
|
</div>
|
2023-05-09 20:53:50 +08:00
|
|
|
<%= render partial: 'shared/state_view_switch', locals: {
|
|
|
|
disabled: false,
|
|
|
|
switchable: true,
|
|
|
|
archived: templates_view_mode_archived?(type: @type),
|
|
|
|
active_url: protocols_path(type: :active),
|
|
|
|
archived_url: protocols_path(type: :archived),
|
|
|
|
} %>
|
2022-12-19 20:18:24 +08:00
|
|
|
</template>
|