mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 13:45:25 +08:00
33 lines
1.6 KiB
Text
33 lines
1.6 KiB
Text
<template id="protocolGeneralToolbar">
|
|
<div class="left-general-toolbar">
|
|
<%= button_to protocols_path(type: @type), disabled: !can_create_protocols_in_repository?(@current_team), class: 'btn btn-primary' do %>
|
|
<span class="fas fa-plus"></span>
|
|
<span class="hidden-xs"><%= t("protocols.index.create_new") %></span>
|
|
<% end %>
|
|
|
|
<div id="protocol-import-group" class="sci-btn-group" role="group">
|
|
<button class="btn btn-light btn-open-file <%= 'disabled' unless can_create_protocols_in_repository?(@current_team) %>"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="false">
|
|
<span class="fas fa-download"></span><span class="hidden-xs"><%= t("protocols.index.import") %></span>
|
|
</button>
|
|
<% 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"' %>>
|
|
<span><%= 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>
|
|
<%= link_to t("protocols.index.import_protocols_io"), protocolsio_protocols_path() %>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</template>
|