-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 Match catalog search results match to Hyrax
This commit will along the look of the catalog search results page to look closer to the way Hyrax looks. The problem stems from the markdown feature. For plain text it adds a `<p>` tag which has a margin bottom. I think the best thing to do is turn it off for default and any tenant that is currently using it should turn it back on.
- Loading branch information
Showing
3 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
<%# OVERRIDE Hyrax 5.0.1 to enable markdown for index field values in search results %> | ||
<%# OVERRIDE Hyrax 5.0.1 to handle search only accounts %> | ||
|
||
<div class="col-md-6"> | ||
<div class="ol-md-9 col-lg-6"> | ||
<div class="metadata"> | ||
<dl class="dl-horizontal"> | ||
<dl> | ||
<% doc_presenter = index_presenter(document) %> | ||
<% index_fields(document).each do |field_name, field| -%> | ||
<% if should_render_index_field? document, field %> | ||
<dt data-solr-field-name="<%= field_name %>"><%= render_index_field_label document, field: field_name %></dt> | ||
<dd><%= markdown(doc_presenter.field_value field) %></dd> | ||
<% end %> | ||
<% if should_render_index_field? document, field %> | ||
<div class="row"> | ||
<dt class="col-5 text-right" data-solr-field-name="<%= field_name %>"><%= render_index_field_label document, field: field_name %></dt> | ||
<dd class="col-7"><%= markdown(doc_presenter.field_value field) %></dd> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% if current_account.search_only %> | ||
<% if document.account_institution_name.first.present? %> | ||
<small class="search-only-institution-link"> | ||
<% if document.account_institution_name.first.present? %> | ||
<small class="search-only-institution-link"> | ||
<span>From: <%= link_to "//#{document.account_cname.first}", target: :_blank do %> | ||
<%= document.account_institution_name&.join %> | ||
<% end %></span> | ||
</small> | ||
<% end %> | ||
</small> | ||
<% end %> | ||
<% end %> | ||
</dl> | ||
</div> | ||
</div> | ||
<% if document.collection? %> | ||
<% collection_presenter = Hyrax::CollectionPresenter.new(document, current_ability) %> | ||
<div class="col-md-4"> | ||
<div class="col-md-12 col-lg-3"> | ||
<div class="collection-counts-wrapper"> | ||
<div class="collection-counts-item"> | ||
<span><%= collection_presenter.total_viewable_collections %></span>Collections | ||
<span><%= collection_presenter.total_viewable_collections %></span>Collections | ||
</div> | ||
<div class="collection-counts-item"> | ||
<span><%= collection_presenter.total_viewable_works %></span>Works | ||
<span><%= collection_presenter.total_viewable_works %></span>Works | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters