summaryrefslogtreecommitdiff
path: root/app/views/users/_user_groups.html.haml
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 19:05:01 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 19:05:01 +0100
commit8cea5d1c88e2e13ed99a5c54a1e1b69a5d6a2d01 (patch)
tree2973251a90ec498472a597a1e3f12c77268b7dad /app/views/users/_user_groups.html.haml
parentbdad29d001523a2ba4f515e6202babaa61739fc9 (diff)
Refactoring users#view and added caching.
Diffstat (limited to 'app/views/users/_user_groups.html.haml')
-rw-r--r--app/views/users/_user_groups.html.haml8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/views/users/_user_groups.html.haml b/app/views/users/_user_groups.html.haml
new file mode 100644
index 0000000..7e206b6
--- /dev/null
+++ b/app/views/users/_user_groups.html.haml
@@ -0,0 +1,8 @@
+-# User groups (only if the current user can edit or destroy them)
+-#
+- if user.user_groups.map{ |x| can?( :edit, x ) || can?( :destroy, x ) }.include?(true)
+ - if can?( :index, UserGroup )
+ %h2=t("user_groups.index.page_title")
+ - if user.user_groups.count > 0
+ = render "user_groups/index_core", :user_groups => user.user_groups.where(:tenant_id => tenant.id).order(:name)
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => UserGroup} \ No newline at end of file