mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 17:24:50 -04:00
Added missing harvest actions
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
module ButtonsHelper
|
||||
def harvest_add_photo_button(harvest)
|
||||
button(new_photo_path(id: harvest.id, type: "harvest"), 'buttons.add_a_photo', 'camera')
|
||||
end
|
||||
|
||||
def harvest_edit_button(harvest)
|
||||
button(edit_harvest_path(harvest), 'buttons.edit', 'pencil')
|
||||
end
|
||||
|
||||
def garden_plant_something_button(garden)
|
||||
button(new_planting_path(garden_id: garden.id), 'buttons.plant_something_here', 'leaf')
|
||||
end
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
.harvest-actions
|
||||
- if can?(:edit, harvest) || can?(:destroy, harvest)
|
||||
.btn-group
|
||||
- if can? :edit, harvest
|
||||
= render 'shared/buttons/edit', path: edit_harvest_path(harvest)
|
||||
- if can? :destroy, harvest
|
||||
.pull-right= render 'shared/buttons/delete', path: harvest_path(harvest)
|
||||
.btn-group
|
||||
= harvest_edit_button(harvest) if can? :edit, harvest
|
||||
= harvest_add_photo_button(harvest)
|
||||
= delete_button(harvest) if can? :destroy, harvest
|
||||
|
||||
Reference in New Issue
Block a user