mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 06:35:14 +08:00
dfafd4767c
[SCI-3929]
41 lines
2.8 KiB
Text
41 lines
2.8 KiB
Text
<div class="btn-group protocol-button" role="group" aria-label="">
|
|
<div class="btn-group">
|
|
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">
|
|
<span class="fas fa-download"></span>
|
|
<span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.load_protocol") %></span>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<% if can_manage_protocol_in_module?(@protocol) %>
|
|
<li>
|
|
<%= link_to load_from_repository_modal_protocol_path(@protocol, format: :json), remote: true, data: { action: "load-from-repository" } do %>
|
|
<span class="fas fa-book"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_repository") %>
|
|
<% end %>
|
|
</li>
|
|
<% else %>
|
|
<li class="disabled"><a href="#"><span class="fas fa-book"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_repository") %></a></li>
|
|
<% end %>
|
|
<% if can_manage_protocol_in_module?(@protocol) %>
|
|
<li>
|
|
<a class="btn-open-file" href="#" data-action="load-from-file" data-import-url="<%= load_from_file_protocol_path(@protocol, format: :json) %>">
|
|
<span class="fas fa-paperclip"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_file") %>
|
|
<input type="file" value="" accept=".eln" data-turbolinks="false">
|
|
</a>
|
|
</li>
|
|
<% else %>
|
|
<li class="disabled"><a href="#"><span class="fas fa-paperclip"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_file") %></a></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<% if can_read_experiment?(@my_module.experiment) %>
|
|
<%= link_to raw("<span class=\"fas fa-upload\"></span><span class=\"hidden-xs-custom\"> " + t('my_modules.protocols.buttons.export') + "</span>"), export_protocols_path(protocol_ids: @protocol.id, my_module_id: @my_module.id), class: "btn btn-default", data: { turbolinks: false } %>
|
|
<% else %>
|
|
<a href="#" class="btn btn-default disabled"><span class="fas fa-upload"></span><span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.export") %></span></a>
|
|
<% end %>
|
|
<% if can_read_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %>
|
|
<a id="protocol-copy-to-repository" class="btn btn-default" data-action="copy-to-repository" data-hook="protocol-copy-to-repository" data-remote="true" href="<%= copy_to_repository_modal_protocol_path(@protocol, format: :json) %>">
|
|
<span class="fas fa-copy"></span><span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.copy_to_repository") %></span>
|
|
</a>
|
|
<% else %>
|
|
<a href="#" class="btn btn-default disabled"><span class="fas fa-copy"></span><span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.copy_to_repository") %></span></a>
|
|
<% end %>
|
|
</div>
|