diff --git a/app/controllers/paginable/templates_controller.rb b/app/controllers/paginable/templates_controller.rb index 19d9409..47d5f80 100644 --- a/app/controllers/paginable/templates_controller.rb +++ b/app/controllers/paginable/templates_controller.rb @@ -55,7 +55,7 @@ # GET /paginable/templates/publicly_visible/:page (AJAX) # ----------------------------------------------------- def publicly_visible - templates = Template.live(Template.families(Org.funder.pluck(:id)).pluck(:family_id)).publicly_visible.pluck(:id) << + templates = Template.live(Template.families(Org.all.pluck(:id)).pluck(:family_id)).pluck(:id) << Template.where(is_default: true).unarchived.published.pluck(:id) paginable_renderise( partial: 'publicly_visible', diff --git a/app/controllers/public_pages_controller.rb b/app/controllers/public_pages_controller.rb index 7f3589c..90075ba 100644 --- a/app/controllers/public_pages_controller.rb +++ b/app/controllers/public_pages_controller.rb @@ -4,9 +4,17 @@ # GET template_index # ----------------------------------------------------- def template_index - templates = Template.live(Template.families(Org.all.pluck(:id)).pluck(:family_id)).publicly_visible.pluck(:id) << + templates = Template.live(Template.families(Org.all.pluck(:id)).pluck(:family_id)).pluck(:id) << Template.where(is_default: true).unarchived.published.pluck(:id) @templates = Template.includes(:org).where(id: templates.uniq.flatten).unarchived.published.order(title: :asc).page(1) + + + #funder_templates = Template.live(Template.families(Org.funder.pluck(:id)).pluck(:family_id)).publicly_visible.pluck(:id) + #@funder_templates = Template.includes(:org).where(id: funder_templates.uniq.flatten).unarchived.published.order(title: :asc).page(1) + + # org_templates = Template.live(Template.families(Org.institution.pluck(:id)).pluck(:family_id)).pluck(:id) << + #Template.where(is_default: true).unarchived.published.pluck(:id) + #@org_templates = Template.includes(:org).where(id: org_templates.uniq.flatten).unarchived.published.order(title: :asc).page(1) end # GET template_export/:id diff --git a/app/views/paginable/templates/_publicly_visible.html.erb b/app/views/paginable/templates/_publicly_visible.html.erb index 6c43a0b..b8c03c7 100644 --- a/app/views/paginable/templates/_publicly_visible.html.erb +++ b/app/views/paginable/templates/_publicly_visible.html.erb @@ -5,9 +5,8 @@ <%= _('Template Name') %> <%= paginable_sort_link('templates.title') %> <%= _('Download') %> <%= _('Organisation Name') %> <%= paginable_sort_link('orgs.name') %> + <%= _('Organisation Type') %> <%= paginable_sort_link('orgs.org_type') %> <%= _('Last Updated') %> <%= paginable_sort_link('templates.updated_at') %> - <%= _('Funder Links') %> - <%= _('Sample Plans') %>
<%= _('(if available)') %> @@ -19,13 +18,8 @@ <%= link_to _('PDF'), template_export_path(template.family_id, format: :pdf), target: '_blank' %> <%= template.org.name %> + <%= template.org.org_type_to_s %> <%= l(template.updated_at.to_date, formats: :short) %> - - <%= raw links_to_a_elements(template.links['funder'], '
') %> - - - <%= raw links_to_a_elements(template.links['sample_plan'], '
') %> - <% end %>