From aaabf862a46550c8998ba66b7fbab52a417b54d1 Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Tue, 31 Jan 2023 15:42:43 +0100 Subject: [PATCH] Hide module-tag-manage-modal controls when the user is not autorized [SCI-7814] --- .../canvas/full_zoom/_my_module.html.erb | 12 +--- .../canvas/medium_zoom/_my_module.html.erb | 12 +--- app/views/my_module_tags/_index_edit.html.erb | 66 ++++++++++--------- 3 files changed, 41 insertions(+), 49 deletions(-) diff --git a/app/views/canvas/full_zoom/_my_module.html.erb b/app/views/canvas/full_zoom/_my_module.html.erb index fa42b51d0..ac688f08b 100644 --- a/app/views/canvas/full_zoom/_my_module.html.erb +++ b/app/views/canvas/full_zoom/_my_module.html.erb @@ -13,15 +13,9 @@ data-module-tags-url="<%= my_module_tags_experiment_path(my_module.experiment, format: :json) %>">
- <% if can_manage_my_module?(my_module) %> - - <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> - - <% else %> - - <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> - - <% end %> + + <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> +
diff --git a/app/views/canvas/medium_zoom/_my_module.html.erb b/app/views/canvas/medium_zoom/_my_module.html.erb index 4a279f187..1c12a2da2 100644 --- a/app/views/canvas/medium_zoom/_my_module.html.erb +++ b/app/views/canvas/medium_zoom/_my_module.html.erb @@ -10,15 +10,9 @@ data-module-y="<%= my_module.y %>" data-module-conns="<%= construct_module_connections(my_module) %>"> - <% if can_manage_my_module?(my_module) %> - - <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> - - <% else %> - - <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> - - <% end %> + + <%= render partial: "canvas/tags.html.erb", locals: { my_module: my_module } %> +

diff --git a/app/views/my_module_tags/_index_edit.html.erb b/app/views/my_module_tags/_index_edit.html.erb index a2483ffd8..ef93e2103 100644 --- a/app/views/my_module_tags/_index_edit.html.erb +++ b/app/views/my_module_tags/_index_edit.html.erb @@ -11,7 +11,8 @@

<%= tag.name %>

-
+
+ <% if can_manage_my_module?(@my_module) %> <%= link_to "", remote: true, class: 'btn btn-link edit-tag-link', title: t("experiments.canvas.modal_manage_tags.edit_tag") do %> <% end %> @@ -24,7 +25,8 @@ <% end %> <% end %> -
+ <% end %> +