scinote-web/app/views/protocols/index/_general_toolbar.html.erb

44 lines
1.9 KiB
Text
Raw Normal View History

<template id="protocolGeneralToolbar">
<div class="left-general-toolbar">
<% if can_create_protocols_in_repository?(@current_team) %>
<button data-toggle="modal"
data-target="#newProtocolModal"
class="btn btn-primary only-active"
title="<%= t("protocols.index.create_new_tooltip") %>"
>
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-new-task"></span>
<span class="hidden-xs"><%= t("protocols.index.create_new") %></span>
</button>
<div id="protocol-import-group" class="relative sci-btn-group only-active" role="group">
2023-06-21 16:00:46 +08:00
<button class="btn btn-light btn-open-file" title="<%= t("protocols.index.import_tooltip") %>"
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>
</button>
<ul class="dropdown-menu">
<li>
2023-06-19 21:45:22 +08:00
<a class="btn-link-alt btn-secondary-link btn-open-file" <%= can_create_protocols_in_repository?(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
<span><%= t("protocols.index.import_alt") %></span>
<input type="file" value="" accept=".eln,.docx" data-role="import-file-input"
data-team-id="<%= @current_team.id %>" data-import-url="<%= import_protocols_path %>">
</a>
</li>
<li class="import-protocols-io">
<%= link_to t("protocols.index.import_protocols_io"), '', data: { target: '#protocolsioModal', toggle: 'modal' } %>
</li>
</ul>
</div>
<% end %>
</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),
} %>
</template>