Skip to content

Commit

Permalink
Merge pull request #1509 from projectblacklight/1508-language-component
Browse files Browse the repository at this point in the history
Display the language field at the component level if present. Closes …
  • Loading branch information
lfarrell authored Dec 19, 2023
2 parents fd9e897 + 33a1776 commit dbbdcc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/generators/arclight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ class CatalogController < ApplicationController
config.add_component_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
config.add_component_field 'extent', field: 'extent_ssm'
config.add_component_field 'scopecontent', field: 'scopecontent_html_tesm', helper_method: :render_html_tags
config.add_component_field 'language', field: 'language_ssim'
config.add_component_field 'acqinfo', field: 'acqinfo_ssim', helper_method: :render_html_tags
config.add_component_field 'bioghist', field: 'bioghist_html_tesm', helper_method: :render_html_tags
config.add_component_field 'appraisal', field: 'appraisal_html_tesm', helper_method: :render_html_tags
Expand All @@ -368,7 +369,7 @@ class CatalogController < ApplicationController
config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
config.add_component_field 'note', field: 'note_html_tesm', helper_method: :render_html_tags

# Component Show Page - Indexed Terms Section
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
words_connector: '<br/>',
Expand Down
2 changes: 2 additions & 0 deletions spec/features/component_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
it 'shows configured component fields' do
expect(page).to have_css('dt', text: 'Extent')
expect(page).to have_css('dd', text: /^2 Linear Feet/)
expect(page).to have_css('dt', text: 'Language')
expect(page).to have_css('dd', text: 'English')
expect(page).to have_css('dt', text: 'Physical description')
expect(page).to have_css('dd', text: /^Mixed Materials/)
expect(page).to have_css('dt', text: 'Dimensions')
Expand Down
3 changes: 3 additions & 0 deletions spec/fixtures/ead/nlm/alphaomegaalpha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@
<did>
<unittitle>Constitution and by-laws - drafts,</unittitle>
<unitdate normal="1902/1904" type="inclusive">1902-1904</unitdate>
<langmaterial>
<language langcode="eng">English</language>
</langmaterial>
<physdesc>
Mixed Materials
</physdesc>
Expand Down

0 comments on commit dbbdcc9

Please sign in to comment.