diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index bdeb64d0d..338a2dbc5 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -94,21 +94,6 @@ p.stats dd margin-left: auto -@media (min-width: $screen-md-min) - .planting-thumbnail - dl.planting-attributes - width: 100% - - dt - text-align: left - width: 120px - dd - padding-left: 120px - margin-left: auto - - .navbar .navbar-form - width: 250px - #placesmap, #cropmap height: 500px @@ -254,24 +239,6 @@ html, body a font-weight: 800 -// Overrides applying only to mobile view. This must be at the end of the overrides file. - -@media only screen and (max-width: 767px) - .sidebar - margin-left: 0 - border-left: none - padding-left: 0 - - #map - height: 300px - - .navbar .nav > li - display: block - - .navbar .navbar-form - width: 185px - padding-left: 0 - padding-right: 0 /* override "info" alert boxes to be green, not blue, on Growstuff */ $state-info-text: darken($green, 10%) @@ -326,3 +293,44 @@ ul.thumbnail-buttons .hover-wrapper:hover .text visibility: visible + +.homepage-listing + padding-bottom: 6px + +@media (min-width: $screen-md-min) + .planting-thumbnail + dl.planting-attributes + width: 100% + + dt + text-align: left + width: 120px + dd + padding-left: 120px + margin-left: auto + + .navbar .navbar-form + width: 250px + +// Overrides applying only to mobile view. This must be at the end of the overrides file. +@media only screen and (max-width: 767px) + .sidebar + margin-left: 0 + border-left: none + padding-left: 0 + + #map + height: 300px + + .navbar .nav > li + display: block + + .navbar .navbar-form + width: 185px + padding-left: 0 + padding-right: 0 + .homepage + .thumbnail + height: 180px + .seed-thumbnail + height: 220px diff --git a/app/views/home/_crops.html.haml b/app/views/home/_crops.html.haml index edec779e0..bfcbc9a71 100644 --- a/app/views/home/_crops.html.haml +++ b/app/views/home/_crops.html.haml @@ -1,5 +1,5 @@ - cache cache_key_for(Crop, 'interesting'), expires_in: 1.day do .row %h2= t('.our_crops') - - Crop.interesting.includes(:scientific_names, :photos).limit(7).each do |c| - .col-md-4.col-xs-4= render 'crops/thumbnail', crop: c + - Crop.interesting.includes(:scientific_names, :photos).limit(8).each do |c| + .col-md-4.col-sm-3.col-xs-6= render 'crops/thumbnail', crop: c diff --git a/app/views/home/_plantings.html.haml b/app/views/home/_plantings.html.haml index bfaa4a422..595ad4586 100644 --- a/app/views/home/_plantings.html.haml +++ b/app/views/home/_plantings.html.haml @@ -1,3 +1,3 @@ - cache cache_key_for(Planting, 'home'), expires_in: 1.day do %h2= t('.recently_planted') - = render 'plantings/list', plantings: Planting.includes(:crop, garden: :owner).has_photos.recent.first(5) + = render 'plantings/list', plantings: Planting.includes(:crop, garden: :owner).has_photos.recent.limit(5) diff --git a/app/views/home/_seeds.html.haml b/app/views/home/_seeds.html.haml index 3f018994a..d53759738 100644 --- a/app/views/home/_seeds.html.haml +++ b/app/views/home/_seeds.html.haml @@ -2,8 +2,8 @@ %h2= t('.title') .row - Seed.current.tradable.order(created_at: :desc).limit(6).each do |seed| - .col-md-2.col-xs-4 - .thumbnail + .col-md-2.col-sm-2.col-xs-6 + .thumbnail.seed-thumbnail - cache cache_key_for(Crop, seed.id) do = link_to image_tag(seed_image_path(seed), alt: seed.crop.name, class: 'img'), @@ -13,9 +13,10 @@ .trade-to %p= seed.owner.location %p - Will trade to: - %br/ - #{seed.tradable_to} + %small + Will trade to: + %br/ + %em= seed.tradable_to %p.text-right -= link_to "#{t('.view_all')} »", seeds_path + = link_to "#{t('.view_all')} »", seeds_path diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 80502c3f5..c28a8985b 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,9 +1,9 @@ -.row +.homepage.row .col-md-12 - if member_signed_in? %h1= t('.welcome', site_name: ENV['GROWSTUFF_SITE_NAME'], member_name: current_member) - = render partial: 'stats' + = render 'stats' %p .btn-group = link_to t('.plant'), new_planting_path, class: 'btn btn-default' @@ -14,17 +14,17 @@ - else .hidden-xs .jumbotron - = render partial: 'blurb' + = render 'blurb' .visible-xs - = render partial: 'blurb' + = render 'blurb' .row - .col-md-6 - = render partial: 'crops' - .col-md-3 - = render partial: 'plantings' - .col-md-3 - = render partial: 'harvests' + .col-md-6.col-sm-12 + = render 'crops' + .col-md-3.col-sm-6 + = render 'plantings' + .col-md-3.col-sm-6 + = render 'harvests' .col-md-12 - cache cache_key_for(Crop, 'recent') do %p{ style: 'margin-top: 11.25px' } @@ -36,8 +36,8 @@ = link_to "#{t('home.crops.view_all')} »", crops_path .row .col-md-12 - = render partial: 'seeds' - = render partial: 'members' + = render 'seeds' + = render 'members' .row .col-md-12 - = render partial: 'discuss' + = render 'discuss' diff --git a/app/views/plantings/_list.html.haml b/app/views/plantings/_list.html.haml index 02901cdcd..aa7dcf9fa 100644 --- a/app/views/plantings/_list.html.haml +++ b/app/views/plantings/_list.html.haml @@ -1,8 +1,8 @@ - plantings.each do |p| - cache p do .row - .col-md-3.col-xs-4{ style: 'padding-bottom: 6px' } - = render partial: 'plantings/image_with_popover', locals: { planting: p } + .col-md-3.col-xs-4.homepage-listing + = render 'plantings/image_with_popover', planting: p .col-md-9.col-xs-4 = link_to p.crop, p.crop in