Skip to content
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

Fix facet prev/next pagination nav display within and outside of moda… #3548

Merged
merged 1 commit into from
Apr 2, 2025
Merged
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
9 changes: 6 additions & 3 deletions app/assets/builds/blacklight.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,6 @@ main {
border-radius: 5px;
}

.modal-content .facet-pagination.top {
display: none; /* Doesn't display in a modal, but would display on a new page (e.g. without Javascript) */
}
.modal-content .page-sidebar {
display: none;
}
Expand All @@ -437,6 +434,12 @@ main {
display: none;
}

.modal-footer:not(.modal .modal-footer) {
border-top: var(--bs-border-width) solid var(--bs-border-color);
padding-top: 1rem;
margin-top: 1rem;
}

.remove .bi {
height: 1em;
width: 1em;
Expand Down
13 changes: 9 additions & 4 deletions app/assets/stylesheets/blacklight/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
}

.modal-content {
.facet-pagination.top {
display: none; /* Doesn't display in a modal, but would display on a new page (e.g. without Javascript) */
}

.page-sidebar {
display: none;
}
Expand All @@ -21,3 +17,12 @@
.blacklight-modal-close {
display: none;
}

// When modal content is rendered outside of a modal, Bootstrap css variables like
// --bs-modal-footer-border-width are undefined (only in .modal scope). So we apply
// light styling to the modal footer when it's not in a modal.
.modal-footer:not(.modal .modal-footer) {
border-top: var(--bs-border-width) solid var(--bs-border-color);
padding-top: 1rem;
margin-top: 1rem;
}
19 changes: 10 additions & 9 deletions app/views/catalog/facet.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<%= render Blacklight::System::ModalComponent.new do |component| %>
<% component.with_prefix do %>
<div class="facet-pagination top d-flex w-100 justify-content-between">
<%= render :partial=>'facet_pagination' %>
</div>
<% end %>

<% component.with_title { facet_field_label(@facet.key) } %>
<%= render Blacklight::Search::FacetSuggestInput.new(facet: @facet, presenter: @presenter) %>
<div class="card card-body bg-light p-3 mb-3 border-0">
<% component.with_title { facet_field_label(@facet.key) } %>
<%= render Blacklight::Search::FacetSuggestInput.new(facet: @facet, presenter: @presenter) %>
<%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>

<%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
</div>

<div class="facet-pagination top d-flex flex-wrap w-100 justify-content-between border-bottom pb-3 mb-3">
<%= render :partial=>'facet_pagination' %>
</div>

<div class="facet-extended-list">
<%= render Blacklight::FacetComponent.new(display_facet: @display_facet,
Expand All @@ -17,7 +18,7 @@
</div>

<% component.with_footer do %>
<div class="facet-pagination bottom flex-row justify-content-between">
<div class="facet-pagination bottom d-flex flex-wrap w-100 justify-content-between">
<%= render :partial=>'facet_pagination' %>
</div>
<% end %>
Expand Down