Skip to content

Commit

Permalink
🐛 Institutional Theme home page layout fixes
Browse files Browse the repository at this point in the history
This commit addresses layout issues on the home page of the
Institutional Theme by:
- removing the hamburger menu since it was only
holding the search bar
- centering the application name in smaller breakpoints
- setting the application name to the left next to the logo in larger
breakpoints

Ref:
- notch8/palni_palci_knapsack#142
  • Loading branch information
sjproctor committed Jan 30, 2025
1 parent a11c5c6 commit be9945b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
8 changes: 1 addition & 7 deletions app/assets/stylesheets/themes/institutional_repository.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@

////// Navbar //////

.navbar-collapse {
justify-content: space-between;
}

// styles the top nav menu application name that is centered
// styles the top nav menu application name
.institutional-repository-application-name {
text-align: center;

span {
color: #fff;
font-size: 20px;
Expand Down
4 changes: 2 additions & 2 deletions app/views/themes/institutional_repository/_controls.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% # OVERRIDE: Hyrax v5.0.0rc2 - added the admin login menu from _user_util_links partial for theming %>
<nav class="navbar navbar-light bg-light navbar-expand-sm justify-content-between align-items-center px-2 py-3 border-bottom" role="navigation" aria-label="Root Menu">
<ul class="nav navbar-nav col-sm-5">
<nav class="navbar navbar-light bg-light navbar-expand-sm justify-content-between align-items-center px-2 py-3 border-bottom flex-wrap" role="navigation" aria-label="Root Menu">
<ul class="navbar-nav col-sm-5">
<li class="nav-item <%= 'active' if current_page?(hyrax.root_path) %>">
<%= link_to t(:'hyrax.controls.home'), hyrax.root_path, class: "nav-link", aria: current_page?(hyrax.root_path) ? {current: 'page'} : nil %></li>
<li class="nav-item <%= 'active' if current_page?(hyrax.about_path) %>">
Expand Down
2 changes: 1 addition & 1 deletion app/views/themes/institutional_repository/_logo.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% # OVERRIDE: Hyrax v5.0.0rc2 - added globe back to logo %>
<% if logo_image %>
<a id="logo" class="col-sm-5" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<a id="logo" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<%= image_tag logo_image, alt: block_for(name: 'logo_image_text') %>
</a>
<% end %>
25 changes: 10 additions & 15 deletions app/views/themes/institutional_repository/_masthead.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
<% # OVERRIDE: Hyrax v5.0.0rc2 - added the search bar and removed the /login and locale nav menu and moved to the /controls partial for theming %>
<header aria-label="header" class="top-header">
<nav id="masthead" class="navbar navbar-expand-lg navbar-dark bg-dark justify-content-between institutional-repository-nav <%= placement_class %>" role="navigation" aria-label="masthead">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#top-navbar-collapse" aria-controls="top-navbar-collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="d-lg-none d-md-none"><%= render '/logo' %></div>
</div>
<div class="collapse navbar-collapse" id="top-navbar-collapse">
<div class="d-none d-lg-block d-md-block"><%= render '/logo' %></div>
<nav id="masthead" class="navbar-dark bg-dark institutional-repository-nav container-fluid py-2<%= placement_class %>" role="navigation" aria-label="masthead">
<div class="institutional-repository-application-name col-lg-2 col-md-2">
<div class="row align-items-center justify-content-end">
<div class="col-12 col-md-6 pb-2 pb-md-0">
<div class="row align-items-center justify-content-start">
<div class="ml-2"><%= render '/logo' %></div>
<div class="institutional-repository-application-name col-10 text-center text-md-left">
<span><%= application_name %></span>
</div>
<div class="navbar-right col-lg-6 col-md-5">
<%= render partial: 'catalog/search_form' %>
</div>
</div>
<div class="col-12 col-sm-10 col-md-6">
<%= render partial: 'catalog/search_form' %>
</div>
</div>
</nav>
</header>
Expand Down

0 comments on commit be9945b

Please sign in to comment.