summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/views/tenants/_admin_area.de.html.haml19
-rw-r--r--app/views/tenants/_admin_area.html.haml21
-rw-r--r--app/views/user_groups/_index_core.html.haml46
-rw-r--r--app/views/users/_listing.html.haml6
-rw-r--r--app/views/users/_user_groups.html.haml1
5 files changed, 61 insertions, 32 deletions
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
index beab94e..0ef9da3 100644
--- a/app/views/tenants/_admin_area.de.html.haml
+++ b/app/views/tenants/_admin_area.de.html.haml
@@ -30,11 +30,24 @@
%h2 Admin Bereich
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
+%h2= t("users.index.page_title")
+- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
+ = render "users/index_core", :users => @tenant.users
+ = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User}
+- else
+ %p
+ = link_to "Liste aller User.", tenant_users_path(@tenant)
+
+- if @tenant.user_groups.any?
+ %h2= t("user_groups.index.page_title")
+ = render "user_groups/index_core", :user_groups => @tenant.user_groups
+ = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup}
+
%h2 Features
= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
-%h2 Gemeinschaft Konfiguration
-= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant}
-
%h2=t("phone_books.index.page_title")
= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant}
+
+%h2 Gemeinschaft Konfiguration
+= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file
diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml
index 65810e7..7b47587 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -29,11 +29,24 @@
%h2 Admin Area
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
+%h2= t("users.index.page_title")
+- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
+ = render "users/index_core", :users => @tenant.users
+ = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User}
+- else
+ %p
+ = link_to "Liste aller User.", tenant_users_path(@tenant)
+
+- if @tenant.user_groups.any?
+ %h2= t("user_groups.index.page_title")
+ = render "user_groups/index_core", :user_groups => @tenant.user_groups
+ = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup}
+
%h2 Features
= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
-%h2 Gemeinschaft Configuration
-= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant}
-
%h2=t("phone_books.index.page_title")
-= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} \ No newline at end of file
+= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant}
+
+%h2 Gemeinschaft Configuration
+= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file
diff --git a/app/views/user_groups/_index_core.html.haml b/app/views/user_groups/_index_core.html.haml
index d2b6e88..481a507 100644
--- a/app/views/user_groups/_index_core.html.haml
+++ b/app/views/user_groups/_index_core.html.haml
@@ -1,24 +1,28 @@
-%table
- %tr
- %th= t('user_groups.index.name')
- %th= t('user_groups.index.description')
- - if @user
- %th= t('user_groups.index.tenant_id')
- - else
- %th= t('user_groups.index.members')
-
- - reset_cycle
- - for user_group in user_groups
- %tr{:class => cycle('odd', 'even')}
- %td= user_group.name
- %td= user_group.description
+- cache(['user_groups_table', I18n.locale, current_user, @user, user_groups, User.order(:updated_at).last, User.count, UserGroupMembership.count, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do
+ %table
+ %tr
+ %th= t('user_groups.index.name')
+ - if user_groups.pluck(:description).uniq != [nil]
+ %th= t('user_groups.index.description')
- if @user
- %td= user_group.tenant
+ %th= t('user_groups.index.tenant_id')
- else
- %td
- =render 'users/listing', :users => user_group.users
- - if user_group.users.count > 1
- %br
- = render :partial => 'shared/create_link', :locals => {:parent => user_group, :child_class => UserGroupMembership}
+ %th= t('user_groups.index.members')
+
+ - reset_cycle
+ - for user_group in user_groups
+ %tr{:class => cycle('odd', 'even')}
+ %td= user_group.name
+ - if user_groups.pluck(:description).uniq != [nil]
+ %td= user_group.description
+ - if @user
+ %td= user_group.tenant
+ - else
+ %td
+ =render 'users/listing', :users => user_group.users
+ - if user_group.users.any?
+ %br
+ - if (user_group.tenant.user_ids - user_group.user_ids).any?
+ = render :partial => 'shared/create_link', :locals => {:parent => user_group, :child_class => UserGroupMembership}
- =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user_group.tenant, :child => user_group}
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user_group.tenant, :child => user_group}
diff --git a/app/views/users/_listing.html.haml b/app/views/users/_listing.html.haml
index 0a97ad1..9b7b653 100644
--- a/app/views/users/_listing.html.haml
+++ b/app/views/users/_listing.html.haml
@@ -1,8 +1,8 @@
- amount_of_users = users.count
- if amount_of_users > 0
- - if amount_of_users < 30
+ - if amount_of_users < GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
= users.map{|user| user}.join(', ')
- else
- = users.limit(15).map{|user| user}.join(', ') + ', '
+ = users.limit((GsParameter.get('NUMBER_OF_SHOWN_ITEMS') / 2).floor).map{|user| user}.join(', ') + ', '
= '[...]'
- = users.offset(amount_of_users - 15).map{|user| user}.join(', ') \ No newline at end of file
+ = users.offset(amount_of_users - (GsParameter.get('NUMBER_OF_SHOWN_ITEMS') / 2).floor).map{|user| user}.join(', ') \ No newline at end of file
diff --git a/app/views/users/_user_groups.html.haml b/app/views/users/_user_groups.html.haml
index 7e206b6..81191ae 100644
--- a/app/views/users/_user_groups.html.haml
+++ b/app/views/users/_user_groups.html.haml
@@ -5,4 +5,3 @@
%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