Skip to content

Commit

Permalink
Collection and sidebar style fixes (#6360)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bbpennel authored Oct 12, 2023
1 parent e28d1ca commit 6dfac42
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/hyrax/batch_select_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/hyrax/_file-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ h4 .small {
.batch-info {

.sort-toggle {
height: 5.1em;

button {
margin-left: 10px;
}
Expand Down
23 changes: 23 additions & 0 deletions app/assets/stylesheets/hyrax/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</td>
<td>
<div class="media">
<%= 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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<input type="checkbox" name="batch_document_ids[]" id="batch_document_<%= id %>" value="<%= id %>" class="batch_document_selector"
data-hasaccess="<%= (can?(:edit, collection_presenter.solr_document)) %>" />
<% else %>
<input type="checkbox" class="disabled" disabled=true />
<input type="checkbox" class="disabled batch_document_selector" disabled=true />
<% end %>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</td>
<td>
<div class="media">
<%= 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 }
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<% if show_sort_and_per_page? && collection_member_sort_fields.many? %>
<div class="sort-toggle">
<%= form_tag dashboard_collection_path(collection), method: :get, class: 'per_page' do %>
<div class="form-group row form-control-lg">
<fieldset class="col-sm-9">
<div class="form-group row">
<fieldset class="col-sm-7 col-lg-8">
<legend class="sr-only"><%= t('hyrax.sort_label') %></legend>
<%= 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]))) %>
Expand All @@ -22,7 +22,7 @@
<%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:per_page, :sort)) %>
<button class="btn btn-info"><span class="fa fa-refresh"></span> <%= t('helpers.action.refresh') %></button>
</fieldset>
<div class="col-sm-3">
<div class="col-sm-5 col-lg-4">
<%= render 'hyrax/collections/view_type_group' %>
</div>
</div>
Expand Down

0 comments on commit 6dfac42

Please sign in to comment.