mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 13:38:24 -04:00
Added a popover for planting images too.
This commit is contained in:
@@ -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, |
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
11
app/views/plantings/_image_with_popover.html.haml
Normal file
11
app/views/plantings/_image_with_popover.html.haml
Normal 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
|
||||
7
app/views/plantings/_popover.html.haml
Normal file
7
app/views/plantings/_popover.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%p
|
||||
%small
|
||||
Quantity:
|
||||
= planting.quantity ? planting.quantity : 'unknown'
|
||||
%br/
|
||||
Planted on:
|
||||
= planting.planted_at.to_s
|
||||
Reference in New Issue
Block a user