mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-25 18:22:45 -04:00
Made the plantings/_thumbnail partial to contain only a single object.
This commit is contained in:
@@ -43,19 +43,28 @@
|
||||
%p{:style => 'text-align: center; padding-top: 50px'}
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => @garden.id), :class => 'btn btn-primary'
|
||||
|
||||
|
||||
%h3
|
||||
What's planted here?
|
||||
|
||||
%h3 What's planted here?
|
||||
- if @garden.plantings.current.size > 0
|
||||
= render :partial => "plantings/thumbnail", :locals => { :plantings => @garden.plantings.current}
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th #
|
||||
%th Photo
|
||||
%th{:colspan => "3"} Planting details
|
||||
- @garden.plantings.current.each.with_index do |planting_current, index_current|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting_current, :index => index_current}
|
||||
- else
|
||||
%p
|
||||
Nothing is currently planted here.
|
||||
|
||||
%h3 Previously planted in this garden
|
||||
- if @garden.plantings.finished.size > 0
|
||||
%h3 Previously planted in this garden
|
||||
= render :partial => "plantings/thumbnail", :locals => { :plantings => @garden.plantings.finished}
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th #
|
||||
%th Photo
|
||||
%th{:colspan => "3"} Planting details
|
||||
- @garden.plantings.finished.each.with_index do |planting_finished, index_finished|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting_finished, :index => index_finished}
|
||||
|
||||
.col-md-3
|
||||
%h4 About this garden
|
||||
|
||||
@@ -34,7 +34,14 @@
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => g.id), :class => 'btn btn-primary'
|
||||
|
||||
%h3 What's planted here?
|
||||
= render :partial => "plantings/thumbnail", :locals => { :plantings => g.featured_plantings}
|
||||
- if g.featured_plantings.size > 0
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th #
|
||||
%th Photo
|
||||
%th{:colspan => "3"} Planting details
|
||||
- g.featured_plantings.each.with_index do |planting, index|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting, :index => index}
|
||||
|
||||
%p
|
||||
= link_to "More about this garden...", url_for(g)
|
||||
|
||||
@@ -1,48 +1,42 @@
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th #
|
||||
%th Photo
|
||||
%th{:colspan => "3"} Planting details
|
||||
- plantings.each.with_index do |planting, index|
|
||||
%tr
|
||||
%td= "##{index+1}"
|
||||
%td= link_to image_tag((planting.default_photo ? planting.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => planting.crop_id, :class => 'img'), planting
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li Owner:
|
||||
%li Garden:
|
||||
%li Planted on:
|
||||
%li Quantity:
|
||||
%li Finished on:
|
||||
%li Sun/shade?:
|
||||
%li Planted from:
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= link_to planting.owner.login_name, planting.owner
|
||||
%li= link_to planting.garden.name, planting.garden
|
||||
%li= planting.planted_at
|
||||
%li= "#{display_planting_quantity(planting)}"
|
||||
%li= "#{display_finished(planting)}"
|
||||
%li= "#{display_sunniness(planting)}"
|
||||
%li= "#{display_planted_from(planting)}"
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= link_to 'Details', planting, :class => 'btn btn-default btn-xs'
|
||||
- if can? :edit, planting
|
||||
%li= link_to 'Edit', edit_planting_path(planting), :class => 'btn btn-default btn-xs'
|
||||
- if ! planting.finished
|
||||
%li= link_to "Mark as finished", planting_path(planting, :planting => {:finished => 1}), :method => :put, :class => 'btn btn-default btn-xs append-date'
|
||||
- if can? :destroy, planting
|
||||
%li= link_to 'Delete', planting, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
|
||||
%tr
|
||||
%td= "##{index+1}"
|
||||
%td= link_to image_tag((planting.default_photo ? planting.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => planting.crop_id, :class => 'img'), planting
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li Owner:
|
||||
%li Garden:
|
||||
%li Planted on:
|
||||
%li Quantity:
|
||||
%li Finished on:
|
||||
%li Sun/shade?:
|
||||
%li Planted from:
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= link_to planting.owner.login_name, planting.owner
|
||||
%li= link_to planting.garden.name, planting.garden
|
||||
%li= planting.planted_at
|
||||
%li= "#{display_planting_quantity(planting)}"
|
||||
%li= "#{display_finished(planting)}"
|
||||
%li= "#{display_sunniness(planting)}"
|
||||
%li= "#{display_planted_from(planting)}"
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= link_to 'Details', planting, :class => 'btn btn-default btn-xs'
|
||||
- if can? :edit, planting
|
||||
%li= link_to 'Edit', edit_planting_path(planting), :class => 'btn btn-default btn-xs'
|
||||
- if ! planting.finished
|
||||
%li= link_to "Mark as finished", planting_path(planting, :planting => {:finished => 1}), :method => :put, :class => 'btn btn-default btn-xs append-date'
|
||||
- if can? :destroy, planting
|
||||
%li= link_to 'Delete', planting, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
|
||||
%tr
|
||||
%td
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li
|
||||
Crop name:
|
||||
=link_to planting.crop.name, planting.crop
|
||||
%li= "Days until maturity: #{display_days_before_maturity(planting)}"
|
||||
%td
|
||||
%td
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li
|
||||
Crop name:
|
||||
=link_to planting.crop.name, planting.crop
|
||||
%li= "Days until maturity: #{display_days_before_maturity(planting)}"
|
||||
|
||||
%td{:colspan => "3"}
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= render partial: 'plantings/planting_progress', locals: {:planting => planting}
|
||||
%td{:colspan => "3"}
|
||||
%ul{:style => "list-style-type:none"}
|
||||
%li= render partial: 'plantings/planting_progress', locals: {:planting => planting}
|
||||
@@ -19,7 +19,13 @@
|
||||
= will_paginate @plantings
|
||||
|
||||
- if @plantings.size > 0
|
||||
= render partial: "plantings/thumbnail", locals: {:plantings => @plantings}
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th #
|
||||
%th Photo
|
||||
%th{:colspan => "3"} Planting details
|
||||
- @plantings.each.with_index do |planting, index|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting, :index => index}
|
||||
|
||||
%div.pagination
|
||||
= page_entries_info @plantings, :model => "plantings"
|
||||
|
||||
Reference in New Issue
Block a user