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 @@