diff --git a/app/helpers/template_helper.rb b/app/helpers/template_helper.rb index cc20a1b..bfe0888 100644 --- a/app/helpers/template_helper.rb +++ b/app/helpers/template_helper.rb @@ -6,14 +6,14 @@ a.join(separator) end - def direct_link(template) + def direct_link(template, hidden = false) params = { org_id: template.org.id, funder_id: '-1', template_id: template.id, } - link_to(plans_url(plan: params), method: :post, title: _('Create plan'), class: 'direct-link') do + link_to(plans_url(plan: params), method: :post, title: _('Create plan'), class: 'direct-link', style: hidden ? 'display: none' : '') do ''.html_safe end end diff --git a/app/views/paginable/templates/_organisational.html.erb b/app/views/paginable/templates/_organisational.html.erb index 98c7904..997a620 100644 --- a/app/views/paginable/templates/_organisational.html.erb +++ b/app/views/paginable/templates/_organisational.html.erb @@ -64,11 +64,15 @@
  • <%= link_to _('Copy'), copy_org_admin_template_path(template.id), 'data-method': 'post' %>
  • <% if template.removable? %>
  • - <%= link_to _('Remove'), org_admin_template_path(id: template.id), + <%= link_to _('Remove'), org_admin_template_path(id: template.id), 'data-method': 'delete', rel: 'nofollow', 'data-confirm': _('Are you sure you want to remove "%{template_title}"? Any published versions will become unavailable to users.') % { template_title: template.title} %>
  • <% end %> +
  • + <%= direct_link(template, true) %> + <%= _('Copy link') %> +
  • @@ -77,4 +81,6 @@ <% end %> - \ No newline at end of file + + +<%= render 'shared/copy_link_modal' %> diff --git a/app/views/paginable/templates/_publicly_visible.html.erb b/app/views/paginable/templates/_publicly_visible.html.erb index 0a8ced5..f75a497 100644 --- a/app/views/paginable/templates/_publicly_visible.html.erb +++ b/app/views/paginable/templates/_publicly_visible.html.erb @@ -25,7 +25,7 @@ <%= direct_link(template) %> - + <% end %>