2019-09-30 20:30:03 +08:00
|
|
|
<% 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>
|
2019-09-30 20:30:03 +08:00
|
|
|
</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 %>
|
2019-05-11 22:04:28 +08:00
|
|
|
<% end %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<div id="steps">
|
|
|
|
<% @protocol.steps.order(:position).each do |step| %>
|
2018-11-23 22:07:08 +08:00
|
|
|
<%= render partial: "steps/step.html.erb", locals: { step: step } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2019-09-30 20:30:03 +08:00
|
|
|
<% 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"
|
2019-09-30 20:30:03 +08:00
|
|
|
data-action="new-step"
|
2020-11-05 23:14:40 +08:00
|
|
|
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>">
|
2019-09-30 20:30:03 +08:00
|
|
|
<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>
|
2019-09-30 20:30:03 +08:00
|
|
|
<% end %>
|
2019-07-26 17:01:36 +08:00
|
|
|
|
2018-11-26 21:05:02 +08:00
|
|
|
<%= javascript_include_tag "handsontable.full.min" %>
|
2016-09-05 21:06:48 +08:00
|
|
|
|
|
|
|
<!-- Libraries for formulas -->
|
2019-05-13 16:45:12 +08:00
|
|
|
<%= render partial: "shared/formulas_libraries.html.erb" %>
|
2018-11-26 21:05:02 +08:00
|
|
|
|
2019-03-16 03:59:15 +08:00
|
|
|
<%= javascript_include_tag "assets/wopi/create_wopi_file" %>
|
2018-11-26 21:05:02 +08:00
|
|
|
<%= javascript_include_tag "protocols/steps" %>
|