scinote-web/app/views/protocols/_steps.html.erb

53 lines
2.1 KiB
Text
Raw Normal View History

<% if can_manage_protocol_in_module?(@protocol) || can_manage_protocol_in_repository?(@protocol) %>
<div class="row">
2020-04-24 17:50:03 +08:00
<div class="expand-all-steps" style="display: <%= 'none' if @protocol.steps.empty? %>">
<a class="btn btn-light" data-action="collapse-steps">
<span class="fas fa-caret-up"></span>
2020-05-13 16:58:40 +08:00
<span><%= t("protocols.steps.collapse_label") %></a></span>
2020-04-24 17:50:03 +08:00
<a class="btn btn-light" data-action="expand-steps">
<span class="fas fa-caret-down"></span>
2020-05-13 16:58:40 +08:00
<span><%= t("protocols.steps.expand_label") %></a></span>
</div>
2016-07-21 19:11:15 +08:00
</div>
2020-05-22 18:51:12 +08:00
<% unless @my_module %>
<div class="row">
<div class="pull-left" style="margin: 0 0 20px 15px;">
<a href="#"
class="btn btn-primary"
data-action="new-step"
2020-11-05 23:14:40 +08:00
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>"
style="<%= @protocol.steps.empty? ? 'display: none;' : '' %>">
2020-05-22 18:51:12 +08:00
<span class="fas fa-plus" aria-hidden="true"></span>
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
</a>
</div>
2020-05-22 18:29:14 +08:00
</div>
2020-05-22 18:51:12 +08:00
<% end %>
<% end %>
2016-07-21 19:11:15 +08:00
<div id="steps">
<% @protocol.steps.order(:position).each do |step| %>
<%= render partial: "steps/step.html.erb", locals: { step: step } %>
2016-07-21 19:11:15 +08:00
<% end %>
</div>
<% if can_manage_protocol_in_module?(@protocol) || can_manage_protocol_in_repository?(@protocol) %>
<div class="row">
<div class="pull-left" style="margin: 0 0 20px 15px;">
<a href="#"
2020-01-07 23:13:34 +08:00
class="btn btn-primary"
data-action="new-step"
2020-11-05 23:14:40 +08:00
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>">
<span class="fas fa-plus" aria-hidden="true"></span>
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
</a>
</div>
2019-07-26 17:01:36 +08:00
</div>
<% end %>
2019-07-26 17:01:36 +08:00
<%= javascript_include_tag "handsontable.full.min" %>
2016-09-05 21:06:48 +08:00
<!-- Libraries for formulas -->
<%= render partial: "shared/formulas_libraries.html.erb" %>
2019-03-16 03:59:15 +08:00
<%= javascript_include_tag "assets/wopi/create_wopi_file" %>
<%= javascript_include_tag "protocols/steps" %>