actions menu for harvests

This commit is contained in:
Brenda Wallace
2019-06-09 15:53:01 +12:00
parent b617468e26
commit 0d02f5758b
3 changed files with 11 additions and 10 deletions

View File

@@ -53,8 +53,8 @@ module ButtonsHelper
edit_button(edit_seed_path(seed), classes: classes)
end
def harvest_edit_button(harvest)
edit_button(edit_harvest_path(harvest))
def harvest_edit_button(harvest, classes: "btn btn-raised btn-info")
edit_button(edit_harvest_path(harvest), classes: classes)
end
def garden_edit_button(garden, classes: "btn btn-raised btn-info")

View File

@@ -1,5 +1,8 @@
.harvest-actions
.btn-group
= harvest_edit_button(harvest) if can? :edit, harvest
= add_photo_button(harvest)
= delete_button(harvest)
- if can?(:edit, harvest)
.dropdown.float-right.harvest-actions
%a#harvest-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"} Actions
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "harvest-actions-button"}
= harvest_edit_button(harvest, classes: 'dropdown-item')
= add_photo_button(harvest, classes: 'dropdown-item')
.dropdown-divider
= delete_button(harvest, classes: 'dropdown-item text-danger')

View File

@@ -8,14 +8,12 @@
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
-content_for(:buttonbar) do
= render 'harvests/actions', harvest: @harvest
.row
.col-md-8
%h1
= harvest_icon
#{@harvest.crop} harvested by #{@harvest.owner}
= render 'harvests/actions', harvest: @harvest
%p
%b Owner:
= link_to @harvest.owner, @harvest.owner