-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: display holdings-level availablity status (if present) on item s…
…how pages. Closes TD-1336. - This change accommodates Duke records (post-Alma migration) where availability status is at holdings instead of item level - Also suppresses display of the "status" label if the value is blank.
- Loading branch information
Showing
4 changed files
with
59 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
<%= content_tag(loc_b_header_level) do %> | ||
<% # --- display broad location --- %> | ||
<% if loc_b.present? %> | ||
<% broad_location_display = map_argon_code(document.record_owner, 'loc_b', loc_b) %> | ||
<span class='location loc-broad loc_b__<%= loc_b %>'> | ||
<%= broad_location_display %> | ||
</span> | ||
<% end %> | ||
|
||
<% # --- display narrow location --- %> | ||
<% if loc_n.present? %> | ||
<% narrow_loc = map_argon_code(document.record_owner, 'loc_n', loc_n) %> | ||
<% if narrow_loc.nil? %> | ||
<% narrow_loc = loc_n %> | ||
<div class="col flex-grow-1"> | ||
<%= content_tag(loc_b_header_level) do %> | ||
<% # --- display broad location --- %> | ||
<% if loc_b.present? %> | ||
<% broad_location_display = map_argon_code(document.record_owner, 'loc_b', loc_b) %> | ||
<span class='location loc-broad loc_b__<%= loc_b %>'> | ||
<%= broad_location_display %> | ||
</span> | ||
<% end %> | ||
<% # is loc_n different and not empty? %> | ||
<% if narrow_loc != broad_location_display && narrow_loc != '' %> | ||
<span class='location loc-narrow loc_n__<%= loc_n %>'> — <%= narrow_loc %></span> | ||
<% # --- display narrow location --- %> | ||
<% if loc_n.present? %> | ||
<% narrow_loc = map_argon_code(document.record_owner, 'loc_n', loc_n) %> | ||
<% if narrow_loc.nil? %> | ||
<% narrow_loc = loc_n %> | ||
<% end %> | ||
<% # is loc_n different and not empty? %> | ||
<% if narrow_loc != broad_location_display && narrow_loc != '' %> | ||
<span class='location loc-narrow loc_n__<%= loc_n %>'> — <%= narrow_loc %></span> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% location_holdings = holdings_data.first %> | ||
<% holdings_availability = location_holdings.dig('status') %> | ||
<% available_class = item_availability_display(location_holdings) %> | ||
<% if holdings_availability.present? %> | ||
<div class="<%= status_wrapper_class(action: action_name) %> status-wrapper"> | ||
<dl> | ||
<dt> | ||
<span class='status-badge badge badge-info'><%= t('trln_argon.show.badge.status') %></span> | ||
</dt> | ||
<dd> | ||
<span class="<%= available_class %>"> | ||
<%= holdings_availability %> | ||
</span> | ||
</dd> | ||
</dl> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters