2019-05-14 15:43:02 +08:00
|
|
|
<div class="btn-group protocol-button" role="group" aria-label="">
|
2016-07-21 19:11:15 +08:00
|
|
|
<div class="btn-group">
|
2018-04-25 19:57:12 +08:00
|
|
|
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-download"></span>
|
2018-04-25 19:57:12 +08:00
|
|
|
<span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.load_protocol") %></span>
|
|
|
|
</a>
|
2016-07-21 19:11:15 +08:00
|
|
|
<ul class="dropdown-menu">
|
2018-02-02 01:41:28 +08:00
|
|
|
<% if can_manage_protocol_in_module?(@protocol) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to load_from_repository_modal_protocol_path(@protocol, format: :json), remote: true, data: { action: "load-from-repository" } do %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-book"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_repository") %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<li class="disabled"><a href="#"><span class="fas fa-book"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_repository") %></a></li>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
2018-02-02 01:41:28 +08:00
|
|
|
<% if can_manage_protocol_in_module?(@protocol) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li>
|
|
|
|
<a class="btn-open-file" href="#" data-action="load-from-file" data-import-url="<%= load_from_file_protocol_path(@protocol, format: :json) %>">
|
2018-08-14 19:26:48 +08:00
|
|
|
<span class="fas fa-paperclip"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_file") %>
|
2018-01-15 20:43:09 +08:00
|
|
|
<input type="file" value="" accept=".eln" data-turbolinks="false">
|
2016-07-21 19:11:15 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
2018-08-14 19:26:48 +08:00
|
|
|
<li class="disabled"><a href="#"><span class="fas fa-paperclip"></span> <%= t("my_modules.protocols.buttons.load_protocol_from_file") %></a></li>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2018-01-29 18:36:36 +08:00
|
|
|
<% if can_read_experiment?(@my_module.experiment) %>
|
2019-04-02 17:50:37 +08:00
|
|
|
<%= 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 } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<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>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
2018-02-02 01:41:28 +08:00
|
|
|
<% if can_read_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %>
|
2018-06-08 15:41:04 +08:00
|
|
|
<span data-hook="protocol-copy-to-repository">
|
|
|
|
<%= link_to copy_to_repository_modal_protocol_path(@protocol, format: :json), id: "protocol-copy-to-repository", class: "btn btn-default", remote: true, data: { action: "copy-to-repository" } do %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-copy"></span><span class="hidden-xs-custom"> <%= t("my_modules.protocols.buttons.copy_to_repository") %></span>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
2018-06-08 15:41:04 +08:00
|
|
|
</span>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<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>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
2016-11-09 21:57:26 +08:00
|
|
|
</div>
|