Skip to content

Commit 06fe536

Browse files
author
Kirk Wang
authored
Merge pull request #2420 from samvera/fix-catalog-gallery-view
🧹 Fix catalog gallery view
2 parents 92d95f8 + 49651c5 commit 06fe536

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

app/assets/stylesheets/hyku.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
.home-tabs-left {
3838
margin: 0 10px;
3939
}
40+
41+
.row-cols-md-3>* {
42+
flex: 0 0 33.33%;
43+
max-width: 33.33%;
44+
}
4045
}
4146

4247
#banner.jumbotron {
@@ -769,9 +774,6 @@ dd {
769774
}
770775

771776
.document {
772-
margin-top: 6px;
773-
padding-top: 6px;
774-
775777
.document-thumbnail {
776778
.img-thumbnail {
777779
padding: 0.25rem;
@@ -803,4 +805,3 @@ dd {
803805
}
804806
}
805807
/* End Collection show page */
806-

app/controllers/catalog_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def self.uploaded_field
146146
# solr fields to be displayed in the index (search results) view
147147
# The ordering of the field names is the order of the display
148148
config.add_index_field 'title_tesim', label: "Title", itemprop: 'name', if: false
149-
config.add_index_field 'description_tesim', itemprop: 'description', helper_method: :iconify_auto_link
149+
config.add_index_field 'description_tesim', itemprop: 'description', helper_method: :truncate_and_iconify_auto_link
150150
config.add_index_field 'keyword_tesim', itemprop: 'keywords', link_to_facet: 'keyword_sim'
151151
config.add_index_field 'subject_tesim', itemprop: 'about', link_to_facet: 'subject_sim'
152152
config.add_index_field 'creator_tesim', itemprop: 'creator', link_to_facet: 'creator_sim'

app/helpers/application_helper.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,19 @@ def markdown(text)
7878
Markdown.new(text, *options).to_html.html_safe
7979
end
8080
# rubocop:enable Rails/OutputSafety
81+
82+
def truncate_and_iconify_auto_link(field, show_link = true)
83+
if field.is_a? Hash
84+
options = field[:config].separator_options || {}
85+
text = field[:value].to_sentence(options)
86+
else
87+
text = field
88+
end
89+
# this block is only executed when a link is inserted;
90+
# if we pass text containing no links, it just returns text.
91+
auto_link(html_escape(text)) do |value|
92+
"<span class='fa fa-external-link'></span>#{('&nbsp;' + value) if show_link}"
93+
end
94+
text.truncate(230, separator: ' ')
95+
end
8196
end

app/views/shared/_appearance_styles.html.erb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ body.public-facing a:focus { color: <%= appearance.link_hover_color %>; }
2323

2424
/* MAIN NAV */
2525
body.public-facing .navbar.navbar-expand-lg,
26-
body.public-facing footer.navbar {
26+
body.public-facing footer.navbar {
2727
background-color: <%= appearance.header_and_footer_background_color %> !important;
2828
}
2929
body.public-facing footer.navbar .navbar-link { color: <%= appearance.footer_link_color %>; }
3030
body.public-facing footer.navbar .navbar-link:hover { color: <%= appearance.footer_link_hover_color %>; }
3131
body.public-facing footer.navbar .navbar-text,
32-
body.public-facing .navbar.navbar-expand-lg .navbar-nav a {
32+
body.public-facing .navbar.navbar-expand-lg .navbar-nav a {
3333
color: <%= appearance.header_and_footer_text_color %> !important;
3434
}
3535
body.public-facing .navbar.navbar-expand-lg { border-color: <%= appearance.header_background_border_color %> !important; }
@@ -201,12 +201,10 @@ body.public-facing .card > .card-header,
201201
body.public-facing .card-header > .btn.w-100 {
202202
color: <%= appearance.facet_panel_text_color %>;
203203
background-color: <%= appearance.facet_panel_background_color %> !important;
204-
border-color: <%= appearance.facet_panel_border_color %> !important;
205204
}
206205
body.public-facing .card-body > .facet-limit-active {
207206
color: <%= appearance.facet_panel_text_color %> !important;
208207
background-color: <%= appearance.facet_panel_background_color %>;
209-
border-color: <%= appearance.facet_panel_border_color %> !important;
210208
}
211209

212210
/* COLLECTION STYLES */

0 commit comments

Comments
 (0)