Skip to content

Commit

Permalink
Merge pull request #3149 from projectblacklight/gallery-icons
Browse files Browse the repository at this point in the history
Use icon components for gallery views.
  • Loading branch information
corylown authored Sep 23, 2024
2 parents d48e392 + b6a00f9 commit 1c634a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 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
6 changes: 3 additions & 3 deletions spec/test_app_templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class CatalogController < ApplicationController
before_action :set_paper_trail_whodunnit

configure_blacklight do |config|
config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent)
config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent, icon: Blacklight::Gallery::Icons::GalleryComponent)
# config.view.gallery.classes = 'row-cols-2 row-cols-md-3'
config.view.masonry(document_component: Blacklight::Gallery::DocumentComponent)
config.view.slideshow(document_component: Blacklight::Gallery::SlideshowComponent)
config.view.masonry(document_component: Blacklight::Gallery::DocumentComponent, icon: Blacklight::Gallery::Icons::MasonryComponent)
config.view.slideshow(document_component: Blacklight::Gallery::SlideshowComponent, icon: Blacklight::Gallery::Icons::SlideshowComponent)
config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
config.show.partials.insert(1, :openseadragon)
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
Expand Down

0 comments on commit 1c634a4

Please sign in to comment.