summaryrefslogtreecommitdiff
path: root/app/views/shared/_show_edit_destroy_part.html.haml
blob: e82c667fd18485c0fdbe991aa13675e5de8e1b53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%p
  - if !(defined? parent).nil? && !(defined? child).nil?
    - if can? :edit, 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
      %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
      %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
      %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")