From 44380c9c3f1d4e7e55a71ec8333f89a94f47196e Mon Sep 17 00:00:00 2001 From: Mike Sanders Date: Tue, 27 Aug 2024 10:33:50 +0200 Subject: [PATCH] moved subscription button up and increased size for better visibility --- app/views/elearning_materials/index.html.erb | 7 +++++-- app/views/events/index.html.erb | 7 +++++-- app/views/learning_paths/index.html.erb | 7 +++++-- app/views/materials/index.html.erb | 7 +++++-- app/views/search/common/_search_panel.html.erb | 5 ----- app/views/subscriptions/_subscribe_button.html.erb | 8 ++++---- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/app/views/elearning_materials/index.html.erb b/app/views/elearning_materials/index.html.erb index 811452379..c14d6c5eb 100644 --- a/app/views/elearning_materials/index.html.erb +++ b/app/views/elearning_materials/index.html.erb @@ -10,6 +10,10 @@

<%=t("features.elearning_materials.long")%>

<% content_for :buttons do %> + + <% if TeSS::Config.feature['subscription'] %> + <%= render partial: 'subscriptions/subscribe_button', locals: { type: ElearningMaterial.name } %> + <% end %> <%= link_to new_material_path, class: 'btn btn-primary' do %> Register training material @@ -21,8 +25,7 @@ <% end %> <%= render partial: "search/common/search_panel", locals: { resources: @materials_results, - resource_type: ElearningMaterial, - show_subscription_button: true } %> + resource_type: ElearningMaterial } %> <%= render partial: 'common/masonry_grid', locals: { objects: @materials } %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 2fdff85d6..97a6e2f32 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -9,6 +9,10 @@

<%=t("features.events.long")%>

<% content_for :buttons do %> + + <% if TeSS::Config.feature['subscription'] %> + <%= render partial: 'subscriptions/subscribe_button', locals: { type: Event.name } %> + <% end %> <%= link_to new_event_path, class: 'btn btn-primary' do %> <%= t('register.buttons.events') %> @@ -32,8 +36,7 @@ <% end %> <%= render partial: "search/common/search_panel", locals: { resources: @events_results, - resource_type: Event, - show_subscription_button: true } %> + resource_type: Event } %> <%# ACTUAL RESULTS LIST %> <% unless @events.blank? %> diff --git a/app/views/learning_paths/index.html.erb b/app/views/learning_paths/index.html.erb index 461189974..ffda9d613 100644 --- a/app/views/learning_paths/index.html.erb +++ b/app/views/learning_paths/index.html.erb @@ -10,6 +10,10 @@

<%=t("features.learning_paths.long")%>

<% content_for :buttons do %> + + <% if TeSS::Config.feature['subscription'] %> + <%= render partial: 'subscriptions/subscribe_button', locals: { type: LearningPath.name } %> + <% end %> <% if policy(LearningPath).create? %> <%= link_to new_learning_path_path, class: 'btn btn-primary' do %> @@ -28,8 +32,7 @@ <% end %> <%= render partial: "search/common/search_panel", locals: { resources: @learning_paths_results, - resource_type: LearningPath, - show_subscription_button: true } %> + resource_type: LearningPath } %> <%= render partial: 'common/masonry_grid', locals: { objects: @learning_paths } %> diff --git a/app/views/materials/index.html.erb b/app/views/materials/index.html.erb index e0c11bf37..70ba2f33d 100644 --- a/app/views/materials/index.html.erb +++ b/app/views/materials/index.html.erb @@ -10,6 +10,10 @@

<%=t("features.materials.long")%>

<% content_for :buttons do %> + + <% if TeSS::Config.feature['subscription'] %> + <%= render partial: 'subscriptions/subscribe_button', locals: { type: Material.name } %> + <% end %> <%= link_to new_material_path, class: 'btn btn-primary' do %> <%= t('register.buttons.materials') %> @@ -21,8 +25,7 @@ <% end %> <%= render partial: "search/common/search_panel", locals: { resources: @materials_results, - resource_type: Material, - show_subscription_button: true } %> + resource_type: Material } %> <%= render partial: 'common/masonry_grid', locals: { objects: @materials } %> diff --git a/app/views/search/common/_search_panel.html.erb b/app/views/search/common/_search_panel.html.erb index b36b3ca3a..c4ecd8782 100644 --- a/app/views/search/common/_search_panel.html.erb +++ b/app/views/search/common/_search_panel.html.erb @@ -1,5 +1,3 @@ -<% show_subscription_button ||= false %> -
@@ -29,9 +27,6 @@
<%= pluralize(resources.total, resource_type.model_name.human.downcase ) %> found
- <% if TeSS::Config.feature['subscription'] && show_subscription_button %> - <%= render partial: 'subscriptions/subscribe_button', locals: { type: resource_type.name } %> - <% end %> <% end %>
diff --git a/app/views/subscriptions/_subscribe_button.html.erb b/app/views/subscriptions/_subscribe_button.html.erb index a3ef4c34f..86292bec2 100644 --- a/app/views/subscriptions/_subscribe_button.html.erb +++ b/app/views/subscriptions/_subscribe_button.html.erb @@ -5,10 +5,10 @@ %> <% if show_calendar_sub || show_email_sub || show_rss_sub %> - -
+ <% if show_email_sub %>