From 3c392d43eeb8ae4cf3f7c0d370d9823c748e96ec Mon Sep 17 00:00:00 2001 From: Brenda Date: Sat, 29 Feb 2020 19:49:49 +1300 Subject: [PATCH] Crop#show with seeds modal --- app/views/crops/_actions.html.haml | 14 ++++---------- app/views/seeds/_modal.html.haml | 3 ++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/views/crops/_actions.html.haml b/app/views/crops/_actions.html.haml index 4298ddbc9..9e99f4373 100644 --- a/app/views/crops/_actions.html.haml +++ b/app/views/crops/_actions.html.haml @@ -1,11 +1,5 @@ - if crop.approved? && signed_in? - %ul.nav.crop-actions - %li.nav-item= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member) - %li.nav-item= render 'harvests/modal', harvest: Harvest.new(crop: @crop) - %li.nav-item.dropdown - %a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", role: "button", href: '#'}=t('buttons.save_seeds', crop_name: crop.name) - .dropdown-menu.dropdown-secondary - - Seed::TRADABLE_TO_VALUES.each do |trade| - = link_to seeds_path(seed: {crop_id: crop.id, tradable_to: trade}), method: :post, class: 'dropdown-item' do - Will trade: #{trade} - + .btn-toolbar{"aria-label" => "Toolbar with button groups", :role => "toolbar"} + = render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member) + = render 'harvests/modal', harvest: Harvest.new(crop: @crop, owner: current_member) + = render 'seeds/modal', seed: Seed.new(crop: @crop, owner: current_member) diff --git a/app/views/seeds/_modal.html.haml b/app/views/seeds/_modal.html.haml index 3ad53267f..fd216dfaa 100644 --- a/app/views/seeds/_modal.html.haml +++ b/app/views/seeds/_modal.html.haml @@ -9,7 +9,8 @@ %span{"aria-hidden" => "true"} × .modal-body - = image_tag crop_image_path(seed.crop), class: 'img-card' + %h4 You are adding seeds to your stash + %h5 Will you offer these seeds for trade? %hr/