summaryrefslogtreecommitdiff
path: root/app/views/tenants
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-10 22:44:37 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-10 22:44:37 +0100
commit8a886920b8930b64402e23fe81cf4e57078b795c (patch)
tree27a251dd797c9981747c9edf5e55139bd704c974 /app/views/tenants
parent48accca73c9564bd2ee8bd296d47eb5c27dbcd51 (diff)
parent49738b091eea2ca65d6f8c71b88747e314ec2950 (diff)
Merge branch 'caching' into develop
Diffstat (limited to 'app/views/tenants')
-rw-r--r--app/views/tenants/_admin_area.de.html.haml118
-rw-r--r--app/views/tenants/_admin_area.html.haml115
-rw-r--r--app/views/tenants/_table_of_functions.html.haml60
-rw-r--r--app/views/tenants/_table_of_phone_books.html.haml8
4 files changed, 125 insertions, 176 deletions
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
index 3c9440b..c3411bc 100644
--- a/app/views/tenants/_admin_area.de.html.haml
+++ b/app/views/tenants/_admin_area.de.html.haml
@@ -1,95 +1,35 @@
-%p
- Sie sind Mitglied der
- = link_to 'Admin Gruppe', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
- und haben deshalb besondere Rechte. Aber wie Peter Parker schon sagte: "With great power comes great responsibility."
+- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.count, Manufacturer.order(:updated_at).last, PhoneModel.count]) do
+ %p
+ Sie sind Mitglied der
+ = link_to 'Admin Gruppe', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
+ und haben deshalb besondere Rechte. Aber wie Peter Parker schon sagte: "With great power comes great responsibility."
-%p
- Dieser Mandant hat
- = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant)
- - if @tenant.user_groups.count < 5
- = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})"
- die in Summe
- = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant)
- verwalten.
- Das System kann
- = PhoneModel.count
- verschiedene Telefonmodelle von den folgenden Herstellern verwalten:
- - Manufacturer.all.each do |manufacturer|
- - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ', ' do
- =link_to manufacturer, manufacturer_path(manufacturer)
- - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ' und ' do
- =link_to manufacturer, manufacturer_path(manufacturer)
- - else
- = succeed '.' do
- =link_to manufacturer, manufacturer_path(manufacturer)
+ %p
+ = @tenant
+ hat
+ = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant)
+ - if @tenant.user_groups.count < 5
+ = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})"
+ die in Summe
+ = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant)
+ verwalten.
+ Das System kann
+ = PhoneModel.count
+ verschiedene Telefonmodelle von den folgenden Herstellern verwalten:
+ - Manufacturer.all.each do |manufacturer|
+ - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ', ' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
+ - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ' und ' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
+ - else
+ = succeed '.' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
-%h3 Allgemein
+= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
-%table
- %tr{:class => 'even'}
- %th
- Funktion
- %th
- Anzahl
- %th
- %tr{:class => 'odd'}
- %td
- Callthrough
- %td
- = link_to @tenant.callthroughs.count.to_s, tenant_callthroughs_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Callthrough}
- %tr{:class => 'even'}
- %td
- Konferenzen
- %td
- = link_to @tenant.conferences.count.to_s, tenant_conferences_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Conference}
- %tr{:class => 'odd'}
- %td
- Rufgruppen
- %td
- = link_to @tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => HuntGroup}
- %tr{:class => 'even'}
- %td
- Warteschleifen
- %td
- = link_to @tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => AutomaticCallDistributor}
- %tr{:class => 'odd'}
- %td
- Oberflächen-Funktionen
- %td
- = link_to GuiFunction.count.to_s, gui_functions_path
- %td
+= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant}
--# 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}
-
-- if GsParameter.get('STRICT_INTERNAL_EXTENSION_HANDLING') == true
- %h3= t('phone_number_ranges.index.page_title')
-
- - if @tenant.created_at > (Time.now - 15.minutes) && Delayed::Job.count > 0 && @tenant.phone_number_ranges.find_by_name(GsParameter.get('INTERNAL_EXTENSIONS')).try(:phone_numbers).try(:count).to_i == 0
- Der Mandant
- = "\"#{@tenant}\""
- wurde erst vor
- = distance_of_time_in_words_to_now(@tenant.created_at)
- erstellt. Es gibt immer noch nicht abgeschlossene
- = pluralize(Delayed::Job.count, 'Hintergrundprozesse')
- \. Bitte warten Sie noch ein paar Minuten und laden anschließend diese Seite erneut.
- - else
- =render 'phone_number_ranges/index_core', :phone_number_ranges => (@tenant.phone_number_ranges + @tenant.country.phone_number_ranges.where(:name => GsParameter.get('SERVICE_NUMBERS')))
- =render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => PhoneNumberRange}
diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml
index c838a18..56b0820 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -1,93 +1,34 @@
-%p
- You belong to the
- = link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
- and therefore have super powers. But always remember Peter Parker's: "With great power comes great responsibility."
+- cache([I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.count, Manufacturer.order(:updated_at).last, PhoneModel.count]) do
+ %p
+ You belong to the
+ = link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins'))
+ and therefore have super powers. But always remember Peter Parker's: "With great power comes great responsibility."
-%p
- = succeed '.' do
- This tenant has
- = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant)
- - if @tenant.user_groups.count < 5
- = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})"
- which handle a total of
- = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant)
- This system can setup
- = PhoneModel.count
- different phone models from the manufacturers
- - Manufacturer.all.each do |manufacturer|
- - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ', ' do
- =link_to manufacturer, manufacturer_path(manufacturer)
- - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ' and ' do
- =link_to manufacturer, manufacturer_path(manufacturer)
- - else
- = succeed '.' do
- =link_to manufacturer, manufacturer_path(manufacturer)
+ %p
+ = succeed '.' do
+ This tenant has
+ = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant)
+ - if @tenant.user_groups.count < 5
+ = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})"
+ which handle a total of
+ = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant)
+ This system can setup
+ = PhoneModel.count
+ different phone models from the manufacturers
+ - Manufacturer.all.each do |manufacturer|
+ - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ', ' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
+ - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ' and ' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
+ - else
+ = succeed '.' do
+ =link_to manufacturer, manufacturer_path(manufacturer)
= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
-%h3 Misc
+= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
-%table
- %tr{:class => 'even'}
- %th
- Feature
- %th
- Counter
- %th
- %tr{:class => 'odd'}
- %td
- Callthroughs
- %td
- = link_to @tenant.callthroughs.count.to_s, tenant_callthroughs_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Callthrough}
- %tr{:class => 'even'}
- %td
- Conferences
- %td
- = link_to @tenant.conferences.count.to_s, tenant_conferences_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => Conference}
- %tr{:class => 'odd'}
- %td
- Hunt groups
- %td
- = link_to @tenant.hunt_groups.count.to_s, tenant_hunt_groups_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => HuntGroup}
- %tr{:class => 'even'}
- %td
- ACDs
- %td
- = link_to @tenant.automatic_call_distributors.count.to_s, tenant_automatic_call_distributors_path(@tenant)
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => AutomaticCallDistributor}
- %tr{:class => 'odd'}
- %td
- GUI functions
- %td
- = link_to GuiFunction.count.to_s, gui_functions_path
- %td
+= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant}
--# 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}
-
-- if GsParameter.get('STRICT_INTERNAL_EXTENSION_HANDLING') == true
- %h3= t('phone_number_ranges.index.page_title')
-
- - if @tenant.created_at > (Time.now - 15.minutes) && Delayed::Job.count > 0 && @tenant.phone_number_ranges.find_by_name(GsParameter.get('INTERNAL_EXTENSIONS')).try(:phone_numbers).try(:count).to_i == 0
- This tenant was created
- = distance_of_time_in_words_to_now(@tenant.created_at)
- ago. There are still
- = pluralize(Delayed::Job.count, 'background job')
- not finished. This can take a couple of minutes. Please reload this page later.
- - else
- =render 'phone_number_ranges/index_core', :phone_number_ranges => (@tenant.phone_number_ranges + @tenant.country.phone_number_ranges.where(:name => GsParameter.get('SERVICE_NUMBERS')))
- =render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => PhoneNumberRange}
diff --git a/app/views/tenants/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml
new file mode 100644
index 0000000..d4d3950
--- /dev/null
+++ b/app/views/tenants/_table_of_functions.html.haml
@@ -0,0 +1,60 @@
+- cache([I18n.locale, tenant, GuiFunction.count, GuiFunction.order(:updated_at).last, GsParameter.count, GsParameter.order(:updated_at)]) do
+ %table
+ %tr{:class => 'even'}
+ %th
+ Funktion
+ %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
diff --git a/app/views/tenants/_table_of_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml
new file mode 100644
index 0000000..ef118c7
--- /dev/null
+++ b/app/views/tenants/_table_of_phone_books.html.haml
@@ -0,0 +1,8 @@
+- cache([I18n.locale, tenant]) 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