Skip to content

Commit

Permalink
Merge pull request #1014 from DaanVanVugt/feature/subscription_button…
Browse files Browse the repository at this point in the history
…_bigger

moved subscription button up and increased size for better visibility
  • Loading branch information
fbacall authored Aug 29, 2024
2 parents 48402f3 + 44380c9 commit 5d70aae
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
7 changes: 5 additions & 2 deletions app/views/elearning_materials/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<h2><%=t("features.elearning_materials.long")%></h2>

<% content_for :buttons do %>
<!-- Subscribe button -->
<% if TeSS::Config.feature['subscription'] %>
<%= render partial: 'subscriptions/subscribe_button', locals: { type: ElearningMaterial.name } %>
<% end %>
<!-- Register button -->
<%= link_to new_material_path, class: 'btn btn-primary' do %>
Register training material
Expand All @@ -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 } %>

Expand Down
7 changes: 5 additions & 2 deletions app/views/events/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<div id="content">
<h2><%=t("features.events.long")%></h2>
<% content_for :buttons do %>
<!-- Subscribe button -->
<% if TeSS::Config.feature['subscription'] %>
<%= render partial: 'subscriptions/subscribe_button', locals: { type: Event.name } %>
<% end %>
<!-- Register button -->
<%= link_to new_event_path, class: 'btn btn-primary' do %>
<%= t('register.buttons.events') %>
Expand All @@ -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? %>
Expand Down
7 changes: 5 additions & 2 deletions app/views/learning_paths/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<h2><%=t("features.learning_paths.long")%></h2>

<% content_for :buttons do %>
<!-- Subscribe button -->
<% if TeSS::Config.feature['subscription'] %>
<%= render partial: 'subscriptions/subscribe_button', locals: { type: LearningPath.name } %>
<% end %>
<!-- Register button -->
<% if policy(LearningPath).create? %>
<%= link_to new_learning_path_path, class: 'btn btn-primary' do %>
Expand All @@ -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 } %>

Expand Down
7 changes: 5 additions & 2 deletions app/views/materials/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<h2><%=t("features.materials.long")%></h2>

<% content_for :buttons do %>
<!-- Subscribe button -->
<% if TeSS::Config.feature['subscription'] %>
<%= render partial: 'subscriptions/subscribe_button', locals: { type: Material.name } %>
<% end %>
<!-- Register button -->
<%= link_to new_material_path, class: 'btn btn-primary' do %>
<%= t('register.buttons.materials') %>
Expand All @@ -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 } %>

Expand Down
5 changes: 0 additions & 5 deletions app/views/search/common/_search_panel.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<% show_subscription_button ||= false %>

<div class="search-panel my-3">
<div class="row">
<div class="col-sm-6">
Expand Down Expand Up @@ -29,9 +27,6 @@
<div class="search-results-count">
<%= pluralize(resources.total, resource_type.model_name.human.downcase ) %> found
</div>
<% if TeSS::Config.feature['subscription'] && show_subscription_button %>
<%= render partial: 'subscriptions/subscribe_button', locals: { type: resource_type.name } %>
<% end %>
<% end %>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/subscriptions/_subscribe_button.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
%>

<% if show_calendar_sub || show_email_sub || show_rss_sub %>
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a class="btn btn-primary">
<div type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Subscribe <span class="caret"></span>
</button>
</div>
<ul class="dropdown-menu">
<% if show_email_sub %>
<li>
Expand Down Expand Up @@ -36,7 +36,7 @@
<% end %>
<% end %>
</ul>
</div>
</a>

<% if show_email_sub %>
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="subscribe-email-modal-title" id="subscribe-email-modal">
Expand Down

0 comments on commit 5d70aae

Please sign in to comment.