summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 18:02:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 18:02:06 +0100
commitbdad29d001523a2ba4f515e6202babaa61739fc9 (patch)
treedff7d8fb6b8857997eb7ba99d0059eca712f4a85 /app
parent2928e0342ef45d5b6ecf27faf2940b424c8bd513 (diff)
Refactoring and caching.
Diffstat (limited to 'app')
-rw-r--r--app/views/tenants/_admin_area.de.html.haml6
-rw-r--r--app/views/tenants/_admin_area.html.haml7
-rw-r--r--app/views/tenants/_gs_parameter_table.html.haml24
-rw-r--r--app/views/tenants/_table_of_functions.html.haml98
-rw-r--r--app/views/tenants/_table_of_phone_books.html.haml1
5 files changed, 81 insertions, 55 deletions
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
index d111c9d..4b8a9e6 100644
--- a/app/views/tenants/_admin_area.de.html.haml
+++ b/app/views/tenants/_admin_area.de.html.haml
@@ -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..b1b17a3 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -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..7663f46
--- /dev/null
+++ b/app/views/tenants/_gs_parameter_table.html.haml
@@ -0,0 +1,24 @@
+- cache([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/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml
index 79ea2b1..ef2a2d0 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([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([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([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([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([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..a963bf4 100644
--- a/app/views/tenants/_table_of_phone_books.html.haml
+++ b/app/views/tenants/_table_of_phone_books.html.haml
@@ -3,6 +3,5 @@
-#
- 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