summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJulian Pawlowski <julian.pawlowski@gmail.com>2013-01-16 22:05:51 +0100
committerJulian Pawlowski <julian.pawlowski@gmail.com>2013-01-16 22:05:51 +0100
commit3fbadb4f1b1d9a16b81892356b4020dbfa455b5a (patch)
treeced8cd685a0366af3e827163943682a618094545 /app
parent0601ff60400e27451259531bb26cb69c7e6e352c (diff)
parent1bd91b138c773aedbd5f18b9df79e28fac240dbc (diff)
Merge branch 'develop' of https://github.com/amooma/GS5 into develop
Diffstat (limited to 'app')
-rw-r--r--app/views/call_routes/show.html.haml8
-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
5 files changed, 68 insertions, 32 deletions
diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml
index 31c3cb0..c5c7397 100644
--- a/app/views/call_routes/show.html.haml
+++ b/app/views/call_routes/show.html.haml
@@ -16,4 +16,10 @@
%strong= t('call_routes.show.position') + ":"
= @call_route.position
-= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } \ No newline at end of file
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route }
+
+%h3= t('route_elements.index.page_title')
+- if @call_route.route_elements && @call_route.route_elements.count > 0
+ = render "route_elements/index_core", :route_elements => @call_route.route_elements
+
+= render :partial => 'shared/create_link', :locals => { :parent => @call_route, :child_class => RouteElement }
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