mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
Merge pull request #2103 from urbanrotnik/ur-sci-3936-permission-issue
Add permission check for button show [SCI-3936]
This commit is contained in:
commit
4b626ab2dd
1 changed files with 32 additions and 32 deletions
|
@ -1,43 +1,43 @@
|
|||
<% 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="#"
|
||||
class="btn btn-primary"
|
||||
data-action="new-step"
|
||||
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>
|
||||
<% 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="#"
|
||||
class="btn btn-primary"
|
||||
data-action="new-step"
|
||||
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>
|
||||
<div class="pull-right expand-all-steps" style="margin: 0 15px 20px 0; display: <%= 'none' if @protocol.steps.empty? %>">
|
||||
<a class="btn btn-default" data-action="collapse-steps">
|
||||
<span class="fas fa-caret-square-up"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.steps.collapse_label") %></a></span>
|
||||
<a class="btn btn-default" data-action="expand-steps">
|
||||
<span class="fas fa-caret-square-down"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.steps.expand_label") %></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right expand-all-steps" style="margin: 0 15px 20px 0; display: <%= 'none' if @protocol.steps.empty? %>">
|
||||
<a class="btn btn-default" data-action="collapse-steps">
|
||||
<span class="fas fa-caret-square-up"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.steps.collapse_label") %></a></span>
|
||||
<a class="btn btn-default" data-action="expand-steps">
|
||||
<span class="fas fa-caret-square-down"></span>
|
||||
<span class="hidden-xs"><%= t("protocols.steps.expand_label") %></a></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="steps">
|
||||
<% @protocol.steps.order(:position).each do |step| %>
|
||||
<%= render partial: "steps/step.html.erb", locals: { step: step } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<% 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="#"
|
||||
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>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_include_tag "handsontable.full.min" %>
|
||||
|
||||
|
|
Loading…
Reference in a new issue