diff options
author | spag <spag@golwen.net> | 2013-01-16 23:09:38 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-16 23:09:38 +0100 |
commit | e398d40c7ae15af9c840d0cda901303db8f22c39 (patch) | |
tree | 7319eb2cc22339e4efee4caf5fd67bcaababf6bf /app/views | |
parent | 8fd56dfe3d2bca6ccd9353031947ae4a8dca4528 (diff) | |
parent | c2f63b8bf288903a68c562cdf9353e6840a7cb61 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/tenants/_admin_area.de.html.haml | 19 | ||||
-rw-r--r-- | app/views/tenants/_admin_area.html.haml | 21 | ||||
-rw-r--r-- | app/views/user_groups/_index_core.html.haml | 46 | ||||
-rw-r--r-- | app/views/users/_listing.html.haml | 6 | ||||
-rw-r--r-- | app/views/users/_user_groups.html.haml | 1 |
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 |