Skip to content

Repository Page Addendum #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/assets/images/nyh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$primary: #57068C;
$dark: #57068C;
$breadcrumb-divider: quote(">");
$light-bg-subtle: #EEF4FD;
14 changes: 14 additions & 0 deletions app/assets/stylesheets/application.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@
@import 'bootstrap-icons/font/bootstrap-icons';
@import "local";
@import "blacklight-frontend/app/assets/stylesheets/blacklight/blacklight";

// Hide X/Remove button from sidebar facet
.collection-page #facet-repository_sim span.facet-label .remove {
display: none;
}

// Hide X/Remove button from appliedParams button
.collection-page #appliedParams span.filter-repository_sim .remove {
display: none;
}

.collection-page #appliedParams span.filter-repository_sim span.constraint-value {
border-radius: $border-radius;
}
8 changes: 6 additions & 2 deletions app/components/blacklight/top_navbar_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark topbar" aria-label="<%= aria_label %>">
<nav class="navbar navbar-expand-md navbar-dark <%= request.path == "/nyhistory" ? "bg-light-subtle" : "bg-dark" %> topbar" aria-label="<%= aria_label %>">
<div class="<%= container_classes %>">
<a class="navbar-brand" href="https://library.nyu.edu"><img src="https://cdn.library.nyu.edu/images/nyulibraries-logo.svg" width="192" alt="NYU Libraries homepage"></a>
<% if request.path == "/nyhistory" %>
<a class="navbar-brand" href="https://www.nyhistory.org/library"><%= image_tag "nyh.png", height: 24, alt: "The New York Historical Homepage" %></a>
<% else %>
<a class="navbar-brand" href="https://library.nyu.edu"><img src="https://cdn.library.nyu.edu/images/nyulibraries-logo.svg" width="192" alt="NYU Libraries homepage"></a>
<% end %>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#user-util-collapse" data-bs-target="#user-util-collapse" aria-controls="user-util-collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class CatalogController < ApplicationController
# We need to override Blacklight's `index` in order to remediate the Solr response.
def index
@response = Blacklight::SearchService.new(config: CatalogController.blacklight_config, user_params: params).search_results
@collection_page = params[:collection_page]

# remediate_solr_response

Expand Down
1 change: 1 addition & 0 deletions app/views/catalog/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<% content_for(:head) do %>
<meta name="blacklight-search-storage" content="<%= blacklight_config.track_search_session.storage %>">
<% end %>

<% content_for(:sidebar) do %>
<% conf = blacklight_config.view_config(document_index_view_type) %>
<%= render conf.sidebar_component.new(blacklight_config: blacklight_config,
Expand Down
49 changes: 49 additions & 0 deletions app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<%= content_tag :html, class: 'no-js', **html_tag_attributes do %>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<title><%= render_page_title %></title>
<script>
document.querySelector('html').classList.remove('no-js');
</script>
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
<%= favicon_link_tag %>
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %>
<% if defined? Importmap %>
<%= javascript_importmap_tags %>
<% elsif defined? Propshaft %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<% else %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<script type="module">
import githubAutoCompleteElement from 'https://cdn.skypack.dev/@github/auto-complete-element';
</script>
<% end %>

<%= csrf_meta_tags %>
<%= content_for(:head) %>
</head>
<body class="<%= render_body_class %>">
<%= render blacklight_config.skip_link_component.new do %>
<%= content_for(:skip_links) %>
<% end %>

<%= render partial: 'shared/header_navbar' %>

<main id="main-container" class="<%= container_classes + (@collection_page ? " collection-page" : "") %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
<%= content_for(:container_header) %>

<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>

<div class="row">
<%= content_for?(:content) ? yield(:content) : yield %>
</div>
</main>

<%= render partial: 'shared/footer' %>
<%= render partial: 'shared/modal' %>
</body>
<% end %>
2 changes: 1 addition & 1 deletion app/views/repositories/_fales.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
books and manuscripts in English and American literature, the Downtown Collection, the Food and Cookery Collection,
the Riot Grrrl Collection, and the general Special Collections of the NYU Libraries.
<a target="_blank" href="https://library.nyu.edu/locations/special-collections-center/">Website</a>
</p>
</p>
6 changes: 5 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

# Create named routes for each collection specified in the Repositories Class
Findingaids::Repositories.repositories.each do |coll|
get "#{coll[1]['url']}" => "catalog#index", :search_field => "#{coll[1]['url_safe_display']}", :repository => "#{coll[1]['display']}", :f => { repository_sim: [ "#{coll[1]['admin_code']}" ] }
get "#{coll[1]['url']}" => "catalog#index",
:search_field => "#{coll[1]['url_safe_display']}",
:repository => "#{coll[1]['display']}",
:f => { repository_sim: [ "#{coll[1]['admin_code']}" ] },
:collection_page => true
end

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/sc.rake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace :sc do

add_document("berol.xml")
add_document("bloch.xml")
add_document("intelligencer.xml")
add_document("oh002.xml")
add_document("kopit.xml")
end
Expand Down
23 changes: 23 additions & 0 deletions spec/system/repository_links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@
expect(page).to have_selector('article.document')
end
end

it "hides the remove button next to the repository" do
visit "/fales"

within("div.blacklight-repository_sim") do
expect(page).to have_selector('a.remove', visible: false)
end
end
end

context "Fales facet" do
it "shows the remove button next to the repository" do
visit "/"

click_button "Library"
within("div.blacklight-repository_sim") do
click_link "The Fales Library & Special Collections"
end

within("div.blacklight-repository_sim") do
expect(page).to have_selector('a.remove', visible: true)
end
end
end

context "Tamiment homepage" do
Expand Down