Skip to content

Commit

Permalink
WIP re-class prev/next widget buttons for legibility in searchPag
Browse files Browse the repository at this point in the history
  • Loading branch information
barmintor committed Apr 4, 2024
1 parent 538f142 commit b2cf24e
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 24 deletions.
4 changes: 0 additions & 4 deletions app/assets/stylesheets/stylesheets/_base_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1157,10 +1157,6 @@ h2[itemprop="name"] {
padding-bottom: 1em;
margin-bottom: 0 !important;
border-bottom: 0 !important;
a.previous, a.next {
@extend .btn;
@extend .btn-outline-secondary;
}
}

#child-viewer {
Expand Down
2 changes: 1 addition & 1 deletion app/components/dcv/search_bar/catalog_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_tag @url, method: :get, class: ['d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<%= form_tag @url, method: :get, class: ['bg-light','d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<%= render_hash_as_hidden_fields(@params.except(:q, :search_field, :qt, :page, :utf8, :format)) %>

<div class="input-group flex-sm-row flex-md-fill">
Expand Down
4 changes: 2 additions & 2 deletions app/components/dcv/search_bar/default_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_tag @url, method: :get, class: ['d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<%= form_tag @url, method: :get, class: ['bg-light','d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<%= render_hash_as_hidden_fields(@params.except(:q, :search_field, :qt, :page, :utf8, :format, :slug, :site_slug)) %>
<%= render_hash_as_hidden_fields(search_action_params) %>
<div class="input-group flex-sm-row flex-md-fill">
Expand All @@ -22,7 +22,7 @@
<label for="q" class="sr-only"><%= t('blacklight.search.form.q') %></label>
<%= text_field_tag :q, params[:q], :placeholder => search_placeholder_text, :class => "search_q q flex-fill", :id => "q" %>
<div class="input-group-append">
<%= link_to '<i class="fa fa-remove"></i>'.html_safe, start_over_path, :title => 'Start Over', :class => 'btn btn-outline-secondary reset-btn' if query_has_constraints? %>
<%= link_to '<i class="fa fa-remove"></i>'.html_safe, start_over_path, :title => 'Start Over', :class => 'btn btn-outline-info reset-btn' if query_has_constraints? %>
<button class="btn btn-primary search-btn" type="submit" aria-label="Submit">
<span class="hidden-xs"><%= (current_page?(root_url)? t('blacklight.search.form.submit') : '') %></span>
<span class="fa fa-search"></span>
Expand Down
2 changes: 1 addition & 1 deletion app/components/dcv/search_bar/durst_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_tag @url, method: :get, class: ['d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<%= form_tag @url, method: :get, class: ['bg-light','d-flex','flex-md-row-reverse','flex-sm-column','w-100'] do %>
<% params_for_new_search = @params.except(:q, :search_field, :qt, :page, :utf8, :format)
params_for_new_search[:f] = params_for_new_search[:f].except(:lib_format_sim) if params_for_new_search.has_key?(:f)
%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_tag @url, :method => :get, :class => ['clearfix', 'flex-fill'] do %>
<%= form_tag @url, :method => :get, :class => ['bg-light', 'clearfix', 'flex-fill'] do %>
<%= render_hash_as_hidden_fields(@params.except(:q, :search_field, :repository_id, :qt, :page, :utf8, :format).tap { |p| p[:'f[content_availability][]'] = @content_availability if @content_availability }) %>

<div class="input-group flex-fill">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div class="input-group-prepend">
<button class="btn btn-info" type="button" data-toggle="collapse" data-target=".collapseSearch" aria-expanded="true" aria-controls="collapsePrevNext" aria-pressed="true"><i class="previous fa fa-exchange-alt" title="Navigate search results" data-toggle="tooltip" data-original-title="Navigate search results"></i></button>
<button class="btn btn-outline-info" type="button" data-toggle="collapse" data-target=".collapseSearch" aria-expanded="true" aria-controls="collapsePrevNext" aria-pressed="true"><i class="previous fa fa-exchange-alt" title="Navigate search results" data-toggle="tooltip" data-original-title="Navigate search results"></i></button>
</div>
<div class="p-0 collapse show input-group-prepend collapseSearch" id="collapsePrevNext">
<% if params[:return_to_filesystem].present? %>
<%= link_to('<i class="fa fa-reply-all"></i>'.html_safe, params[:return_to_filesystem], class: 'btn btn-outline-secondary rounded-0', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_filesystem'), title: t('views.pagination.return_to_filesystem')) %>
<%= link_to('<i class="fa fa-reply-all"></i>'.html_safe, params[:return_to_filesystem], class: 'btn btn-outline-info rounded-0', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_filesystem'), title: t('views.pagination.return_to_filesystem')) %>
<% else %>
<%= helpers.link_back_to_catalog(label: '<i class="fa fa-reply-all"></i> '.html_safe, class: 'btn btn-outline-secondary rounded-0', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_search'), title: t('views.pagination.return_to_search') ) %>
<%= helpers.link_back_to_catalog(label: '<i class="fa fa-reply-all"></i> '.html_safe, class: 'btn btn-outline-info rounded-0', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_search'), title: t('views.pagination.return_to_search') ) %>
<% if @search_context[:prev] || @search_context[:next] %>
<span class="btn btn-outline-secondary rounded-0" style="pointer-events:none;"><%= item_page_entry_info %></span>
<%= link_to_previous_document @search_context[:prev], "btn btn-outline-secondary btn-sm rounded-0" %>
<%= link_to_next_document @search_context[:next], "btn btn-outline-secondary btn-sm rounded-0" %>
<span class="btn btn-outline-info rounded-0" style="pointer-events:none;"><%= item_page_entry_info %></span>
<%= link_to_previous_document @search_context[:prev], "btn btn-outline-info rounded-0" %>
<%= link_to_next_document @search_context[:next], "btn btn-outline-info rounded-0" %>
<% end %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_first_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<% tag_class = "page-link btn btn-outline-secondary rounded-0 #{'disabled' if current_page.first?}" -%>
<% tag_class = "page-link btn btn-outline-info rounded-0 #{'disabled' if current_page.first?}" -%>
<%= link_to '<i class="fa fa-fast-backward"></i>'.html_safe, url, :remote => remote, :"data-toggle" => 'tooltip', "aria-label": raw(t 'views.pagination.first'), title: raw(t 'views.pagination.first'), class: tag_class %>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_gap.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<%= link_to raw(t 'views.pagination.truncate'), "", class: 'page-link btn btn-secondary disabled rounded-0' %>
<%= link_to raw(t 'views.pagination.truncate'), "", class: 'page-link btn btn-info disabled rounded-0' %>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_last_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<% tag_class = "page-link btn btn-outline-secondary rounded-0 #{'disabled' if current_page.last?}" -%>
<% tag_class = "page-link btn btn-outline-info rounded-0 #{'disabled' if current_page.last?}" -%>
<%= link_to, '<i class="fa fa-fast-forward"></i>'.html_safe, url, remote: remote, "aria-label": raw(t 'views.pagination.last'), title: raw(t 'views.pagination.last'), class: tag_class %>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_next_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<% tag_class = "btn btn-outline-secondary rounded-0 #{'disabled' if current_page.last?}" -%>
<% tag_class = "btn btn-outline-info rounded-0 #{'disabled' if current_page.last?}" -%>
<%= link_to '<i class="fa fa-arrow-right"></i>'.html_safe, url, rel: 'next', remote: remote, :"data-toggle" => 'tooltip', "aria-label": raw(t 'views.pagination.next'), title: raw(t 'views.pagination.next'), class: tag_class %>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<% tag_class = "page-item btn btn-outline-secondary rounded-0#{' active' if page.current? }" -%>
<% tag_class = "page-item btn btn-outline-info rounded-0#{' active' if page.current? }" -%>
<%= link_to number_with_delimiter(page.to_s), url, {class: tag_class, remote: remote, rel: (page.next? ? 'next' : page.prev? ? 'prev' : nil)} %>
6 changes: 3 additions & 3 deletions app/views/kaminari/dcv_collapsible/_paginator.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
As of Kaminari 0.15, this paginator doesn't have access to the original collection/scope, so it can't render the page entries info directly.
-%>
<div class="input-group-prepend">
<button class="btn btn-info btn-left" type="button" data-toggle="collapse" data-target=".collapseSearch" aria-expanded="false" aria-controls="collapseQuery" aria-pressed="false">
<button class="btn btn-secondary btn-left" type="button" data-toggle="collapse" data-target=".collapseSearch" aria-expanded="false" aria-controls="collapseQuery" aria-pressed="false">
<i class="previous fa fa-exchange-alt toggle-unpressed" title="Navigate search results" data-toggle="tooltip" data-original-title="Navigate search results"></i>
<i class="previous fa fa-search toggle-pressed" title="Start a quick search" data-toggle="tooltip" data-original-title="Start a quick search"></i>
</button>
Expand All @@ -26,11 +26,11 @@
in here .. -%>
<%= paginator.render do -%>
<%= first_page_tag %>
<span class="btn btn-outline-secondary rounded-0" style="pointer-events:none;"><%= page_entries_info %></span>
<span class="btn btn-outline-info rounded-0" style="pointer-events:none;"><%= page_entries_info %></span>
<%= prev_page_tag %>
<%= next_page_tag %>
<% end -%>
<% else -%>
<span class="btn btn-outline-secondary rounded-0" style="pointer-events:none;"><%= page_entries_info %></span>
<span class="btn btn-outline-info rounded-0" style="pointer-events:none;"><%= page_entries_info %></span>
<% end -%>
</div>
2 changes: 1 addition & 1 deletion app/views/kaminari/dcv_collapsible/_prev_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<% tag_class="btn btn-outline-secondary rounded-0 #{'disabled' if current_page.first?}" -%>
<% tag_class="btn btn-outline-info rounded-0 #{'disabled' if current_page.first?}" -%>
<%= link_to '<i class="fa fa-arrow-left"></i>'.html_safe, url, :rel => 'next', :remote => remote, :"data-toggle" => 'tooltip', "aria-label": raw(t 'views.pagination.previous'), title: raw(t 'views.pagination.previous'), class: tag_class %>

0 comments on commit b2cf24e

Please sign in to comment.