Skip to content

Commit

Permalink
[ESSI-2025] add, use #link_to_campus_facet
Browse files Browse the repository at this point in the history
  • Loading branch information
aploshay committed Oct 25, 2024
1 parent 7fe444e commit ec5a965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/helpers/facet_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ def campus_label(value)
CampusService.find(value)[:term] || ''
end

# imported from hyrax to prep campus-specific version
# campus-specific version of link_to_facet
# @param item [Object]
# @param field [String]
# @return [ActiveSupport::SafeBuffer] the html_safe link
def link_to_facet(item, field)
def link_to_campus_facet(item, field)
path = main_app.search_catalog_path(search_state.add_facet_params_and_redirect(field, item))
item = campus_label(item)
link_to(item, path)
end
end
2 changes: 1 addition & 1 deletion app/views/records/show_fields/_campus.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span itemprop="campus"><%= link_to_facet(record.campus, Solrizer.solr_name("campus", :facetable)) %></span><br />
<span itemprop="campus"><%= link_to_campus_facet(record.campus, Solrizer.solr_name("campus", :facetable)) %></span><br />

0 comments on commit ec5a965

Please sign in to comment.