From 18ed88c7e3c789366f6e5443dc4ee0bc981a4b88 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 20:18:16 +0100 Subject: Started the migration to Twitter Bootstrap. --- app/views/shared/_show_edit_destroy_part.html.haml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'app/views/shared/_show_edit_destroy_part.html.haml') diff --git a/app/views/shared/_show_edit_destroy_part.html.haml b/app/views/shared/_show_edit_destroy_part.html.haml index aff18d1..e82c667 100644 --- a/app/views/shared/_show_edit_destroy_part.html.haml +++ b/app/views/shared/_show_edit_destroy_part.html.haml @@ -1,16 +1,20 @@ %p - if !(defined? parent).nil? && !(defined? child).nil? - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.edit"), method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) + %a.btn.btn-warning{:href => method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") - if can? :destroy, child - - if can? :edit, child - | - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.destroy"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :delete + %a.btn.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") - elsif !(defined? child).nil? - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.edit"), method( :"edit_#{child.class.name.underscore}_path" ).(child) + %a.btn.btn-warning{:href => method( :"edit_#{child.class.name.underscore}_path" ).(child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") - if can? :destroy, child - - if can? :edit, child - | - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete \ No newline at end of file + %a.btn.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{child.class.name.underscore}_path" ).(child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") \ No newline at end of file -- cgit v1.2.3