Skip to content

Commit 0c96da8

Browse files
committed
Render titles with source links for TIMDEX records
Why these changes are being introduced: In TIMDEX UI, titles linked to full record views. That feature is not currently implemented in USE UI. Relevant ticket(s): * [USE-99](https://mitlibraries.atlassian.net/browse/USE-99) How this addresses that need: This updates TIMDEX title links to use the `source_link` field. Side effects of this change: When developing TIMDEX UI, we decided not to test any view logic. I've continued that practice here, with some apprehension. (We've already missed a bug in the view while developing USE, which might have been avoided with more robust integration testing.) Not exactly a side effect, but perhaps a topic for future discussion.
1 parent 22eb852 commit 0c96da8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/views/search/_result.html.erb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<li class="result">
22
<div class="result-content">
33
<h3 class="record-title">
4-
<span class="sr">Title: </span><%= link_to(result['title'], record_path(result['identifier'])) %>
4+
<span class="sr">Title: </span>
5+
<% if result['source_link'] %>
6+
<%= link_to(result['title'], result['source_link']) %>
7+
<% else %>
8+
<%= result['title'] %>
9+
<% end %>
510
</h3>
611

712
<p class="pub-info">

0 commit comments

Comments
 (0)