Skip to content

Commit ee773ce

Browse files
authored
Merge pull request #194 from MITLibraries/contribs-markup
Improve markup for contributors
2 parents ab1dfb6 + a415e75 commit ee773ce

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

app/assets/stylesheets/partials/_results.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
display: -webkit-box;
108108
-webkit-line-clamp: 3;
109109
-webkit-box-orient: vertical;
110+
text-overflow: ellipsis;
110111
}
111112

112113
.inner-heading {

app/assets/stylesheets/partials/_shared.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
.result,
22
.full-record {
3-
.authors {
3+
.contributors {
44
font-size: 1.6rem;
55
font-weight: $fw-bold;
66
margin-bottom: 0.6em;
7+
li {
8+
display: inline;
9+
}
10+
li::after {
11+
content: " ; ";
12+
}
13+
li:last-child:after {
14+
content: "";
15+
}
716
}
817

918
.data-info {

app/views/record/_record_geo.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
</div>
1515

1616
<% if @record['contributors'].present? %>
17-
<p class="authors">
18-
<%= render partial: 'shared/authors', locals: { contributors: @record['contributors'] } %>
19-
</p>
17+
<span class="sr">Contributors: </span>
18+
<ul class="list-inline contributors">
19+
<%= render partial: 'shared/contributors', locals: { contributors: @record['contributors'] } %>
20+
</ul>
2021
<% end %>
2122

2223
<% if @record['alternateTitles'].present? %>

app/views/search/_result.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
</span>
1313
</p>
1414

15-
<p class="authors">
16-
<%= render partial: 'shared/authors', locals: { contributors: result['contributors'] } %>
17-
</p>
15+
<span class="sr">Contributors: </span>
16+
<ul class="list-inline truncate-list contributors">
17+
<%= render partial: 'shared/contributors', locals: { contributors: result['contributors'] } %>
18+
</ul>
1819

1920
<div class="result-highlights">
2021
<%= render partial: 'search/highlights', locals: { result: result } %>

app/views/search/_result_geo.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
</div>
99

1010
<% if result_geo['contributors'] %>
11-
<p class="authors truncate-list">
12-
<%= render partial: 'shared/authors', locals: { contributors: result_geo['contributors'] } %>
13-
</p>
11+
<span class="sr">Contributors: </span>
12+
<ul class="list-inline truncate-list contributors">
13+
<%= render partial: 'shared/contributors', locals: { contributors: result_geo['contributors'] } %>
14+
</ul>
1415
<% end %>
1516

1617
<% if result_geo['summary'] %>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<%= return if contributors.blank? %>
2+
3+
<% contributors.uniq do |contributor| %>
4+
<li><%= link_to contributor['value'], results_path({ advanced: true, contributors: contributor['value'] }) %></li>
5+
<% end %>

0 commit comments

Comments
 (0)