From 2fa4590315707fa2cc7eadca9505264d2e9a1ec0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 9 Jun 2019 14:02:05 +1200 Subject: [PATCH] gardens breadcrumbs --- app/views/gardens/index.html.haml | 10 ++++++++++ app/views/gardens/show.html.haml | 21 ++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/views/gardens/index.html.haml b/app/views/gardens/index.html.haml index 97d140a65..19d3210e6 100644 --- a/app/views/gardens/index.html.haml +++ b/app/views/gardens/index.html.haml @@ -3,8 +3,18 @@ %h1 = @owner ? "#{@owner}'s gardens" : "Everyone's gardens" + = render 'layouts/nav', model: Garden +- content_for :breadcrumbs do + - if @owner + %li.breadcrumb-item= link_to 'Gardens', gardens_path + %li.breadcrumb-item.active= link_to "#{@owner}'s gardens", gardens_path(owner: @owner) + - else + %li.breadcrumb-item.active= link_to 'Gardens', gardens_path + + + = link_to gardens_active_tickbox_path(@owner, @show_all) do = check_box_tag 'active', 'all', @show_all include in-active diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index 009c8490d..cc97c141f 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -14,6 +14,11 @@ = javascript_include_tag "charts" = javascript_include_tag "https://www.gstatic.com/charts/loader.js" + +- content_for :breadcrumbs do + %li.breadcrumb-item= link_to 'Gardens', gardens_path + %li.breadcrumb-item.active= link_to @garden.name, gardens_path(@garden) + .row .col-md-9.col-sm-12 %h2.h1 @@ -43,27 +48,25 @@ .row .col-md-12 - %section.card - .card-header - %h3 Garden timeline - .card-body= timeline garden_timeline_path(@garden), adapter: "google" + %section + %h3 Garden timeline + = timeline garden_timeline_path(@garden), adapter: "google" %section %h3.h3 Current plantings in garden - .row + .index-cards - if @current_plantings.size.positive? - @current_plantings.each do |planting| - .col-xs-12.col-3= render "plantings/card", planting: planting + = render "plantings/card", planting: planting - else .col-md-12 %p Nothing is currently planted here. %section %h3.h3 Previously planted in this garden - .row + .index-cards - if @finished_plantings.size.positive? - @finished_plantings.each do |planting| - .col-xs-6.col-md-2 - = render "plantings/thumbnail", planting: planting + = render "plantings/thumbnail", planting: planting - else %p Nothing has been planted here. .col-md-3