From 8ee8f7b4d26d9bd092bfe1c04878bccd9b790563 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 5 Nov 2020 16:14:40 +0100 Subject: [PATCH] Expose the new step button on task --- app/assets/javascripts/protocols/steps.js.erb | 3 +-- app/assets/stylesheets/my_modules/protocols/index.scss | 4 ---- app/views/my_modules/protocols.html.erb | 4 ++-- app/views/protocols/_steps.html.erb | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/protocols/steps.js.erb b/app/assets/javascripts/protocols/steps.js.erb index 49547c3a5..efd919ccd 100644 --- a/app/assets/javascripts/protocols/steps.js.erb +++ b/app/assets/javascripts/protocols/steps.js.erb @@ -203,10 +203,9 @@ function toggleButtons(show) { if (show) { - $("[data-action='new-step']:first").show(); + $("[data-action='new-step']").show(); $("[data-action='edit-step']").show(); if ($('#steps .step').length > 0) { - $("[data-action='new-step']:last").show(); $(".expand-all-steps").show(); } } else { diff --git a/app/assets/stylesheets/my_modules/protocols/index.scss b/app/assets/stylesheets/my_modules/protocols/index.scss index ab64d27c8..c0b873e47 100644 --- a/app/assets/stylesheets/my_modules/protocols/index.scss +++ b/app/assets/stylesheets/my_modules/protocols/index.scss @@ -116,10 +116,6 @@ padding-right: 5px; } } - - .dropdown { - margin-right: 5px; - } } } } diff --git a/app/views/my_modules/protocols.html.erb b/app/views/my_modules/protocols.html.erb index 10cdaaa6a..2080aca1c 100644 --- a/app/views/my_modules/protocols.html.erb +++ b/app/views/my_modules/protocols.html.erb @@ -93,8 +93,7 @@ <%= render partial: "my_modules/protocols/protocol_status_bar" %> -
- <%= render partial: "my_modules/protocols/protocol_options_dropdown" %> +
<% if can_manage_protocol_in_module?(@protocol) %> <%=t "protocols.steps.new_step" %> <% end %> + <%= render partial: "my_modules/protocols/protocol_options_dropdown" %>
diff --git a/app/views/protocols/_steps.html.erb b/app/views/protocols/_steps.html.erb index 87f2d3fb6..eed7b5af5 100644 --- a/app/views/protocols/_steps.html.erb +++ b/app/views/protocols/_steps.html.erb @@ -15,7 +15,8 @@ + data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>" + style="<%= @protocol.steps.empty? ? 'display: none;' : '' %>"> @@ -34,8 +35,7 @@ + data-href="<%= new_protocol_step_path(protocol_id: @protocol.id, format: :json) %>">