Skip to content

Commit

Permalink
Merge pull request #2420 from samvera/fix-catalog-gallery-view
Browse files Browse the repository at this point in the history
🧹 Fix catalog gallery view
  • Loading branch information
kirkkwang authored Jan 17, 2025
2 parents 92d95f8 + 49651c5 commit 06fe536
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
9 changes: 5 additions & 4 deletions app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
.home-tabs-left {
margin: 0 10px;
}

.row-cols-md-3>* {
flex: 0 0 33.33%;
max-width: 33.33%;
}
}

#banner.jumbotron {
Expand Down Expand Up @@ -769,9 +774,6 @@ dd {
}

.document {
margin-top: 6px;
padding-top: 6px;

.document-thumbnail {
.img-thumbnail {
padding: 0.25rem;
Expand Down Expand Up @@ -803,4 +805,3 @@ dd {
}
}
/* End Collection show page */

2 changes: 1 addition & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def self.uploaded_field
# solr fields to be displayed in the index (search results) view
# The ordering of the field names is the order of the display
config.add_index_field 'title_tesim', label: "Title", itemprop: 'name', if: false
config.add_index_field 'description_tesim', itemprop: 'description', helper_method: :iconify_auto_link
config.add_index_field 'description_tesim', itemprop: 'description', helper_method: :truncate_and_iconify_auto_link
config.add_index_field 'keyword_tesim', itemprop: 'keywords', link_to_facet: 'keyword_sim'
config.add_index_field 'subject_tesim', itemprop: 'about', link_to_facet: 'subject_sim'
config.add_index_field 'creator_tesim', itemprop: 'creator', link_to_facet: 'creator_sim'
Expand Down
15 changes: 15 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,19 @@ def markdown(text)
Markdown.new(text, *options).to_html.html_safe
end
# rubocop:enable Rails/OutputSafety

def truncate_and_iconify_auto_link(field, show_link = true)
if field.is_a? Hash
options = field[:config].separator_options || {}
text = field[:value].to_sentence(options)
else
text = field
end
# this block is only executed when a link is inserted;
# if we pass text containing no links, it just returns text.
auto_link(html_escape(text)) do |value|
"<span class='fa fa-external-link'></span>#{('&nbsp;' + value) if show_link}"
end
text.truncate(230, separator: ' ')
end
end
6 changes: 2 additions & 4 deletions app/views/shared/_appearance_styles.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ body.public-facing a:focus { color: <%= appearance.link_hover_color %>; }

/* MAIN NAV */
body.public-facing .navbar.navbar-expand-lg,
body.public-facing footer.navbar {
body.public-facing footer.navbar {
background-color: <%= appearance.header_and_footer_background_color %> !important;
}
body.public-facing footer.navbar .navbar-link { color: <%= appearance.footer_link_color %>; }
body.public-facing footer.navbar .navbar-link:hover { color: <%= appearance.footer_link_hover_color %>; }
body.public-facing footer.navbar .navbar-text,
body.public-facing .navbar.navbar-expand-lg .navbar-nav a {
body.public-facing .navbar.navbar-expand-lg .navbar-nav a {
color: <%= appearance.header_and_footer_text_color %> !important;
}
body.public-facing .navbar.navbar-expand-lg { border-color: <%= appearance.header_background_border_color %> !important; }
Expand Down Expand Up @@ -201,12 +201,10 @@ body.public-facing .card > .card-header,
body.public-facing .card-header > .btn.w-100 {
color: <%= appearance.facet_panel_text_color %>;
background-color: <%= appearance.facet_panel_background_color %> !important;
border-color: <%= appearance.facet_panel_border_color %> !important;
}
body.public-facing .card-body > .facet-limit-active {
color: <%= appearance.facet_panel_text_color %> !important;
background-color: <%= appearance.facet_panel_background_color %>;
border-color: <%= appearance.facet_panel_border_color %> !important;
}

/* COLLECTION STYLES */
Expand Down

0 comments on commit 06fe536

Please sign in to comment.