diff --git a/app/helpers/template_helper.rb b/app/helpers/template_helper.rb index 42ab240..c27f04a 100644 --- a/app/helpers/template_helper.rb +++ b/app/helpers/template_helper.rb @@ -5,4 +5,16 @@ end a.join(separator) end -end \ No newline at end of file + + def direct_link(template) + params = { + org_id: template.org.id, + funder_id: '-1', + template_id: template.id, + } + + link_to(plans_url(plan: params), method: :post, title: _('Create plan')) do + ''.html_safe + end + end +end diff --git a/app/views/paginable/templates/_publicly_visible.html.erb b/app/views/paginable/templates/_publicly_visible.html.erb index 4bc820f..547d41d 100644 --- a/app/views/paginable/templates/_publicly_visible.html.erb +++ b/app/views/paginable/templates/_publicly_visible.html.erb @@ -24,14 +24,8 @@ <%= link_to _('PDF'), template_export_path(template.family_id, format: :pdf), target: '_blank' %> - <%= link_to(plans_url(plan: { - org_id: template.org.id, - funder_id: '-1', - template_id: template.id, - }), method: :post, title: _('Create plan')) do %> - - <% end %> - + <%= direct_link(template) %> + <% end %>