diff --git a/app/helpers/template_helper.rb b/app/helpers/template_helper.rb index 85be0d4..42ab240 100644 --- a/app/helpers/template_helper.rb +++ b/app/helpers/template_helper.rb @@ -1,8 +1,8 @@ module TemplateHelper - def links_to_a_elements(links) + def links_to_a_elements(links, separator = ', ') a = links.map do |l| "#{l['text']}" end - a.join(", ") + a.join(separator) end end \ No newline at end of file diff --git a/app/views/public_pages/template_index.html.erb b/app/views/public_pages/template_index.html.erb index 60f29f2..7f4e43b 100644 --- a/app/views/public_pages/template_index.html.erb +++ b/app/views/public_pages/template_index.html.erb @@ -18,7 +18,7 @@ <% if @templates.count > TABLE_FILTER_MIN_ROWS %> - + <%= render(partial: "shared/table_filter", locals: {path: public_templates_path, placeholder: _('Filter templates')}) %> @@ -26,19 +26,28 @@ <% end %> <%= _('Template Name') %> - <%= _('Organisation Name') %> <%= _('Download') %> + <%= _('Organisation Name') %> + <%= _('Funder Links') %> + <%= _('Sample Plans') %> <% @templates.each do |template| %> <%= template.title %> - <%= template.org.name %> <%= link_to _('DOCX'), template_export_path(template.dmptemplate_id, format: :docx), target: '_blank' %> +
<%= link_to _('PDF'), template_export_path(template.dmptemplate_id, format: :pdf), target: '_blank' %> + <%= template.org.name %> + + <%= raw links_to_a_elements(template.links['funder'], '
') %> + + + <%= raw links_to_a_elements(template.links['sample_plan'], '
') %> + <% end %>