From 525e7ad4cac6fff7bd0370828b06159d610573ef Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:45:36 +0100 Subject: Added caching. --- app/views/call_routes/_index_core.html.haml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index aa22437..124f4d0 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -1,13 +1,15 @@ -%table - %tr - %th= t('call_routes.index.name') - %th= t('call_routes.index.endpoint_type') - %th= t('call_routes.index.endpoint_id') +- cache(['call_routes_table', call_routes.count, call_routes.reorder(:updated_at).last]) do + %table + %tr + %th= t('call_routes.index.name') + %th= t('call_routes.index.endpoint_type') + %th= t('call_routes.index.endpoint_id') - - reset_cycle - - for call_route in call_routes - %tr{:class => cycle('odd', 'even')} - %td= call_route.name - %td= call_route.endpoint_type - %td= call_route.endpoint_id - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file + - reset_cycle + - for call_route in call_routes + %tr{:class => cycle('odd', 'even')} + - cache(['call_route_single_table_row', call_route]) do + %td= call_route.name + %td= call_route.endpoint_type + %td= call_route.endpoint_id + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file -- cgit v1.2.3 From 93a839b41f7172eecd1aeb497ccec6c73d2c4c1e Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:46:13 +0100 Subject: Better cache key. --- app/views/call_routes/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 124f4d0..32877b2 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -8,7 +8,7 @@ - reset_cycle - for call_route in call_routes %tr{:class => cycle('odd', 'even')} - - cache(['call_route_single_table_row', call_route]) do + - cache(['call_route_single_table_row_within_tr', call_route]) do %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id -- cgit v1.2.3 From 5b5cbfddd9fa3a26de90ca8aa42668eb95648605 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:48:19 +0100 Subject: Small logic fix. --- app/views/call_routes/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 32877b2..12e89ee 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -8,7 +8,7 @@ - reset_cycle - for call_route in call_routes %tr{:class => cycle('odd', 'even')} - - cache(['call_route_single_table_row_within_tr', call_route]) do + - cache(['call_route_single_table_row_within_tr', call_route, call_routes.count]) do %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id -- cgit v1.2.3 From 4ea0e252683d89794deff7b1b3689d2cdf61e0d0 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:54:11 +0100 Subject: Added a gateways table to tenant#view. --- app/views/gateways/show.html.haml | 2 +- app/views/tenants/_admin_area.de.html.haml | 4 +++- app/views/tenants/_admin_area.html.haml | 4 +++- app/views/tenants/_call_routes.html.haml | 2 +- app/views/tenants/_gateways.html.haml | 8 ++++++++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 app/views/tenants/_gateways.html.haml (limited to 'app') diff --git a/app/views/gateways/show.html.haml b/app/views/gateways/show.html.haml index a9b0d18..9d0ee53 100644 --- a/app/views/gateways/show.html.haml +++ b/app/views/gateways/show.html.haml @@ -28,8 +28,8 @@ %br = render :partial => 'shared/create_link', :locals => { :parent => @gateway, :child_class => GatewaySetting } +%h3= t('gateway_parameters.index.page_title') - if @gateway.gateway_parameters.any? - %h3= t('gateway_parameters.index.page_title') = render "gateway_parameters/index_core", :gateway_parameters => @gateway.gateway_parameters %br = render :partial => 'shared/create_link', :locals => { :parent => @gateway, :child_class => GatewayParameter } diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index ba64e9a..6a4bef9 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -27,4 +27,6 @@ = succeed '.' do =link_to manufacturer, manufacturer_path(manufacturer) -= render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'call_routes', :locals => {:tenant => @tenant} + += render :partial => 'gateways', :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 50ed372..b974c02 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -25,4 +25,6 @@ =link_to manufacturer, manufacturer_path(manufacturer) - else = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) \ No newline at end of file + =link_to manufacturer, manufacturer_path(manufacturer) + += render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_call_routes.html.haml b/app/views/tenants/_call_routes.html.haml index ade24c9..41066ae 100644 --- a/app/views/tenants/_call_routes.html.haml +++ b/app/views/tenants/_call_routes.html.haml @@ -1,7 +1,7 @@ %h2= t("call_routes.index.page_title") - if CallRoute.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') - = render "call_routes/index_core", :call_routes => CallRoute.call + = render "call_routes/index_core", :call_routes => CallRoute.all = render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} - else %p diff --git a/app/views/tenants/_gateways.html.haml b/app/views/tenants/_gateways.html.haml new file mode 100644 index 0000000..c861ad3 --- /dev/null +++ b/app/views/tenants/_gateways.html.haml @@ -0,0 +1,8 @@ +%h2= t("gateways.index.page_title") + +- if Gateway.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "gateways/index_core", :gateways => Gateway.all + = render :partial => 'shared/create_link', :locals => {:child_class => Gateway} +- else + %p + = link_to t("gateways.index.page_title"), gateways_path \ No newline at end of file -- cgit v1.2.3