Skip to content

Commit

Permalink
UI improvements (#2390)
Browse files Browse the repository at this point in the history
* Move oers partials from pals repo

* Handle based near label for collections

* Fix branding

Indicators default to true... not loading them prevented branding.

* Add "Other" to discipline options

* Fix discipline spec

Added "Other"

* More collection styling updates

* Fix recent document list on homepage

* Adjust metadata spacing
  • Loading branch information
laritakr authored Nov 27, 2024
1 parent d427e24 commit f76a5d5
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 77 deletions.
20 changes: 17 additions & 3 deletions app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,31 @@
margin-top: 10px;
}

.hyc-bl-results {
margin: 2em 0 2em;
}

.hyrax-collections-show {
.document-metadata {
dd {
word-break: break-all;
}
}

table.table-striped {
th {
&:not(:nth-child(1)):not(:nth-child(2)) {
text-align: center;
}
border-top: none;
}
}
}

#hyc-collection-metadata-total_items,
#hyc-collection-metadata-creator {
align-items: baseline;
dd {
/* margin-bottom: .5rem; */
margin-left: 0;
margin-bottom: 0;
}

// collections gallery view
Expand Down
5 changes: 0 additions & 5 deletions app/views/hyrax/collections/_collection_description.html.erb

This file was deleted.

135 changes: 67 additions & 68 deletions app/views/hyrax/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<%# add show actions buttons to collection show page %>
<%# add branding text for banner image %>
<%# remove duplicate items count originating in Hyrax view %>
<%# contribute more from pals update layout to be more visually appealing %>

<% provide :page_title, construct_page_title(@presenter.title) %>
<div class="hyc-container" itemscope itemtype="http://schema.org/CollectionPage">
Expand All @@ -24,9 +25,31 @@
</div>
</div>

<%# OVERRIDE here to add admin actions buttons to show page %>
<div class='show-actions-container'>
<% id = @presenter.id %>
<section class="collection-title-row-wrapper"
data-source="show"
data-id="<%= id %>"
data-colls-hash="<%= available_parent_collections_data(collection: @presenter) %>"
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>"
data-post-delete-url="<%= hyrax.dashboard_collection_path(id) %>">
<div class="collection-title-row-content">
<%= render 'hyrax/dashboard/collections/show_actions', presenter: @presenter %>
</div>
</section>
</div>
<%# end OVERRIDE %>

<!-- Search bar -->
<div class='row'>
<div class="col-sm-8 mt-5">
<%= render 'search_form', presenter: @presenter, url: hyrax.collection_path(@presenter.id) %>
</div>
</div>

<% unless @presenter.logo_record.blank? %>
<div class="hyc-logos">
<div class="hyc-logos mt-5">
<% @presenter.logo_record.each_with_index do |lr, i| %>

<% if lr[:linkurl].blank? %>
Expand All @@ -42,57 +65,40 @@
<% end %>

<% unless @presenter.total_viewable_items.blank? %>
<div class="hyc-bugs d-flex space-between">
<% unless @presenter.creator.blank? %>
<div class="hyc-created-by">Created by: <%= @presenter.creator.first %></div>
<% end %>

<% unless @presenter.modified_date.blank? %>
<div class="hyc-last-updated">Last Updated: <%= @presenter.modified_date %></div>
<% end %>
</div>
<div class="hyc-bugs d-flex space-between">
<% unless @presenter.creator.blank? %>
<div class="hyc-created-by">Created by: <%= @presenter.creator.first %></div>
<% end %>
<% unless @presenter.modified_date.blank? %>
<div class="hyc-last-updated">Last Updated: <%= @presenter.modified_date %></div>
<% end %>
</div>
<% end %>

</div>

</div>
</div>
<%# OVERRIDE here to add admin actions buttons to show page %>
<div class='show-actions-container'>
<% id = @presenter.id %>
<section class="collection-title-row-wrapper"
data-source="show"
data-id="<%= id %>"
data-colls-hash="<%= available_parent_collections_data(collection: @presenter) %>"
data-post-url="<%= hyrax.dashboard_create_nest_collection_within_path(id) %>"
data-post-delete-url="<%= hyrax.dashboard_collection_path(id) %>">
<div class="collection-title-row-content">
<%= render 'hyrax/dashboard/collections/show_actions', presenter: @presenter %>
</div>
</section>
</div>
<%# end OVERRIDE %>
<div class="row hyc-body">
<div class="col-md-8 hyc-description">
<%= render 'collection_description', presenter: @presenter %>

<% if @presenter.collection_type_is_nestable? && @presenter.total_parent_collections > 0 %>
<div class="hyc-blacklight hyc-bl-title">
<h2>
<%= t('.parent_collection_header') %> (<%= @presenter.total_parent_collections %>)
</h2>
</div>
<div class="hyc-blacklight hyc-bl-results">
<%= render 'show_parent_collections', presenter: @presenter %>
</div>
<% end %>

</div>
<div class="col-md-4 hyc-metadata">
<div class="row hyc-body">
<div class='col-md-3'>
<%= render 'hyrax/collections/media_display', presenter: @presenter %>
</div>
<div class="col-md-9 hyc-metadata">
<h2><%= t('hyrax.dashboard.collections.show.metadata_header') %></h2>
<%= render 'collection_description', presenter: @presenter %>
<% unless collection_search_parameters? %>
<h2><%= t('hyrax.dashboard.collections.show.metadata_header') %></h2>
<%= render 'show_descriptions' %>
<%= render 'show_descriptions' %>
<% end %>
<% if @presenter.collection_type_is_nestable? && @presenter.total_parent_collections > 0 %>
<div class="hyc-blacklight hyc-bl-title">
<h2>
<%= t('.parent_collection_header') %> (<%= @presenter.total_parent_collections %>)
</h2>
</div>
<div class="hyc-blacklight hyc-bl-results">
<%= render 'show_parent_collections', presenter: @presenter %>
</div>
<% end %>
</div>
</div>
Expand All @@ -108,40 +114,33 @@
</div>
<% end %>

<!-- Search bar -->
<div class="hyc-blacklight hyc-bl-search hyc-body row">
<div class="col-sm-8">
<%= render 'search_form', presenter: @presenter, url: hyrax.collection_path(@presenter.id) %>
</div>
</div>

<!-- Subcollections -->
<% if @presenter.collection_type_is_nestable? && @subcollection_count > 0 %>
<div class="hyc-blacklight hyc-bl-title">
<h2><%= t('.subcollection_count') %> (<%= @subcollection_count %>)</h2>
</div>
<div class="hyc-blacklight hyc-bl-results">
<%= render 'subcollection_list', collection: @subcollection_docs %>
</div>
<div class="hyc-blacklight hyc-bl-title">
<h2><%= t('.subcollection_count') %> (<%= @subcollection_count %>)</h2>
</div>
<div class="hyc-blacklight hyc-bl-results">
<%= render 'subcollection_list', collection: @subcollection_docs %>
</div>
<% end %>

<!-- Works -->
<% if @members_count > 0 %>
<div class="hyc-blacklight hyc-bl-title">
<h2><%= t('.works_in_collection') %> (<%= @members_count %>)</h2>
</div>
<div class="hyc-blacklight hyc-bl-title">
<h2><%= t('.works_in_collection') %> (<%= @members_count %>)</h2>
</div>

<div class="hyc-blacklight hyc-bl-sort">
<%= render 'sort_and_per_page', collection: @presenter %>
</div>
<div class="hyc-blacklight hyc-bl-sort">
<%= render 'sort_and_per_page', collection: @presenter %>
</div>

<div class="hyc-blacklight hyc-bl-results">
<%= render_document_index @member_docs %>
</div>
<div class="hyc-blacklight hyc-bl-results">
<%= render_document_index @member_docs %>
</div>

<div class="hyc-blacklight hyc-bl-pager">
<%= render 'paginate' %>
</div>
<div class="hyc-blacklight hyc-bl-pager">
<%= render 'paginate' %>
</div>
<% end # if @members_count > 0 %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/homepage/_recent_document.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span class="sr-only"><%= t('hyrax.homepage.recently_uploaded.document.title_label') %></span>
<h3>
<%= link_to generate_work_url(recent_document, request), data: { turbolinks: block_valkyrie_redirect? } do %>
<%= markdown("#{render_thumbnail_tag(recent_document, {width: 90}, {suppress_link: true})} #{recent_document.title_or_label}") %>
<%= render_thumbnail_tag(recent_document, {width: 90}, {suppress_link: true}) + " " + markdown(recent_document.title_or_label) %>
<% end %>
</h3>
<% if Flipflop.home_page_recent_document_show_depositor? %>
Expand Down

0 comments on commit f76a5d5

Please sign in to comment.