From 6dfac421ccce905ccd8bbc593161dd9e034d09f4 Mon Sep 17 00:00:00 2001 From: Ben Pennell Date: Thu, 12 Oct 2023 11:39:50 -0400 Subject: [PATCH] Collection and sidebar style fixes (#6360) * On public and dashboard collection pages, add spacing between thumbnail and title of works. Adjust sizing of action bar on collection page so that the buttons don't overlap the work table a somewhat lower resolutions. * Fixes for dashboard sidebar when it is collapsed, so that the text will not stick of the sidebar area, and to center the icons * Fix positioning of disabled collection checkboxes, and ignore disabled checkboxes when selecting all batch document checkboxes --- .../javascripts/hyrax/batch_select_all.js | 2 +- .../stylesheets/hyrax/_file-listing.scss | 2 -- app/assets/stylesheets/hyrax/sidebar.scss | 23 +++++++++++++++++++ .../_show_document_list_row.html.erb | 2 +- .../collections/_list_collections.html.erb | 2 +- .../_show_document_list_row.html.erb | 2 +- .../collections/_sort_and_per_page.html.erb | 6 ++--- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/hyrax/batch_select_all.js b/app/assets/javascripts/hyrax/batch_select_all.js index de018e983e..e510aaaeb0 100644 --- a/app/assets/javascripts/hyrax/batch_select_all.js +++ b/app/assets/javascripts/hyrax/batch_select_all.js @@ -41,7 +41,7 @@ var checked = $("#check_all")[0]['checked']; // check each individual box - $("input[type='checkbox'].batch_document_selector").each(function(index, value) { + $("input[type='checkbox'].batch_document_selector:not(.disabled)").each(function(index, value) { value['checked'] = checked; }); toggleButtons(); diff --git a/app/assets/stylesheets/hyrax/_file-listing.scss b/app/assets/stylesheets/hyrax/_file-listing.scss index f67cda56b6..9dc9f0a4b9 100644 --- a/app/assets/stylesheets/hyrax/_file-listing.scss +++ b/app/assets/stylesheets/hyrax/_file-listing.scss @@ -70,8 +70,6 @@ h4 .small { .batch-info { .sort-toggle { - height: 5.1em; - button { margin-left: 10px; } diff --git a/app/assets/stylesheets/hyrax/sidebar.scss b/app/assets/stylesheets/hyrax/sidebar.scss index c1e11f4643..5962f9f85a 100644 --- a/app/assets/stylesheets/hyrax/sidebar.scss +++ b/app/assets/stylesheets/hyrax/sidebar.scss @@ -56,6 +56,29 @@ $gutter-width: $grid-gutter-width/2; } } + &:not(.maximized) { + .sidebar-action-text, + a span + span, + h5 { + display: none; + } + + .nav li { + text-align: center; + a { + padding-left: 0; + padding-right: 0; + } + .fa { + margin-right: 0; + } + } + + .nav-item { + width: $drawer-small; + } + } + .sidebar-toggle { cursor: pointer; background-color: $body-background-color; diff --git a/app/views/hyrax/collections/_show_document_list_row.html.erb b/app/views/hyrax/collections/_show_document_list_row.html.erb index ae171d6ca5..e2029cfd70 100644 --- a/app/views/hyrax/collections/_show_document_list_row.html.erb +++ b/app/views/hyrax/collections/_show_document_list_row.html.erb @@ -7,7 +7,7 @@
- <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %> + <%= link_to [main_app, document], "class" => "media-left mr-3", "aria-hidden" => "true" do %> <%= document_presenter(document)&.thumbnail&.thumbnail_tag( { class: "d-none d-md-block file_listing_thumbnail", alt: "#{document.title_or_label} #{t('hyrax.homepage.admin_sets.thumbnail')}" }, { suppress_link: true } diff --git a/app/views/hyrax/dashboard/collections/_list_collections.html.erb b/app/views/hyrax/dashboard/collections/_list_collections.html.erb index 4d3e4371a1..8f0a87a9b1 100644 --- a/app/views/hyrax/dashboard/collections/_list_collections.html.erb +++ b/app/views/hyrax/dashboard/collections/_list_collections.html.erb @@ -12,7 +12,7 @@ <% else %> - + <% end %> diff --git a/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb b/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb index 89a94c29a0..540225dd41 100644 --- a/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +++ b/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb @@ -7,7 +7,7 @@
- <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %> + <%= link_to [main_app, document], "class" => "media-left mr-3", "aria-hidden" => "true" do %> <%= document_presenter(document)&.thumbnail&.thumbnail_tag( { class: "d-none d-md-block file_listing_thumbnail", alt: document.title_or_label }, { suppress_link: true } ) %> diff --git a/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb b/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb index 291c1db88c..95912c1e59 100644 --- a/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +++ b/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb @@ -11,8 +11,8 @@ <% if show_sort_and_per_page? && collection_member_sort_fields.many? %>
<%= form_tag dashboard_collection_path(collection), method: :get, class: 'per_page' do %> -
-
+
+
<%= t('hyrax.sort_label') %> <%= label_tag(:sort, t(".sort_by")) %> <%= select_tag(:sort, options_from_collection_for_select(collection_member_sort_fields, 'first', lambda {|field| field.last.label}, h(params[:sort]))) %> @@ -22,7 +22,7 @@ <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:per_page, :sort)) %>
-
+
<%= render 'hyrax/collections/view_type_group' %>