Skip to content

Commit

Permalink
downgrade view component, change facet pagination links, #38
Browse files Browse the repository at this point in the history
  • Loading branch information
stkenny committed Feb 15, 2024
1 parent eb013e9 commit ca69945
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'uri', '>= 0.12.2'

gem 'blacklight', '~>7'
gem 'blacklight_advanced_search', '~> 7'
#gem 'view_component', '2.83'
gem 'view_component', '< 3'
gem 'blacklight_oai_provider', '~> 7.0', '>= 7.0.2'
gem 'rsolr'
gem 'kaminari', '>= 1.2.1'
Expand Down
17 changes: 9 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,16 @@ GEM
rubocop-performance
rubocop-rails
rubocop-rspec
blacklight (7.33.1)
blacklight (7.36.2)
deprecation
globalid
hashdiff
i18n (>= 1.7.0)
jbuilder (~> 2.7)
kaminari (>= 0.15)
ostruct (>= 0.3.2)
rails (>= 5.1, < 7.1)
view_component (~> 2.66)
rails (>= 5.1, < 7.2)
view_component (>= 2.66, < 4)
blacklight-access_controls (6.0.1)
blacklight (> 6.0, < 8)
cancancan (>= 1.8)
Expand Down Expand Up @@ -507,7 +507,7 @@ GEM
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashdiff (1.0.1)
hashdiff (1.1.0)
hashie (5.0.0)
high_voltage (3.1.2)
highline (2.1.0)
Expand Down Expand Up @@ -672,7 +672,7 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.5)
minitar (0.9)
minitest (5.21.2)
minitest (5.22.2)
moab-versioning (4.4.2)
druid-tools (>= 1.0.0)
json
Expand All @@ -692,7 +692,7 @@ GEM
redic
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.9.1)
net-imap (0.4.10)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -747,7 +747,7 @@ GEM
rails (> 3.2.0)
orm_adapter (0.5.0)
os (1.1.4)
ostruct (0.5.5)
ostruct (0.6.0)
paper_trail (15.0.0)
activerecord (>= 6.1)
request_store (~> 1.4)
Expand Down Expand Up @@ -1161,7 +1161,7 @@ GEM
rdf (~> 3.2, >= 3.2.9)
rdf-xsd (~> 3.2)
yard (0.9.34)
zeitwerk (2.6.12)
zeitwerk (2.6.13)

PLATFORMS
x86_64-linux
Expand Down Expand Up @@ -1281,6 +1281,7 @@ DEPENDENCIES
unicode
uri (>= 0.12.2)
user_group!
view_component (< 3)
yard

BUNDLED WITH
Expand Down
8 changes: 8 additions & 0 deletions app/assets/sass/dri/_dri.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,14 @@ ol.breadcrumb {
box-shadow: 1px 1px 4px $dri_white;
}
}

.facet-pagination {
a, span {
padding: 2px;
margin-left: 2px;
}
}

/*-------------- Browse Sort Collections/Objects --------------*/

.dri_search_tab_container{
Expand Down
8 changes: 4 additions & 4 deletions app/views/catalog/_facet_pagination.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<% component = Blacklight::FacetFieldPaginationComponent.new(facet_field: @facet_field) %>

<div class="prev_next_links btn-group">
<%= link_to_previous_page @facet_field.paginator, image_tag('dri/previous_carousel_arrow.png'), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, image_tag('dri/previous_carousel_arrow.png'), class: 'disabled btn' %>
<%= link_to_previous_page @facet_field.paginator, raw(t('dri.views.pagination.previous')), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, raw(t('dri.views.pagination.previous')), class: 'disabled btn' %>
<% end %>
<%= link_to_next_page @facet_field.paginator, image_tag('dri/next_carousel_arrow.png'), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, image_tag('dri/next_carousel_arrow.png'), class: 'disabled btn' %>
<%= link_to_next_page @facet_field.paginator, raw(t('dri.views.pagination.next')), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, raw(t('dri.views.pagination.next')), class: 'disabled btn' %>
<% end %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>

<% component.footer do %>
<div class="facet-pagination bottom row justify-content-between">
<div class="facet-pagination bottom flex-row justify-content-between">
<%= render :partial=>'facet_pagination' %>
</div>
<% end %>
Expand Down
15 changes: 8 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@
<%= render partial: 'shared/cookies_modal' if display_end_user_agreement? %>
<%= render partial: 'advanced/dri_modal' %>
<%= render partial: 'shared/header_navbar' %>
<div id="blacklight-modal" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Loading...
</div>
</div>
</div>
<div id="blacklight-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" data-turbo="false">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
</div>
</div>
</div>


<%# the blacklight maps gem seems to set a 'constraint' even when none appears to exist %>
<%# - check below is to see if a facet or text query exists %>
<% if query_has_constraints? && has_constraint_params? %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/my_collections/_facet_pagination.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<% component = Blacklight::FacetFieldPaginationComponent.new(facet_field: @facet_field) %>

<div class="prev_next_links btn-group">
<%= link_to_previous_page @facet_field.paginator, image_tag('dri/previous_carousel_arrow.png'), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, image_tag('dri/previous_carousel_arrow.png'), class: 'disabled btn' %>
<%= link_to_previous_page @facet_field.paginator, raw(t('dri.views.pagination.previous')), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, raw(t('dri.views.pagination.previous')), class: 'disabled btn' %>
<% end %>
<%= link_to_next_page @facet_field.paginator, image_tag('dri/next_carousel_arrow.png'), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, image_tag('dri/next_carousel_arrow.png'), class: 'disabled btn' %>
<%= link_to_next_page @facet_field.paginator, raw(t('dri.views.pagination.next')), params: @facet_field.search_state.to_h, param_name: component.param_name, class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
<%= content_tag :span, raw(t('dri.views.pagination.next')), class: 'disabled btn' %>
<% end %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/my_collections/facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>

<% component.footer do %>
<div class="facet-pagination bottom row justify-content-between">
<div class="facet-pagination bottom flex-row justify-content-between">
<%= render :partial=>'facet_pagination' %>
</div>
<% end %>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/dri/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ en:
cancel: Cancel
pagination:
label: Browse
next: 'Next >>'
previous: '<< Previous'
readers:
headers:
pending: Pending Request
Expand Down

0 comments on commit ca69945

Please sign in to comment.