Added a popover for planting images too.

This commit is contained in:
Skud
2013-07-30 16:11:31 +10:00
parent ed0b48bf7d
commit 4d0f63bf74
5 changed files with 25 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
crop.default_photo ? crop.default_photo.thumbnail_url : 'placeholder_150.png', |
:alt => crop.system_name |
), |
'#', |
crop, |
:rel => "popover", |
'data-trigger' => 'hover', |
'data-title' => crop.system_name, |

View File

@@ -1,10 +1,8 @@
%p
- if crop.scientific_names.count > 0
%i
%small
%small
- if crop.scientific_names.count > 0
%i
= crop.scientific_names.first.scientific_name
%br/
%small
Planted
= pluralize(crop.plantings_count, "time")
= link_to "More detail", crop
Planted
= pluralize(crop.plantings_count, "time")

View File

@@ -17,7 +17,7 @@
- count += 1
.row
.span2{:style => 'padding-bottom: 6px'}
=link_to image_tag(p.photos.first.thumbnail_url, :alt => p.to_s), p
= render :partial => 'plantings/image_with_popover.html.haml', :locals => { :planting => p }
.span10
= link_to p.crop, p.crop
in

View File

@@ -0,0 +1,11 @@
= link_to |
image_tag( |
planting.photos.present? ? planting.photos.first.thumbnail_url : 'placeholder_150.png', |
:alt => planting.to_s |
), |
planting, |
:rel => "popover", |
'data-trigger' => 'hover', |
'data-title' => planting.to_s, |
'data-content' => "#{ render :partial => 'plantings/popover', :locals => { :planting => planting } }", |
'data-html' => true

View File

@@ -0,0 +1,7 @@
%p
%small
Quantity:
= planting.quantity ? planting.quantity : 'unknown'
%br/
Planted on:
= planting.planted_at.to_s