diff --git a/app/assets/stylesheets/modules/access-panel-library-locations.scss b/app/assets/stylesheets/modules/access-panel-library-locations.scss index ade85b909..8ebd3ee51 100644 --- a/app/assets/stylesheets/modules/access-panel-library-locations.scss +++ b/app/assets/stylesheets/modules/access-panel-library-locations.scss @@ -31,9 +31,6 @@ margin-left: -12px; } } - .reserve-note { - color: #990000; - } } } } diff --git a/app/assets/stylesheets/modules/availability.scss b/app/assets/stylesheets/modules/availability.scss index 954f7a5b3..4833ccca4 100644 --- a/app/assets/stylesheets/modules/availability.scss +++ b/app/assets/stylesheets/modules/availability.scss @@ -1,4 +1,32 @@ +.note-highlight { + padding: 2px 5px; + background-color: $public-note-yellow; + &.bound-with-note { + margin-left: 10px; + } +} + .availability { + width: 100%; + + &.record-view { + margin-top: 4px; + margin-bottom: 15px; + } + + tr td:first-child { + width: 60%; + } + + td { + padding: 2px 5px 5px 0; + vertical-align: top; + } + + .availability-icon-wrapper { + white-space: nowrap; + } + .availability-icon { width: 1.2em; } @@ -9,13 +37,5 @@ } .current-location { color: $sul-availability-current-location-color; - margin-right: 0.5em; - } - .note-highlight { - padding: 2px 5px; - background-color: $public-note-yellow; - &.bound-with-note { - margin-left: 10px; - } } } diff --git a/app/views/catalog/_index_location.html.erb b/app/views/catalog/_index_location.html.erb index c98ea574f..6c699c0b0 100644 --- a/app/views/catalog/_index_location.html.erb +++ b/app/views/catalog/_index_location.html.erb @@ -53,7 +53,7 @@ <% end %> <% if item.on_reserve? %> - On Reserve <%= item.loan_period %> + <%= item.loan_period %> <% end %> <% if item.must_request? %> diff --git a/app/views/catalog/access_panels/_location.html.erb b/app/views/catalog/access_panels/_location.html.erb index 079fdb933..2fe79a41e 100644 --- a/app/views/catalog/access_panels/_location.html.erb +++ b/app/views/catalog/access_panels/_location.html.erb @@ -2,9 +2,9 @@ <% if document.access_panels.library_locations? %>
<% document.access_panels.library_locations.libraries.each do |library| %> -
> +
> <%= link_to_library_header(library) %> -
+
<% if document.index_links.finding_aid.present? %>

Finding aid

@@ -17,64 +17,73 @@

<%= library.library_instructions[:text] %>

<% end %> -
    - <% library.locations.select(&:present?).each do |location| %> -
  • - <%= render partial: "catalog/stackmap_link", locals: { document: document, location: location, location_name_class: "location-name" } %> - <% if location.items.present? %> - <% if location.bound_with? && document.bound_with? %> -

    - <%= render document.bound_with_note %> -

    - <% else %> - <% if location_level_request_link?(library, location) %> - <%= link_to_request_link(document: document, callnumber: location.items.first, class: 'btn btn-default btn-xs request-button pull-right') %> - <% end %> - <% end %> + <% library.locations.select(&:present?).each do |location| %> + <%= render partial: "catalog/stackmap_link", locals: { document: document, location: location, location_name_class: "location-name" } %> + <% if location.bound_with? && document.bound_with? %> +

    + <%= render document.bound_with_note %> +

    + <% else %> + <% if location_level_request_link?(library, location) %> + <%= link_to_request_link(document: document, callnumber: location.items.first, class: 'btn btn-default btn-xs request-button pull-right') %> + <% end %> + <% end %> + <% if location.mhld.present? %> + <% location.mhld.each do |mhld| %> + <% if mhld.public_note.present? %> +
    <%= mhld.public_note %>
    + <% end %> + <% if mhld.latest_received.present? %> +
    Latest: <%= mhld.latest_received %>
    <% end %> -
      - <% if location.mhld.present? %> - <% location.mhld.each do |mhld| %> - <% if mhld.public_note.present? %> -
    • <%= mhld.public_note %>
    • - <% end %> - <% if mhld.latest_received.present? %> -
    • Latest: <%= mhld.latest_received %>
    • - <% end %> - <% if mhld.library_has.present? %> -
    • Library has: <%= mhld.library_has %>
    • - <% end %> - <% end %> - <% end %> - <% location.items.each do |item| %> -
    • > - - - <%= item.status.status_text %> - - <%= item.callnumber %> - -
      - <% unless item.treat_current_location_as_home_location? %> - <%= item.current_location.name %> - <% end %> -
      - <% if item.on_reserve? %> -
      On Reserve <%= item.loan_period %>
      - <% end %> - <% unless item.public_note.blank? %> -
      Note: <%= item.public_note %>
      - <% end %> -
    • - <% end %> -
    -
  • + <% if mhld.library_has.present? %> +
    Library has: <%= mhld.library_has %>
    + <% end %> + <% end %> <% end %> -
+ + + + + + + + + + <% location.items.each do |item| %> + + + + + <% end %> + +
Items in <%= location.name %>
Call numberStatus
+ <%= item.callnumber %> + <% if item.public_note.present? %> +
Note: <%= item.public_note %>
+ <% end %> +
> + + + + <%= item.status.status_text unless item.current_location && item.current_location.name.present? %> + + + + <% unless item.treat_current_location_as_home_location? %> + <%= item.current_location.name %> + <% end %> + + <% if item.on_reserve? %> + <%= item.loan_period %> + <% end %> + + <% if item.must_request? %> + <%= link_to_request_link(document: document, callnumber: item, barcode: item.barcode, class: 'btn btn-info btn-xs') %> + <% end %> + +
+ <% end %>
<% end %> diff --git a/spec/features/access_panels/library_location_spec.rb b/spec/features/access_panels/library_location_spec.rb index 2dfef8a6d..89c1c071c 100644 --- a/spec/features/access_panels/library_location_spec.rb +++ b/spec/features/access_panels/library_location_spec.rb @@ -21,9 +21,9 @@ feature 'long lists should be truncated', js: true do scenario 'items with more than 5 callnumbers should be truncated with a more link' do visit catalog_path '10' - expect(page).to_not have_css('li', text: 'GHI', visible: true) + expect(page).not_to have_css('td', text: 'IHG', visible: true) click_button 'show all' - expect(page).to have_css('li', text: 'GHI', visible: true) + expect(page).to have_css('td', text: 'IHG', visible: true) end end end diff --git a/spec/features/mhld_spec.rb b/spec/features/mhld_spec.rb index 0eb75084f..ef475f404 100644 --- a/spec/features/mhld_spec.rb +++ b/spec/features/mhld_spec.rb @@ -7,15 +7,15 @@ within('[data-hours-route="/hours/CHEMCHMENG"]') do expect(page).to have_css('.location-name', text: 'Current periodicals') - expect(page).to have_css('li.mhld', text: 'public note2') - expect(page).to have_css('li.mhld.note-highlight', text: 'Latest: latest received2') - expect(page).to have_css('li.mhld', text: 'Library has: library has2') + expect(page).to have_css('.mhld', text: 'public note2') + expect(page).to have_css('.mhld.note-highlight', text: 'Latest: latest received2') + expect(page).to have_css('.mhld', text: 'Library has: library has2') end within('[data-hours-route="/hours/GREEN"]') do expect(page).to have_css('.location-name', text: 'Stacks') - expect(page).to have_css('li.mhld', text: 'public note3') - expect(page).to have_css('li.mhld.note-highlight', text: 'Latest: latest received3') - expect(page).to have_css('li.mhld', text: 'Library has: library has3') + expect(page).to have_css('.mhld', text: 'public note3') + expect(page).to have_css('.mhld.note-highlight', text: 'Latest: latest received3') + expect(page).to have_css('.mhld', text: 'Library has: library has3') end end end diff --git a/spec/fixtures/solr_documents/10.yml b/spec/fixtures/solr_documents/10.yml index e30dfe59d..772341753 100644 --- a/spec/fixtures/solr_documents/10.yml +++ b/spec/fixtures/solr_documents/10.yml @@ -17,6 +17,9 @@ - "123 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- ABC -|-" - "456 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- DEF -|-" - "123 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- GHI -|-" + - "321 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- CBA -|-" + - "654 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- FED -|-" + - "876 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- IHG -|-" - "678 -|- EARTH-SCI -|- STACKS -|- -|- -|- -|- -|- -|- JKL -|-" - "123 -|- CHEMCHMENG -|- STACKS -|- -|- -|- -|- -|- -|- MNO -|-" - "543 -|- BIOLOGY -|- STACKS -|- -|- -|- -|- -|- -|- PQR -|-" diff --git a/spec/views/catalog/access_panels/_location.html.erb_spec.rb b/spec/views/catalog/access_panels/_location.html.erb_spec.rb index 1ac8418b3..ae307171c 100644 --- a/spec/views/catalog/access_panels/_location.html.erb_spec.rb +++ b/spec/views/catalog/access_panels/_location.html.erb_spec.rb @@ -48,8 +48,7 @@ ] )) render - expect(rendered).to have_css('ul.location li', text: /University Archives\s*Request/) - expect(rendered).to have_css('ul.location li a', text: "Request") + expect(rendered).to have_css('.location a', text: "Request") end it 'should not have the location level request link for -RESV locations' do @@ -74,11 +73,11 @@ )) render end - it "should have screen-reader-only unknown status text for items we'll be looking up" do - expect(rendered).to have_css('.status-text.sr-only', text: 'Unknown') + it "should have unknown status text for items we'll be looking up" do + expect(rendered).to have_css('.status-text', text: 'Unknown') end - it "should have explicit screen-reader-only status text for items that we know the status" do - expect(rendered).to have_css('.status-text.sr-only', text: 'In-library use') + it "should have explicit status text for items that we know the status" do + expect(rendered).to have_css('.status-text', text: 'In-library use') end end describe "current locations" do @@ -130,11 +129,11 @@ it "should include the matched MHLD" do expect(rendered).to have_css('.panel-library-location a', count: 3) expect(rendered).to have_css('h3', text: "Green Library", count: 1) - expect(rendered).to have_css('li .location-name a', text: "Stacks", count: 1) - expect(rendered).to have_css('ul.items li.mhld', text: "public note") - expect(rendered).to have_css('ul.items li.mhld.note-highlight', text: "Latest: latest received") - expect(rendered).to have_css('ul.items li.mhld', text: "Library has: library has") - expect(rendered).to have_css('ul.items li', text: "ABC 123") + expect(rendered).to have_css('.location-name a', text: "Stacks", count: 1) + expect(rendered).to have_css('.panel-library-location .mhld', text: "public note") + expect(rendered).to have_css('.panel-library-location .mhld.note-highlight', text: "Latest: latest received") + expect(rendered).to have_css('.panel-library-location .mhld', text: "Library has: library has") + expect(rendered).to have_css('.panel-library-location td', text: "ABC 123") end end describe "that has no matching library/location" do @@ -148,10 +147,10 @@ it "should invoke a library block w/ the appropriate mhld data" do expect(rendered).to have_css('.panel-library-location a', count: 1) expect(rendered).to have_css('h3', text: "Green Library") - expect(rendered).to have_css('li .location-name', text: "Stacks") - expect(rendered).to have_css('ul.items li.mhld', text: "public note") - expect(rendered).to have_css('ul.items li.mhld.note-highlight', text: "Latest: latest received") - expect(rendered).to have_css('ul.items li.mhld', text: "Library has: library has") + expect(rendered).to have_css('.location-name', text: "Stacks") + expect(rendered).to have_css('.panel-library-location .mhld', text: "public note") + expect(rendered).to have_css('.panel-library-location .mhld.note-highlight', text: "Latest: latest received") + expect(rendered).to have_css('.panel-library-location .mhld', text: "Library has: library has") end end end @@ -165,10 +164,10 @@ render end it "should be present" do - expect(rendered).to have_css('ul.location li a', text: 'Request') + expect(rendered).to have_css('.location a', text: 'Request') end it "should not have any requestable items" do - expect(rendered).to_not have_css('ul.items li[data-request-url]') + expect(rendered).to_not have_css('td[data-request-url]') end end describe "item level request links" do @@ -180,10 +179,10 @@ render end it "should not have a request url stored in the data attribute" do - expect(rendered).to_not have_css('ul.items li[data-request-url]') + expect(rendered).to_not have_css('td[data-request-url]') end it "should not have a request link in the item" do - expect(rendered).to have_css('ul.items li a', text: 'Request') + expect(rendered).to have_css('tbody a', text: 'Request') end end describe "requestable vs. non-requestable items" do @@ -198,10 +197,10 @@ render end it "should have an item that has a request url" do - expect(rendered).to have_css('ul.items li[data-request-url]', text: 'ABC 456') + expect(rendered).to have_css('.availability td[data-barcode="456"][data-request-url]') end it "should have an item that does not have a request url" do - expect(rendered).to_not have_css('ul.items li[data-request-url]', text: 'ABC 123') + expect(rendered).to_not have_css('.availability td[data-barcode="123"][data-request-url]') end end end @@ -221,13 +220,13 @@ expect(rendered).to have_css('.panel-library-location a', count: 1) end it "should render SUL items in the zombie library" do - expect(rendered).to have_css('.panel-library-location li', text: 'ABC') + expect(rendered).to have_css('.panel-library-location td', text: 'ABC') end it "should render PHYSICS items in the zombie library" do - expect(rendered).to have_css('.panel-library-location li', text: 'DEF') + expect(rendered).to have_css('.panel-library-location td', text: 'DEF') end it "should render blank (i.e. on order) items in the zombie library" do - expect(rendered).to have_css('.panel-library-location li', text: 'GHI') + expect(rendered).to have_css('.panel-library-location td', text: 'GHI') end end describe 'public note' do