From 8cea5d1c88e2e13ed99a5c54a1e1b69a5d6a2d01 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 19:05:01 +0100 Subject: Refactoring users#view and added caching. --- app/views/users/_user_groups.html.haml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 app/views/users/_user_groups.html.haml (limited to 'app/views/users/_user_groups.html.haml') 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 -- cgit v1.2.3