Expose the new step button on task

This commit is contained in:
Mojca Lorber 2020-11-05 16:14:40 +01:00
parent 0c8134373d
commit 8ee8f7b4d2
4 changed files with 6 additions and 11 deletions

View file

@ -203,10 +203,9 @@
function toggleButtons(show) { function toggleButtons(show) {
if (show) { if (show) {
$("[data-action='new-step']:first").show(); $("[data-action='new-step']").show();
$("[data-action='edit-step']").show(); $("[data-action='edit-step']").show();
if ($('#steps .step').length > 0) { if ($('#steps .step').length > 0) {
$("[data-action='new-step']:last").show();
$(".expand-all-steps").show(); $(".expand-all-steps").show();
} }
} else { } else {

View file

@ -116,10 +116,6 @@
padding-right: 5px; padding-right: 5px;
} }
} }
.dropdown {
margin-right: 5px;
}
} }
} }
} }

View file

@ -93,8 +93,7 @@
</div> </div>
</a> </a>
<%= render partial: "my_modules/protocols/protocol_status_bar" %> <%= render partial: "my_modules/protocols/protocol_status_bar" %>
<div class="actions-block"> <div class="sci-btn-group actions-block">
<%= render partial: "my_modules/protocols/protocol_options_dropdown" %>
<% if can_manage_protocol_in_module?(@protocol) %> <% if can_manage_protocol_in_module?(@protocol) %>
<a href="#" <a href="#"
class="btn btn-primary" class="btn btn-primary"
@ -104,6 +103,7 @@
<span><%=t "protocols.steps.new_step" %></span> <span><%=t "protocols.steps.new_step" %></span>
</a> </a>
<% end %> <% end %>
<%= render partial: "my_modules/protocols/protocol_options_dropdown" %>
</div> </div>
</div> </div>
<div class="collapse in" id="protocol-container" aria-expanded="true"> <div class="collapse in" id="protocol-container" aria-expanded="true">

View file

@ -15,7 +15,8 @@
<a href="#" <a href="#"
class="btn btn-primary" class="btn btn-primary"
data-action="new-step" data-action="new-step"
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>"> 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="fas fa-plus" aria-hidden="true"></span>
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span> <span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
</a> </a>
@ -34,8 +35,7 @@
<a href="#" <a href="#"
class="btn btn-primary" class="btn btn-primary"
data-action="new-step" data-action="new-step"
data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>" 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="fas fa-plus" aria-hidden="true"></span>
<span class="hidden-xs"><%=t "protocols.steps.new_step" %></span> <span class="hidden-xs"><%=t "protocols.steps.new_step" %></span>
</a> </a>