Skip to content

Commit dbbdcc9

Browse files
authored
Merge pull request #1509 from projectblacklight/1508-language-component
Display the language field at the component level if present. Closes …
2 parents fd9e897 + 33a1776 commit dbbdcc9

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/generators/arclight/templates/catalog_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ class CatalogController < ApplicationController
347347
config.add_component_field 'abstract', field: 'abstract_html_tesm', helper_method: :render_html_tags
348348
config.add_component_field 'extent', field: 'extent_ssm'
349349
config.add_component_field 'scopecontent', field: 'scopecontent_html_tesm', helper_method: :render_html_tags
350+
config.add_component_field 'language', field: 'language_ssim'
350351
config.add_component_field 'acqinfo', field: 'acqinfo_ssim', helper_method: :render_html_tags
351352
config.add_component_field 'bioghist', field: 'bioghist_html_tesm', helper_method: :render_html_tags
352353
config.add_component_field 'appraisal', field: 'appraisal_html_tesm', helper_method: :render_html_tags
@@ -368,7 +369,7 @@ class CatalogController < ApplicationController
368369
config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
369370
config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
370371
config.add_component_field 'note', field: 'note_html_tesm', helper_method: :render_html_tags
371-
372+
372373
# Component Show Page - Indexed Terms Section
373374
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
374375
words_connector: '<br/>',

spec/features/component_page_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
it 'shows configured component fields' do
8787
expect(page).to have_css('dt', text: 'Extent')
8888
expect(page).to have_css('dd', text: /^2 Linear Feet/)
89+
expect(page).to have_css('dt', text: 'Language')
90+
expect(page).to have_css('dd', text: 'English')
8991
expect(page).to have_css('dt', text: 'Physical description')
9092
expect(page).to have_css('dd', text: /^Mixed Materials/)
9193
expect(page).to have_css('dt', text: 'Dimensions')

spec/fixtures/ead/nlm/alphaomegaalpha.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@
490490
<did>
491491
<unittitle>Constitution and by-laws - drafts,</unittitle>
492492
<unitdate normal="1902/1904" type="inclusive">1902-1904</unitdate>
493+
<langmaterial>
494+
<language langcode="eng">English</language>
495+
</langmaterial>
493496
<physdesc>
494497
Mixed Materials
495498
</physdesc>

0 commit comments

Comments
 (0)