2022-12-19 20:18:24 +08:00
|
|
|
<template id="protocolGeneralToolbar">
|
|
|
|
<div class="left-general-toolbar">
|
2023-03-10 18:45:32 +08:00
|
|
|
<button data-toggle="modal"
|
|
|
|
data-target="#newProtocolModal"
|
|
|
|
<%= 'disabled' if !can_create_protocols_in_repository?(@current_team) %>
|
|
|
|
class="btn btn-primary only-active"
|
|
|
|
>
|
|
|
|
<span class="fas fa-plus"></span>
|
|
|
|
<span class="hidden-xs"><%= t("protocols.index.create_new") %></span>
|
|
|
|
</button>
|
2022-12-19 20:18:24 +08:00
|
|
|
|
2023-03-10 18:45:32 +08:00
|
|
|
<div id="protocol-import-group" class="sci-btn-group only-active" 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-upload"></span><span class="hidden-xs"><%= t("protocols.index.import") %></span>
|
2022-12-19 20:18:24 +08:00
|
|
|
</button>
|
2023-03-10 18:45:32 +08:00
|
|
|
<% if can_create_protocols_in_repository?(@current_team) %>
|
2022-12-19 20:18:24 +08:00
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li>
|
2023-03-10 18:45:32 +08:00
|
|
|
<a class="btn-link-alt btn-default-link btn-open-file" <%= can_create_protocols_in_repository?(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
2022-12-19 20:18:24 +08:00
|
|
|
<span><%= t("protocols.index.import_alt") %></span>
|
|
|
|
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
2023-02-27 20:22:01 +08:00
|
|
|
data-team-id="<%= @current_team.id %>" 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>
|
2023-03-10 18:45:32 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2022-12-19 20:18:24 +08:00
|
|
|
</div>
|
|
|
|
</template>
|