mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 18:56:06 -04:00
Added Plantings modal form
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
- cache harvest do
|
||||
.card
|
||||
= link_to harvest do
|
||||
= link_to harvest_path(slug: harvest.slug) do
|
||||
= image_tag harvest.thumbnail_url ? harvest.thumbnail_url : placeholder_image, alt: harvest.crop_name, class: 'img-card'
|
||||
.card-body
|
||||
%h5
|
||||
@@ -10,4 +10,4 @@
|
||||
.float-right
|
||||
%span.chip.member-chip
|
||||
= link_to member_path(slug: harvest.owner_slug) do
|
||||
= harvest.owner_login_name
|
||||
= harvest.owner_login_name
|
||||
|
||||
23
app/views/plantings/_modal.html.haml
Normal file
23
app/views/plantings/_modal.html.haml
Normal file
@@ -0,0 +1,23 @@
|
||||
#modelPlantingForm.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "planting-button", role: "dialog", tabindex: "-1"}
|
||||
.modal-dialog{role: "document"}
|
||||
.modal-content
|
||||
.modal-header.text-center
|
||||
%h4.modal-title.w-100.font-weight-bold Record #{planting.crop.name} planting
|
||||
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", type: "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
.modal-body
|
||||
%p Which garden is the planting in?
|
||||
|
||||
%ul.list-group
|
||||
- planting.owner.gardens.order(:name).each do |garden|
|
||||
%li.list-group-item
|
||||
= link_to plantings_path(planting: {crop_id: planting.crop_id, garden_id: garden.id}), method: :post do
|
||||
.md-v-line
|
||||
.d-flex.justify-content-between
|
||||
= image_tag garden_image_path(garden), class: 'img', height: 50
|
||||
= garden.name
|
||||
|
||||
|
||||
%a.btn{"data-target" => "#modelPlantingForm", "data-toggle" => "modal", href: "", id: 'planting-button'}
|
||||
= planting_icon
|
||||
Plant #{planting.crop.name}
|
||||
Reference in New Issue
Block a user