From 848b583d9461b047d7fded4d7cdc0e048e5bd083 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 28 Aug 2014 11:46:36 +1000 Subject: [PATCH] Tweak formatting of images with popovers (used mostly on homepage) --- app/assets/stylesheets/overrides.css.less | 5 +++++ app/views/crops/_image_with_popover.html.haml | 5 +++-- app/views/members/_image_with_popover.html.haml | 2 +- app/views/plantings/_image_with_popover.html.haml | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/overrides.css.less b/app/assets/stylesheets/overrides.css.less index 846069012..969d0750a 100644 --- a/app/assets/stylesheets/overrides.css.less +++ b/app/assets/stylesheets/overrides.css.less @@ -176,6 +176,11 @@ footer .navbar .nav { border-radius: 0; } +.crop-image, .member-image { + width: 100%; + height: 100%; +} + // Overrides applying only to mobile view. This must be at the end of the overrides file. @media only screen and (max-width: 767px) { diff --git a/app/views/crops/_image_with_popover.html.haml b/app/views/crops/_image_with_popover.html.haml index 96bcd2ec1..46e1b4ee8 100644 --- a/app/views/crops/_image_with_popover.html.haml +++ b/app/views/crops/_image_with_popover.html.haml @@ -2,11 +2,12 @@ = link_to | image_tag( | crop.default_photo ? crop.default_photo.thumbnail_url : 'placeholder_150.png', | - :alt => crop.name | + :alt => crop.name, | + :class => 'image-responsive crop-image' | ), | crop, | :rel => "popover", | 'data-trigger' => 'hover', | 'data-title' => crop.name, | 'data-content' => "#{ render :partial => 'crops/popover', :locals => { :crop => crop } }", | - 'data-html' => true + 'data-html' => true | diff --git a/app/views/members/_image_with_popover.html.haml b/app/views/members/_image_with_popover.html.haml index 4202f0f58..fb9caddfc 100644 --- a/app/views/members/_image_with_popover.html.haml +++ b/app/views/members/_image_with_popover.html.haml @@ -5,7 +5,7 @@ :size => defined?(size) ? size : 150, | :default => :identicon }), | :alt => member.login_name, | - :class => 'img-responsive' | + :class => 'img-responsive member-image' | ), | member, | :rel => "popover", | diff --git a/app/views/plantings/_image_with_popover.html.haml b/app/views/plantings/_image_with_popover.html.haml index 5eef8610e..01d39128e 100644 --- a/app/views/plantings/_image_with_popover.html.haml +++ b/app/views/plantings/_image_with_popover.html.haml @@ -2,7 +2,8 @@ = link_to | image_tag( | planting.photos.present? ? planting.photos.first.thumbnail_url : 'placeholder_150.png', | - :alt => planting.to_s | + :alt => planting.to_s, | + :class => 'image-responsive crop-image' | ), | planting, | :rel => "popover", |