Skip to content

Commit

Permalink
Merge pull request #122 from mlibrary/ARC-98-Bug-ArcLight-not-sending…
Browse files Browse the repository at this point in the history
…-quoted-titles-into-Aeon

Resolves ARC-98 Bug ArcLight not sending quoted titles into Aeon.
  • Loading branch information
gkostin1966 authored Feb 9, 2024
2 parents 558efa8 + 65f2bf5 commit bde2bca
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
29 changes: 28 additions & 1 deletion app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def bioghist
# DUL custom property for a tagless short description of a collection or component.
# Can be used e.g., in meta tags or popovers/tooltips.
def short_description
truncate(strip_tags(abstract_or_scope), length: 400, separator: ' ')
truncate(ActionController::Base.helpers.strip_tags(abstract_or_scope), length: 400, separator: ' ')
end

# DUL override ArcLight core method, which was incorrectly lowercasing subsequent characters in
Expand Down Expand Up @@ -211,6 +211,33 @@ def subseries_title
parent_labels[i] if i.present?
end

# ========================
# AEON Request Item Values
# ========================

def aeon_item_sub_title_value
rv = ActionController::Base.helpers.strip_tags(normalized_title)
rv += " (#{extent})" if extent
# CGI.escapeHTML(rv)
rv
end

def aeon_item_sub_title_sr_only
aeon_item_sub_title_value
end

def aeon_item_volume_value
containers.join(', ')
end

def aeon_item_citation_value
reference
end

def aeon_item_info_1_value
accessrestrict
end

# ==============================
# Highlights (for query matches)
# ==============================
Expand Down
12 changes: 6 additions & 6 deletions app/views/arclight/fragments/_components.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<label class="btn btn-outline-secondary btn-outline-request squat p-2 mb-0">
<input type="checkbox" name="Request" value="<%= component.id %>">
<input type="hidden" name="Request" value="<%= component.id %>">
<input type="hidden" name="ItemSubTitle_<%= component.id %>" value="<%= raw(strip_tags(component.normalized_title)) %><%= if component.extent then " (#{component.extent})" end %>">
<input type="hidden" name="ItemVolume_<%= component.id %>" value="<%= component.containers.join(', ') %>">
<input type="hidden" name="ItemCitation_<%= component.id %>" value="<%= component.reference %>">
<input type="hidden" name="ItemInfo1" value="<%= component.accessrestrict %>">
<span class="sr-only">Request "<%= raw(strip_tags(component.normalized_title)) %><%= if component.extent then " (#{component.extent})" end %>"</span>
<input type="hidden" name="ItemSubTitle_<%= component.id %>" value="<%= component.aeon_item_sub_title_value %>">
<input type="hidden" name="ItemVolume_<%= component.id %>" value="<%= component.aeon_item_volume_value %>">
<input type="hidden" name="ItemCitation_<%= component.id %>" value="<%= component.aeon_item_citation_value %>">
<input type="hidden" name="ItemInfo1" value="<%= component.aeon_item_info_1_value %>">
<span class="sr-only">Request "<%= component.aeon_item_sub_title_sr_only %>"</span>
</label>
</div>
<% else %>
Expand All @@ -35,4 +35,4 @@
<%= render 'arclight/fragments/component_details', { component: component } %>
</div>
</article>
<% end %>
<% end %>
10 changes: 5 additions & 5 deletions app/views/catalog/_aeon_request_checkbox.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<label class="<%= local_assigns[:label_class] || '' %>" title="">
<input type="checkbox" name="Request" value="<%= document.id %>">
<input type="hidden" name="Request" value="<%= document.id %>">
<input type="hidden" name="ItemSubTitle_<%= document.id %>" value="<%= raw(strip_tags(document.normalized_title)) %><%= if document.extent then " (#{document.extent})" end %>">
<input type="hidden" name="ItemVolume_<%= document.id %>" value="<%= document.containers.join(', ') %>">
<input type="hidden" name="ItemCitation_<%= document.id %>" value="<%= document.reference %>">
<input type="hidden" name="ItemInfo1" value="<%= document.accessrestrict %>">
<input type="hidden" name="ItemSubTitle_<%= document.id %>" value="<%= document.aeon_item_sub_title_value %>">
<input type="hidden" name="ItemVolume_<%= document.id %>" value="<%= document.aeon_item_volume_value %>">
<input type="hidden" name="ItemCitation_<%= document.id %>" value="<%= document.aeon_item_citation_value %>">
<input type="hidden" name="ItemInfo1" value="<%= document.aeon_item_info_1_value %>">
<% if local_assigns[:label] %>
<span><%= label %></span>
<% else %>
<span class="sr-only">Request "<%= raw(strip_tags(document.normalized_title)) %><%= if document.extent then " (#{document.extent})" end %>"</span>
<span class="sr-only">Request "<%= document.aeon_item_sub_title_sr_only %>"</span>
<% end %>
</label>
</div>
5 changes: 2 additions & 3 deletions config/initializers/arc_84.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,8 @@
"umich-wcl-P-2863-25for" => "umich-wcl-P-2863.25for",
"umich-scl-kramera" => "umich-scl-ams0185",
"umich-scl-hungarywar" => "umich-scl-ams0195",
"umich-scl-cope" => "umich-scl-ams0196",
"umich-scl-weber" => "umich-scl-ams0197",
"umich-scl-cope" => "umich-scl-ams0196",
"umich-scl-weber" => "umich-scl-ams0197",
"umich-scl-inglisa" => "umich-scl-ams0198",
"umich-scl-warresisters" => "umich-scl-ams0199"

}

0 comments on commit bde2bca

Please sign in to comment.