Skip to content

Commit

Permalink
a11y metadata empty h2
Browse files Browse the repository at this point in the history
  • Loading branch information
mberkowski committed Jan 9, 2025
1 parent f500d0d commit a1c4d8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/presenters/umbra/document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def render_field_value value=nil, field=nil
safe_join(safe_values, (field_config.separator if field_config))
end

def has_creator?
!!document['sourceResource_creator_ssi']
end

def creator
render_field_value document['sourceResource_creator_ssi'], 'sourceResource_creator_ssi'
end
Expand Down
5 changes: 3 additions & 2 deletions app/views/catalog/_list_results_metadata.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
=(document_counter + 1).to_s + "."
%span.title
= link_to document_presenter.display_title, document, document_link_params(document, :counter => document_counter_with_offset(document_counter))
%h2.h4.creator.metadata-field= document_presenter.creator
- if document_presenter.has_creator?
%h2.h4.creator.metadata-field= document_presenter.creator
- if document_presenter.has_keywords?
%h4.metadata-field
Keywords:
Expand All @@ -22,4 +23,4 @@
%div
%strong
Matched Terms:
= sanitize raw document_presenter.matches
= sanitize raw document_presenter.matches

0 comments on commit a1c4d8b

Please sign in to comment.