Skip to content

Commit

Permalink
Use the ViewTypeButtonComponent to render view type buttons on featur…
Browse files Browse the repository at this point in the history
…e pages.
  • Loading branch information
cbeer committed Sep 23, 2024
1 parent b9e68ca commit b6a00f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/views/spotlight/pages/_view_type_group.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
<div class="view-type">
<span class="sr-only visually-hidden"><%= t('blacklight.search.view_title') %></span>
<div class="view-type-group btn-group">
<% views.each do |view, config| %>
<%= link_to url_for(search_state.to_h.merge(view: view)), :title => t("blacklight.search.view_title.#{view}", default: t("blacklight.search.view.#{view}", default: blacklight_config.view[view].title)), :class => "btn btn-outline-secondary view-type-#{ view.to_s.parameterize } #{"active" if block_document_index_view_type(block) == view}" do %>
<%= blacklight_icon config.icon || view %>
<span class="caption"><%= t("blacklight.search.view.#{view}") %></span>
<% end %>
<% views.each do |key, config| %>
<%= render Blacklight::Response::ViewTypeButtonComponent.new(key: key, view: config, selected: block_document_index_view_type(block) == key, search_state: search_state) %>
<% end %>
</div>
</div>
Expand Down

0 comments on commit b6a00f9

Please sign in to comment.