mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 20:19:05 +08:00
[SCI-5287] Show step collapse/expand on task
This commit is contained in:
parent
2d4b0fdbdc
commit
62af5cc723
1 changed files with 19 additions and 21 deletions
|
@ -1,28 +1,26 @@
|
|||
<div class="row">
|
||||
<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>
|
||||
<span><%= t("protocols.steps.collapse_label") %></a></span>
|
||||
<a class="btn btn-light" data-action="expand-steps">
|
||||
<span class="fas fa-caret-down"></span>
|
||||
<span><%= t("protocols.steps.expand_label") %></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<% if can_manage_protocol_in_module?(@protocol) || can_manage_protocol_in_repository?(@protocol) %>
|
||||
<div class="row">
|
||||
<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>
|
||||
<span><%= t("protocols.steps.collapse_label") %></a></span>
|
||||
<a class="btn btn-light" data-action="expand-steps">
|
||||
<span class="fas fa-caret-down"></span>
|
||||
<span><%= t("protocols.steps.expand_label") %></a></span>
|
||||
<div class="pull-left" style="margin: 0 0 20px 15px;">
|
||||
<a href="#"
|
||||
class="btn btn-primary"
|
||||
data-action="new-step"
|
||||
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>"
|
||||
style="<%= @protocol.steps.empty? ? 'display: none;' : '' %>">
|
||||
<span class="fas fa-plus" aria-hidden="true"></span>
|
||||
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<% 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"
|
||||
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>"
|
||||
style="<%= @protocol.steps.empty? ? 'display: none;' : '' %>">
|
||||
<span class="fas fa-plus" aria-hidden="true"></span>
|
||||
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div id="steps">
|
||||
<% @protocol.steps.order(:position).each do |step| %>
|
||||
|
|
Loading…
Reference in a new issue