summaryrefslogtreecommitdiff
path: root/app/views/tenants
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-16 09:28:55 +0100
committerspag <spag@golwen.net>2013-01-16 09:28:55 +0100
commit3880e410353f1e80a938e110c04c2b3629ab5eb6 (patch)
tree793d44cfafcc3925684309c1650b922842828a01 /app/views/tenants
parent1debae060b1c4a816f4565ad55490fee61c6472b (diff)
parent6635621faeebbc8dd744e0ad71741f9e82aed1f8 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/views/tenants')
-rw-r--r--app/views/tenants/_admin_area.de.html.haml8
-rw-r--r--app/views/tenants/_admin_area.html.haml9
-rw-r--r--app/views/tenants/_gs_parameter_table.html.haml24
-rw-r--r--app/views/tenants/_sip_accounts_and_phones.html.haml64
-rw-r--r--app/views/tenants/_table_of_functions.html.haml98
-rw-r--r--app/views/tenants/_table_of_phone_books.html.haml3
-rw-r--r--app/views/tenants/show.html.haml15
7 files changed, 126 insertions, 95 deletions
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
index d111c9d..beab94e 100644
--- a/app/views/tenants/_admin_area.de.html.haml
+++ b/app/views/tenants/_admin_area.de.html.haml
@@ -1,4 +1,4 @@
-- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do
+- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do
%p
Sie sind Mitglied der
= link_to 'Admin Gruppe', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
@@ -27,8 +27,14 @@
= succeed '.' do
=link_to manufacturer, manufacturer_path(manufacturer)
+%h2 Admin Bereich
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
+%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}
diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml
index b479995..65810e7 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -1,4 +1,4 @@
-- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do
+- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do
%p
You belong to the
= link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
@@ -26,9 +26,14 @@
= succeed '.' do
=link_to manufacturer, manufacturer_path(manufacturer)
+%h2 Admin Area
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
+%h2 Features
= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
-= render :partial => 'tenants/table_of_phone_books', :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
diff --git a/app/views/tenants/_gs_parameter_table.html.haml b/app/views/tenants/_gs_parameter_table.html.haml
new file mode 100644
index 0000000..3af06cf
--- /dev/null
+++ b/app/views/tenants/_gs_parameter_table.html.haml
@@ -0,0 +1,24 @@
+- cache(['gs_parameters_tenant_overview_table', I18n.locale, tenant, GuiFunction.count, GuiFunction.order(:updated_at).last, GsParameter.count, GsParameter.order(:updated_at).last]) do
+ %table
+ %tr{:class => 'even'}
+ %th
+ Funktion
+ %th
+ Anzahl
+ %th
+ Letztes Update
+
+ %tr{:class => 'odd'}
+ %td
+ = t("gui_functions.name")
+ %td
+ = link_to GuiFunction.count.to_s, gui_functions_path
+ %td
+ = l GuiFunction.order(:updated_at).last.updated_at, :format => :short
+ %tr{:class => 'even'}
+ %td
+ = t("gs_parameters.name")
+ %td
+ = link_to GsParameter.count.to_s, gs_parameters_path
+ %td
+ = l GsParameter.order(:updated_at).last.updated_at, :format => :short
diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml
index f9d26f9..e322b67 100644
--- a/app/views/tenants/_sip_accounts_and_phones.html.haml
+++ b/app/views/tenants/_sip_accounts_and_phones.html.haml
@@ -1,24 +1,40 @@
%table
%tr{:class => 'even'}
%th
- %th
- = tenant
- %th= t("users.index.page_title")
+ %th= t("sip_accounts.index.page_title")
+ %th= t("phones.index.page_title")
- %tr{:class => 'odd'}
- %td= t("sip_accounts.index.page_title")
- %td
- - if tenant.sip_accounts.any?
- - if tenant.sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
- = link_to tenant.sip_accounts.count.to_s, tenant_sip_accounts_path(tenant)
- - else
- - cache([I18n.locale, tenant, tenant.sip_accounts, PhoneNumber.where(:phone_numberable_type => 'SipAccount').where(:id => tenant.sip_account_ids)]) do
- - tenant.sip_accounts.each do |sip_account|
- = succeed ', ' do
- =link_to "#{sip_account.caller_name}", tenant_sip_account_path(tenant,sip_account)
- - if sip_account.phone_numbers.any?
- = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount}
+ - cache(['tenant_show_admin_area_sip_accounts_and_phones_row', I18n.locale, @tenant, @tenant.sip_accounts.count, @tenant.sip_accounts.reorder(:updated_at).last, @tenant.phones.count, @tenant.phones.reorder(:updated_at).last]) do
+
+ %tr{:class => 'odd'}
+ %td= tenant
+ - cache(['tenant_show_admin_area_sip_accounts_table_cell', I18n.locale, @tenant, @tenant.sip_accounts.count, @tenant.sip_accounts.reorder(:updated_at).last]) do
+ %td
+ - if tenant.sip_accounts.any?
+ - if tenant.sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
+ = link_to tenant.sip_accounts.count.to_s, tenant_sip_accounts_path(tenant)
+ - else
+ - tenant.sip_accounts.each do |sip_account|
+ = succeed ', ' do
+ =link_to "#{sip_account.caller_name}", tenant_sip_account_path(tenant,sip_account)
+ - if sip_account.phone_numbers.any?
+ = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount}
+
+ - cache(['tenant_show_admin_area_sip_accounts_table_cell', I18n.locale, @tenant, @tenant.phones.count, @tenant.phones.reorder(:updated_at).last]) do
+ %td
+ - if tenant.phones.any?
+ - if tenant.phones.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
+ = link_to tenant.phones.count.to_s, tenant_phones_path(tenant)
+ - else
+ - cache(['tenant_show_tenant_phones', I18n.locale, tenant, tenant.phones]) do
+ - tenant.phones.each do |phone|
+ = succeed ', ' do
+ = link_to "#{phone.phone_model.to_s} (#{phone.pretty_mac_address})#{(phone.ip_address.blank? ? '' : " - #{phone.ip_address}")}", tenant_phone_path(tenant, phone)
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Phone}
+
+ %tr{:class => 'even'}
+ %td= t("users.index.page_title")
%td
- if tenant.users_sip_accounts.any?
- if tenant.users_sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
@@ -37,18 +53,6 @@
- else
= "-"
- %tr{:class => 'even'}
- %td= t("phones.index.page_title")
- %td
- - if tenant.phones.any?
- - if tenant.phones.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
- = link_to tenant.phones.count.to_s, tenant_phones_path(tenant)
- - else
- - cache([I18n.locale, tenant, tenant.phones]) do
- - tenant.phones.each do |phone|
- = succeed ', ' do
- = link_to "#{phone.phone_model.to_s} (#{phone.pretty_mac_address})#{(phone.ip_address.blank? ? '' : " - #{phone.ip_address}")}", tenant_phone_path(tenant, phone)
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Phone}
%td
- if tenant.users_phones.any?
- if tenant.users_phones.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
@@ -61,4 +65,4 @@
- else
= link_to "#{phone.phone_model.to_s} (#{phone.pretty_mac_address})#{(phone.ip_address.blank? ? '' : " - #{phone.ip_address}")}", user_phone_path(phone.phoneable, phone)
- else
- = '-' \ No newline at end of file
+ = '-'
diff --git a/app/views/tenants/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml
index 79ea2b1..75b2332 100644
--- a/app/views/tenants/_table_of_functions.html.haml
+++ b/app/views/tenants/_table_of_functions.html.haml
@@ -1,4 +1,4 @@
-- cache([I18n.locale, tenant, GuiFunction.count, GuiFunction.order(:updated_at).last, GsParameter.count, GsParameter.order(:updated_at).last]) do
+- cache(['table_of_pbx_features', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.order(:updated_at).last, tenant.conferences.count, tenant.conferences.order(:updated_at).last, tenant.hunt_groups.count, tenant.hunt_groups.order(:updated_at).last, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.order(:updated_at).last]) do
%table
%tr{:class => 'even'}
%th
@@ -6,55 +6,47 @@
%th
Anzahl
%th
- %tr{:class => 'odd'}
- %td
- = t("callthroughs.name")
- %td
- - if tenant.callthroughs.any?
- = link_to tenant.callthroughs.count.to_s, tenant_callthroughs_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough}
- %tr{:class => 'even'}
- %td
- = t("conferences.name")
- %td
- - if tenant.conferences.any?
- = link_to tenant.conferences.count.to_s, tenant_conferences_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference}
- %tr{:class => 'odd'}
- %td
- = t("hunt_groups.name")
- %td
- - if tenant.hunt_groups.any?
- = link_to tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup}
- %tr{:class => 'even'}
- %td
- = t("automatic_call_distributors.name")
- %td
- - if tenant.automatic_call_distributors.any?
- = link_to tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => AutomaticCallDistributor}
- %tr{:class => 'odd'}
- %td
- = t("gui_functions.name")
- %td
- = link_to GuiFunction.count.to_s, gui_functions_path
- %td
- %tr{:class => 'even'}
- %td
- = t("gs_parameters.name")
- %td
- = link_to GsParameter.count.to_s, gs_parameters_path
- %td \ No newline at end of file
+ - cache(['table_of_pbx_features_callthroughs_row', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.order(:updated_at).last]) do
+ %tr{:class => 'odd'}
+ %td
+ = t("callthroughs.name")
+ %td
+ - if tenant.callthroughs.any?
+ = link_to tenant.callthroughs.count.to_s, tenant_callthroughs_path(tenant)
+ - else
+ = '-'
+ %td
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough}
+ - cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.order(:updated_at).last]) do
+ %tr{:class => 'even'}
+ %td
+ = t("conferences.name")
+ %td
+ - if tenant.conferences.any?
+ = link_to tenant.conferences.count.to_s, tenant_conferences_path(tenant)
+ - else
+ = '-'
+ %td
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference}
+ - cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.order(:updated_at).last]) do
+ %tr{:class => 'odd'}
+ %td
+ = t("hunt_groups.name")
+ %td
+ - if tenant.hunt_groups.any?
+ = link_to tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(tenant)
+ - else
+ = '-'
+ %td
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup}
+ - cache(['table_of_pbx_features_automatic_call_distributors_row', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.order(:updated_at).last]) do
+ %tr{:class => 'even'}
+ %td
+ = t("automatic_call_distributors.name")
+ %td
+ - if tenant.automatic_call_distributors.any?
+ = link_to tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(tenant)
+ - else
+ = '-'
+ %td
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => AutomaticCallDistributor} \ No newline at end of file
diff --git a/app/views/tenants/_table_of_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml
index 811fe26..6baca58 100644
--- a/app/views/tenants/_table_of_phone_books.html.haml
+++ b/app/views/tenants/_table_of_phone_books.html.haml
@@ -1,8 +1,7 @@
-- cache([I18n.locale, tenant, tenant.phone_books]) do
+- cache(['user_show_phone_books', I18n.locale, tenant, tenant.phone_books]) do
-# Phone books
-#
- if GuiFunction.display?('show_phone_books_in_user_show_view', current_user)
- if can?( :index, PhoneBook )
- %h2=t("phone_books.index.page_title")
= render "phone_books/index_core", :phone_books => tenant.phone_books
= render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => PhoneBook} \ No newline at end of file
diff --git a/app/views/tenants/show.html.haml b/app/views/tenants/show.html.haml
index cb2b895..10845cf 100644
--- a/app/views/tenants/show.html.haml
+++ b/app/views/tenants/show.html.haml
@@ -1,14 +1,15 @@
- title t("tenants.show.page_title")
-%p
- %strong= t('tenants.show.name') + ":"
- = @tenant.name
-- if !@tenant.description.blank?
+- cache(['tenant_show_name_and_description', I18n.locale, @tenant, current_user]) do
%p
- %strong= t('tenants.show.description') + ":"
- = @tenant.description
+ %strong= t('tenants.show.name') + ":"
+ = @tenant.name
+ - if !@tenant.description.blank?
+ %p
+ %strong= t('tenants.show.description') + ":"
+ = @tenant.description
-= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant }
+ = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant }
- if @tenant.user_groups.where(:name => 'Admins').count > 0 && @tenant.user_groups.where(:name => 'Admins').first.users.include?(current_user)
= render 'admin_area' \ No newline at end of file