summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-16 23:09:38 +0100
committerspag <spag@golwen.net>2013-01-16 23:09:38 +0100
commite398d40c7ae15af9c840d0cda901303db8f22c39 (patch)
tree7319eb2cc22339e4efee4caf5fd67bcaababf6bf
parent8fd56dfe3d2bca6ccd9353031947ae4a8dca4528 (diff)
parentc2f63b8bf288903a68c562cdf9353e6840a7cb61 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock7
-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
-rw-r--r--db/migrate/20130116213312_change_user_name_prefix.rb5
-rw-r--r--db/schema.rb2
9 files changed, 77 insertions, 33 deletions
diff --git a/Gemfile b/Gemfile
index 9f0fe8e..375743f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -68,6 +68,9 @@ gem 'breadcrumbs_on_rails'
# UUID Generator https://github.com/assaf/uuid
gem 'uuid'
+# Application server
+gem 'unicorn'
+
# Local Variables:
# mode: ruby
# End:
diff --git a/Gemfile.lock b/Gemfile.lock
index e4deaeb..0beeb3b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -100,6 +100,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.6)
+ kgio (2.7.4)
macaddr (1.6.1)
systemu (~> 2.5.0)
mail (2.4.4)
@@ -137,6 +138,7 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
+ raindrops (0.10.0)
rake (10.0.3)
rdoc (3.12)
json (~> 1.4)
@@ -170,6 +172,10 @@ GEM
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
+ unicorn (4.5.0)
+ kgio (~> 2.6)
+ rack
+ raindrops (~> 0.7)
uuid (2.3.6)
macaddr (~> 1.0)
will_paginate (3.0.4)
@@ -209,5 +215,6 @@ DEPENDENCIES
state_machine
strong_parameters
uglifier (>= 1.3.0)
+ unicorn
uuid
will_paginate
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
diff --git a/db/migrate/20130116213312_change_user_name_prefix.rb b/db/migrate/20130116213312_change_user_name_prefix.rb
new file mode 100644
index 0000000..1e6aa59
--- /dev/null
+++ b/db/migrate/20130116213312_change_user_name_prefix.rb
@@ -0,0 +1,5 @@
+class ChangeUserNamePrefix < ActiveRecord::Migration
+ def up
+ GsParameter.where(:name => 'USER_NAME_PREFIX').first.update_attributes(:value => "xyz")
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index bc4f737..8416305 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130116145500) do
+ActiveRecord::Schema.define(:version => 20130116213312) do
create_table "access_authorizations", :force => true do |t|
t.string "access_authorizationable_type"