Skip to content

Commit dce4238

Browse files
authored
Merge pull request #287 from MITLibraries/use-221-dynamic-eyebrows
Use 221 dynamic eyebrows
2 parents 5edb8f8 + ad6b922 commit dce4238

29 files changed

+46
-26
lines changed

app/models/normalize_primo_record.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def normalize
1111
api: 'primo',
1212
title:,
1313
creators:,
14+
eyebrow:,
1415
source:,
1516
year:,
1617
format:,
@@ -63,6 +64,14 @@ def creators
6364
author_list.uniq
6465
end
6566

67+
def eyebrow
68+
if alma_record?
69+
'MIT Libraries Catalog'
70+
else
71+
'Central Discovery Index'
72+
end
73+
end
74+
6675
def source
6776
'Primo'
6877
end

app/models/normalize_timdex_record.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def normalize
1111
api: 'timdex',
1212
title:,
1313
creators:,
14+
eyebrow:,
1415
source:,
1516
year:,
1617
format:,
@@ -45,6 +46,12 @@ def creators
4546
.map { |creator| { 'value' => creator['value'], 'link' => nil } }
4647
end
4748

49+
# Currently just using source as eyebrow.
50+
# This will likely change to remap the source to more user-friendly values.
51+
def eyebrow
52+
source
53+
end
54+
4855
def source
4956
return 'Unknown source' unless @record['source']
5057

app/models/timdex_search.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class TimdexSearch < TimdexBase
5151
records {
5252
timdexRecordId
5353
title
54+
source
5455
contentType
5556
contributors {
5657
kind
@@ -183,6 +184,7 @@ class TimdexSearch < TimdexBase
183184
records {
184185
timdexRecordId
185186
title
187+
source
186188
contentType
187189
contributors {
188190
kind
@@ -309,6 +311,7 @@ class TimdexSearch < TimdexBase
309311
records {
310312
timdexRecordId
311313
title
314+
source
312315
contentType
313316
contributors {
314317
kind
@@ -445,6 +448,7 @@ class TimdexSearch < TimdexBase
445448
records {
446449
timdexRecordId
447450
title
451+
source
448452
contentType
449453
contributors {
450454
kind

app/views/search/_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<li class="result use">
22
<div class="result-content">
3-
<p class="eyebrow">Eyebrow Text</p>
3+
<p class="eyebrow"><%= result[:eyebrow] %></p>
44
<h3 class="record-title">
55
<span class="sr">Title: </span>
66
<%= link_to_result(result) %>

app/views/search/_result_primo.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<li class="result primo">
22
<div class="result-content">
3-
<p class="eyebrow">Eyebrow Text</p>
3+
<p class="eyebrow"><%= result[:eyebrow] %></p>
44
<h3 class="record-title">
55
<span class="sr">Title: </span>
66
<% if result[:links]&.find { |link| link['kind'] == 'full record' } %>

test/vcr_cassettes/advanced_title_data.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/data.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/data_from_ridiculous_start.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/data_page_2.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/vcr_cassettes/geo_all.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)