From f380f222a980edbd24e6ace89bd18b2cd5298e2b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 28 May 2017 18:51:01 +1200 Subject: [PATCH] Move edit link to top of card --- app/views/plantings/_card.html.haml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/plantings/_card.html.haml b/app/views/plantings/_card.html.haml index 528950b91..94f2c7d9b 100644 --- a/app/views/plantings/_card.html.haml +++ b/app/views/plantings/_card.html.haml @@ -1,6 +1,10 @@ .panel.panel-success.planting-thumbnail .panel-heading - %h3.panel-title= link_to planting.crop.name, planting_path(planting) + %h3.panel-title + = link_to planting.crop.name, planting_path(planting) + - if can? :edit, planting + %a.pull-right{ href: edit_planting_path(planting), role: "button", id: "edit_garden_glyphicon" } + %span.glyphicon.glyphicon-pencil{ title: "Edit" } .panel-body .row .col-xs-12.col-md-5 @@ -39,11 +43,6 @@ = link_to 'Details', planting_path(planting), class: 'btn btn-default btn-xs' - - if can? :edit, planting - = link_to edit_planting_path(planting), - class: 'btn btn-default btn-xs' do - %span.glyphicon.glyphicon-pencil{ title: "Edit" } - - if can?(:edit, planting) && can?(:create, Harvest) = link_to 'Harvest', new_planting_harvest_path(planting), class: 'btn btn-default btn-xs'