From bb50385bb8a0b28f9af8bc33f85011b112192ddd Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 21 Sep 2026 08:36:19 +1200 Subject: [PATCH] Line the sidebar text up with the text in the member card The skip link, nav links, button, blurb and inactive gardens link sat at the card's edge while the card's own text is inset. Give them the same inset, left-align the blurb, and add a little space between the links. Co-Authored-By: Claude Sonnet 5 --- app/assets/stylesheets/overrides.scss | 16 ++++++++++++++++ app/views/gardens/inactive.html.haml | 4 ++-- app/views/gardens/index.html.haml | 4 ++-- app/views/layouts/_nav.haml | 27 ++++++++++++++------------- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/overrides.scss b/app/assets/stylesheets/overrides.scss index 110d5c497..18536bc43 100755 --- a/app/assets/stylesheets/overrides.scss +++ b/app/assets/stylesheets/overrides.scss @@ -534,3 +534,19 @@ ul.thumbnail-buttons { .breadcrumb-item a { color: #5f5e5c; } + +// Sidebar text (the skip link, the nav links and button, the blurb) starts where +// the text inside a card beside it starts, instead of at the card's edge. +.sidebar-inset { + padding-inline: var(--bs-card-spacer-x, 1rem); +} + +.layout-nav { + .nav-link { + padding-block: 0.25rem; + } + + .btn { + margin-top: 0.5rem; + } +} diff --git a/app/views/gardens/inactive.html.haml b/app/views/gardens/inactive.html.haml index 432abb8ff..e883aaf2f 100644 --- a/app/views/gardens/inactive.html.haml +++ b/app/views/gardens/inactive.html.haml @@ -9,13 +9,13 @@ .row .col-md-2 - %small + %small.d-block.sidebar-inset %a{href: "#content"} Skip to main content = render 'layouts/nav', model: Garden %hr/ = render @owner - .inactive-gardens-link.mt-3 + .inactive-gardens-link.sidebar-inset.mt-3 = link_to "Current gardens", member_gardens_path(@owner) .col-md-10#content diff --git a/app/views/gardens/index.html.haml b/app/views/gardens/index.html.haml index 847c3175e..cc4266aee 100644 --- a/app/views/gardens/index.html.haml +++ b/app/views/gardens/index.html.haml @@ -14,14 +14,14 @@ .row .col-md-2 - %small + %small.d-block.sidebar-inset %a{href: "#content"} Skip to main content = render 'layouts/nav', model: Garden - if @owner.present? %hr/ = render @owner - .inactive-gardens-link.mt-3 + .inactive-gardens-link.sidebar-inset.mt-3 = link_to 'Inactive gardens', member_inactive_gardens_path(@owner), class: 'd-block' %small.text-muted Gardens no longer in use. Their plantings are kept here as a record of what was grown. diff --git a/app/views/layouts/_nav.haml b/app/views/layouts/_nav.haml index d7e287d85..0343257a4 100644 --- a/app/views/layouts/_nav.haml +++ b/app/views/layouts/_nav.haml @@ -1,17 +1,18 @@ -- if current_member.present? - .flex-column.nav-pills.layout-nav{"role" => "tablist", "aria-orientation"=>"vertical"} - / %h2.card-title #{model} links - = link_to url_for([current_member, model]), class: 'nav-link tab' do - My #{model.model_name.human.pluralize} - = link_to model, class: 'nav-link tab' do - Everyone's #{model.model_name.human.pluralize} - - if can?(:create, model) - = link_to url_for([model, action: :new]), class: 'btn' do - Add a #{model.model_name.human} -- else - = render 'shared/signin_signup', to: "record your #{model.to_s.pluralize.downcase}" +.sidebar-inset + - if current_member.present? + .flex-column.nav-pills.layout-nav{"role" => "tablist", "aria-orientation"=>"vertical"} + / %h2.card-title #{model} links + = link_to url_for([current_member, model]), class: 'nav-link tab' do + My #{model.model_name.human.pluralize} + = link_to model, class: 'nav-link tab' do + Everyone's #{model.model_name.human.pluralize} + - if can?(:create, model) + = link_to url_for([model, action: :new]), class: 'btn' do + Add a #{model.model_name.human} + - else + = render 'shared/signin_signup', to: "record your #{model.to_s.pluralize.downcase}" %hr/ -%p.text-center +%p.sidebar-inset #{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're harvesting from your home garden and see how productive it is.