2022-12-19 20:18:24 +08:00
|
|
|
<template id="protocolGeneralToolbar">
|
|
|
|
<div class="left-general-toolbar">
|
2023-01-25 04:17:50 +08:00
|
|
|
<%= button_to protocols_path(type: @type), disabled: !can_create_protocols_in_repository?(@current_team), class: 'btn btn-primary only-active' do %>
|
2022-12-19 20:18:24 +08:00
|
|
|
<span class="fas fa-plus"></span>
|
|
|
|
<span class="hidden-xs"><%= t("protocols.index.create_new") %></span>
|
|
|
|
<% end %>
|
|
|
|
|
2023-01-25 04:17:50 +08:00
|
|
|
<div id="protocol-import-group" class="sci-btn-group only-active" role="group">
|
2022-12-19 20:18:24 +08:00
|
|
|
<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 %>"
|
2023-01-23 21:23:27 +08:00
|
|
|
<%= 'disabled="disabled"' unless can_create_protocols_in_repository?(@current_team) %>>
|
2022-12-19 20:18:24 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
2023-02-21 18:03:06 +08:00
|
|
|
<%= link_to t("protocols.index.import_protocols_io"), '', data: { target: '#protocolsioModal', toggle: 'modal' } %>
|
2022-12-19 20:18:24 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|