Skip to content

Commit

Permalink
Homepage fixes (#2417)
Browse files Browse the repository at this point in the history
* Fix issues with homepage

* Neutral Repository homepage fixes

* Remove stray classes

* Adjust featured collection justification.

* Adds advanced search button where missing

* Fix institutional repository footer

* Fix responsive layout for recently uploaded

---------

Co-authored-by: LaRita Robinson <[email protected]>
  • Loading branch information
laritakr and LaRita Robinson authored Jan 21, 2025
1 parent 3a1d3ec commit 6b6539f
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 22 deletions.
6 changes: 5 additions & 1 deletion app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ body.public-facing {
width: unset;
}

.featured-collection-section {
border: 1px solid #ccc;
}

.mb-30 {
margin-bottom: 30px;
}
Expand Down Expand Up @@ -709,7 +713,7 @@ tr[data-feature="use-iiif-print"] {
#featured_collections {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
justify-content: left;
}

// slideshow heading
Expand Down
9 changes: 7 additions & 2 deletions app/assets/stylesheets/themes/neutral_repository.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

////// Basic Apperance Styles //////

.mt-4 {
margin-top: 40px;
}

.mb-40 {
margin-bottom: 40px;
}
Expand Down Expand Up @@ -109,9 +113,10 @@
border: 1px solid #ddd;
}

////// Carousel //////
////// Carousel & Featured Works //////


#featured-carousel {
.featured-works-section {
border: 1px solid #ccc;
padding: 1em;
}
Expand Down
39 changes: 39 additions & 0 deletions app/views/catalog/_search_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<% # OVERRIDE: Hyrax v5.0.1 template to include the advanced_search button %>
<%= form_tag search_form_action, method: :get, class: "search-form", id: "search-form-header", role: "search" do %>
<%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
<%= hidden_field_tag :search_field, 'all_fields' %>
<div class="form-group row">
<label class="col-sm-3 mb-0" for="search-field-header">
<%= t("hyrax.search.form.q.label", application_name: application_name) %>
</label>
<div class="input-group col-sm-9">
<%= text_field_tag :q, current_search_parameters , 'aria-label': 'Search', class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %>
<div class="input-group-append">
<button type="submit" class="btn btn-primary" id="search-submit-header">
<%= t('hyrax.search.button.html') %>
</button>
<%# OVERRIDE here to include the advanced search button in the search bar %>
<%= link_to "Advanced", "/advanced", class: 'btn btn-secondary', id: 'advanced-top-button' %>
<% if current_user %>
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<span class="sr-only" data-search-element="label"><%= t("hyrax.search.form.option.all.label_long", application_name: application_name) %></span>
<span aria-hidden="true"><%= t("hyrax.search.form.option.all.label_short") %></span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<%= link_to t("hyrax.search.form.option.all.label_long", application_name: application_name), "#", class: "dropdown-item",
data: { "search-option" => main_app.search_catalog_path, "search-label" => t("hyrax.search.form.option.all.label_short") } %>
<%= link_to t("hyrax.search.form.option.my_works.label_long"), "#", class: "dropdown-item",
data: { "search-option" => hyrax.my_works_path, "search-label" => t("hyrax.search.form.option.my_works.label_short") } %>
<%= link_to t("hyrax.search.form.option.my_collections.label_long"), "#", class: "dropdown-item",
data: { "search-option" => hyrax.my_collections_path, "search-label" => t("hyrax.search.form.option.my_collections.label_short") } %>
</div>
<% end %>
</div><!-- /.input-group-btn -->
</div><!-- /.input-group -->

</div><!-- /.form-group -->
<% end %>
1 change: 1 addition & 0 deletions app/views/hyrax/base/_privacy_policy.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%# Override Hyrax 5.0.1 - empty partial to allow override for custom privacy policy link %>
5 changes: 4 additions & 1 deletion app/views/shared/_appearance_styles.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ body.public-facing h5,
body.public-facing h6 { font-family: <%= appearance.font_headline_family %>; }

/* LINK COLORS */
body.public-facing a { color: <%= appearance.link_color %>; }
body.public-facing a,
body.public-facing .dropdown-menu a {
color: <%= appearance.link_color %>;
}
body.public-facing a:hover,
body.public-facing a:focus { color: <%= appearance.link_hover_color %>; }

Expand Down
38 changes: 26 additions & 12 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
<%# Override Hyrax 5.0.1
- add privacy policy partial
- add login & logout link
- add Hyku version
- navbar-inverse class %>
<% current_year = Time.now.year %>
<footer class="navbar navbar-dark bg-dark site-footer">
<footer class="navbar navbar-inverse navbar-dark bg-dark site-footer w-100">
<div class="container-fluid">
<div class="navbar-text d-flex justify-content-start">
<p><%= t('hyrax.footer.service_html') %></p>
<p>Hyku v<%= Hyku::VERSION %> with Hyrax v<%= Hyrax::VERSION %></p>
</div>
<div class="ml-auto">
<div class="navbar-text d-flex justify-content-end">
<p><%= t('hyrax.footer.copyright_html', current_year: current_year) %></p>
<p><%= t('hyrax.background_attribution_html') %></p>
<% unless user_signed_in? %>
<p><%= link_to t('hyku.footer.admin_login', default: [:'hyrax.toolbar.profile.login']), main_app.new_user_session_path, class: 'navbar-link' %></p>
<% end %>
<div class="navbar-text d-flex justify-content-between w-100">
<!-- Left Column -->
<div class="d-flex flex-column">
<div class='p-2'><%= t('hyrax.footer.service_html') %></div>
<div class='p-2'>Hyku v<%= Hyku::VERSION %> with Hyrax v<%= Hyrax::VERSION %></div>
</div>
<!-- Right Column -->
<div class="d-flex flex-column align-items-end flex-fill">
<div class='p-2'>
<%= t('hyrax.footer.copyright_html', current_year: current_year) %>
<%= t('hyrax.background_attribution_html') %>
</div>
<div class='p-2'>
<% if user_signed_in? %>
<%= link_to t("hyrax.toolbar.profile.logout"), main_app.destroy_user_session_path, class: 'navbar-link' %>
<% else %>
<%= link_to t('hyku.footer.admin_login', default: [:'hyrax.toolbar.profile.login']), main_app.new_user_session_path, class: 'navbar-link' %>
<% end %>
<span class='navbar-link'><%= render 'hyrax/base/privacy_policy' %></span>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p><%= t('.no_public') %></p>
<% else %>
<div id="recent_docs">
<ol class="list-group list-group-flush recent_uploads">
<ol class="row list-group list-group-flush recent_uploads">
<%= render partial: "themes/cultural_repository/hyrax/homepage/recent_document", collection: recent_documents %>
</ol>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h3>Recent Uploads</h3>
<div class="d-flex flex-wrap justify-content-between">
<%= render partial: "themes/institutional_repository/hyrax/homepage/recent_document", collection: recent_documents %>
<div>
</div>
<% end %>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/themes/neutral_repository/_theme_container.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="theme-container">
<div class="col-md-8 mb-30">
<div class="col-md-8 mb-30 pr-4">
<!-- Adding a mobile style for the homepage text content block, hidden on md and lg -->
<% if display_content_block? @home_text %>
<div class="d-block d-md-none">
Expand All @@ -15,15 +15,15 @@

<% if @presenter.display_featured_works? %>
<div class="row">
<div class="col-12">
<div class="col-12 featured-works-section">
<%= render 'themes/neutral_repository/hyrax/homepage/featured_works' %>
</div>
</div>
<% end %>

<div class="row mb-30 mt-4">
<div class="col-12 featured-collection-section">
<h3>Collections</h3>
<h2 class='mt-4'>Collections</h2>
<%= render 'featured_collection_section' %>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<% end %>
</ol>
</div>
<%= f.submit("Save order", class: 'btn btn-primary mt-3') %>
<%= f.submit("Save order", class: 'btn btn-secondary mt-3') %>
<% end %>
<% else %>
<%= render partial: 'themes/neutral_repository/featured_carousel' %>
Expand Down

0 comments on commit 6b6539f

Please sign in to comment.