index seed.active into ES

This commit is contained in:
Brenda Wallace
2019-12-28 09:33:36 +13:00
parent 8ee332edd8
commit b9e9ce1439
3 changed files with 4 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ module ButtonsHelper
end
def seed_finish_button(seed, classes: 'btn btn-default')
return unless can?(:create, Planting) && seed.active?
return unless can?(:create, Planting) && seed.active
link_to seed_path(seed, seed: { finished: 1 }), method: :put, class: "#{classes} append-date" do
finished_icon + ' ' + t('buttons.mark_as_finished')

View File

@@ -24,6 +24,7 @@ module SearchSeeds
finished: finished?,
gmo: gmo,
has_photos: photos.size.positive?,
active: active,
heirloom: heirloom,
location: owner.location,
organic: organic,

View File

@@ -3,13 +3,13 @@
%a#seed-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'}
Actions
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "seed-actions-button"}
- if can?(:create, Planting) && can?(:update, seed) && seed.active?
- if can?(:create, Planting) && can?(:update, seed) && seed.active
= link_to new_planting_path(seed_id: seed), class: 'dropdown-item success-color' do
= seed_icon
Plant seeds
= seed_edit_button(seed, classes: 'dropdown-item')
= add_photo_button(seed, classes: 'dropdown-item')
- if seed.active?
- if seed.active
= seed_finish_button(seed, classes: 'dropdown-item')
.dropdown-divider
= delete_button(seed, classes: 'dropdown-item text-danger')