From 49738b091eea2ca65d6f8c71b88747e314ec2950 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 10 Jan 2013 22:44:10 +0100 Subject: Refactoring and adding some caches. --- app/views/tenants/_table_of_functions.html.haml | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 app/views/tenants/_table_of_functions.html.haml (limited to 'app/views/tenants/_table_of_functions.html.haml') 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 -- cgit v1.2.3