Skip to content

Commit

Permalink
Fix subject label (#1127)
Browse files Browse the repository at this point in the history
* feat: Add styles for firefox auth alert

* tests: fix linting errors and rspec tests

* tests: remove a tests as there is no discovery access in californica

* fix: css for the auth alert for firefox

* fix: scss linting errors

* fix: reword some text for settings

* fix: subject label not showing issue

* fix: missing subject label on work item

* fix: syntax errors

* fix: subject label error on collection page
  • Loading branch information
pghorpade authored Jul 18, 2023
1 parent 0f84b48 commit e132ae2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 29 deletions.
30 changes: 19 additions & 11 deletions app/views/catalog/collection_record/_keyword_metadata.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,35 @@
<% if keyword.length > 0 %>
<div class='metadata-block'>
<h2 class='metadata-block__title'>Keywords</h2>
<div class='metadata-block__group--collection-pg'>
<% keyword.each do |field_name, field| %>

<div class='metadata-block__group--collection-pg'>

<% if field_name == "subject_tesim" || field_name == "subject_topic_tesim" %>
<div class="blacklight-<%= field_name.parameterize %> metadata-block__label-key">
<%= (render_document_show_field_label document, field: field_name).tr(':', '') if field_name == "subject_tesim" %>
</div>
<div class="blacklight-<%= field_name.parameterize %> metadata-block__label-value">
<%= doc_presenter.field_value field %>
</div>
<% else %>
<% if field_name != "subject_tesim" && field_name != "subject_topic_tesim" %>
<div class="blacklight-<%= field_name.parameterize %> metadata-block__label-key">
<%= (render_document_show_field_label document, field: field_name).tr(':', '') %>
</div>
<div class="blacklight-<%= field_name.parameterize %> metadata-block__label-value">
<%= doc_presenter.field_value field %>
</div>
<% else %>

<% end %>
</div>

<% end %>
<% if (@document[:subject_tesim].present? && !@document[:subject_tesim].empty?) || (document[:subject_topic_tesim].present? && !@document[:subject_topic_tesim].empty?) %>
<div class="blacklight-subjects metadata-block__label-key">
Subjects
</div>
<% keyword.each do |field_name, field| %>

<% if field_name == "subject_tesim" || field_name == "subject_topic_tesim" %>
<div class="blacklight-<%= field_name.parameterize %> metadata-block__label-value">
<%= doc_presenter.field_value field %>
</div>
<% end %>
<% end %>
<% end %>
</div>
<hr class='divider divider--ursus'>
</div>
<% end %>
41 changes: 23 additions & 18 deletions app/views/catalog/work_record--ursus/_keyword_metadata.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@
<h4 class='metadata-block__title'>Keywords</h4>
<dl class='metadata-block__group'>
<% keyword.each do |field_name, field| %>
<% if field_name == "subject_tesim" || field_name == "subject_topic_tesim" %>
<dt class="blacklight-<%= field_name.parameterize %> metadata-block__label-key">
<!-- KEY -->
<%= (render_document_show_field_label document, field: field_name).tr(':', '') if field_name == "subject_tesim" %>
<!-- VALUE -->
<dd class="blacklight-<%= field_name.parameterize %> metadata-block__label-value metadata-block__label-value--ursus">
<%= doc_presenter.field_value field %>
</dd>
</dt>
<% else %>
<dt class="blacklight-<%= field_name.parameterize %> metadata-block__label-key">
<!-- KEY -->
<%= (render_document_show_field_label document, field: field_name).tr(':', '') %>
<!-- VALUE -->
<dd class="blacklight-<%= field_name.parameterize %> metadata-block__label-value metadata-block__label-value--ursus">
<%= doc_presenter.field_value field %>
</dd>
</dt>
<% if field_name != "subject_tesim" && field_name != "subject_topic_tesim" %>
<dt class="blacklight-<%= field_name.parameterize %> metadata-block__label-key">
<!-- KEY -->
<%= (render_document_show_field_label document, field: field_name).tr(':', '') %>
<!-- VALUE -->
<dd class="blacklight-<%= field_name.parameterize %> metadata-block__label-value metadata-block__label-value--ursus">
<%= doc_presenter.field_value field %>
</dd>
</dt>
<% end %>
<% end %>
<% if (@document[:subject_tesim].present? && !@document[:subject_tesim].empty?) || (document[:subject_topic_tesim].present? && !@document[:subject_topic_tesim].empty?) %>
<dt class="blacklight-subjects metadata-block__label-key">
<!-- KEY -->
Subjects
<!-- VALUE -->
<% keyword.each do |field_name, field| %>
<% if field_name == "subject_tesim" || field_name == "subject_topic_tesim" %>
<dd class="blacklight-<%= field_name.parameterize %> metadata-block__label-value metadata-block__label-value--ursus">
<%= doc_presenter.field_value field %>
</dd>
<% end %>
<% end %>
</dt>

<% end %>
</dl>
Expand Down

0 comments on commit e132ae2

Please sign in to comment.