summaryrefslogtreecommitdiff
path: root/app/views/shared/_index_view_edit_destroy_part.html.haml
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
commitb80bd744ad873f6fc43018bc4bfb90677de167bd (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/shared/_index_view_edit_destroy_part.html.haml
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/views/shared/_index_view_edit_destroy_part.html.haml')
-rw-r--r--app/views/shared/_index_view_edit_destroy_part.html.haml29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/views/shared/_index_view_edit_destroy_part.html.haml b/app/views/shared/_index_view_edit_destroy_part.html.haml
new file mode 100644
index 0000000..06ec904
--- /dev/null
+++ b/app/views/shared/_index_view_edit_destroy_part.html.haml
@@ -0,0 +1,29 @@
+- style = 'width:35px'
+
+- if !(defined? parent).nil? && !(defined? child).nil?
+ %td{ :style => style }
+ - if can? :show, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.show"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child)
+ %td{ :style => style }
+ - if can? :edit, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.edit"), method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child)
+ %td{ :style => style }
+ - if can? :destroy, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :delete
+ - if child.respond_to?(:move_up?) or child and child.respond_to?(:move_down?)
+ %td{ :style => style }
+ - if can? :move_down, child and child.respond_to?(:move_down?) and child.move_down?
+ = link_to '&#8681;'.html_safe, method( :"move_lower_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :put
+ - if can? :move_up, child and child.respond_to?(:move_up?) and child.move_up?
+ = link_to '&#8679;'.html_safe, method( :"move_higher_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :put
+
+- elsif !(defined? child).nil?
+ %td{ :style => style }
+ - if can? :show, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.show"), method( :"#{child.class.name.underscore}_path" ).(child)
+ %td{ :style => style }
+ - if can? :edit, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.edit"), method( :"edit_#{child.class.name.underscore}_path" ).(child)
+ %td{ :style => style }
+ - if can? :destroy, child
+ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete \ No newline at end of file