From 801f53f49f5440acaeba70c65df8d3e611c0b4c4 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 17:24:13 +0100 Subject: Fixed not rendered link to create a new SIP account. --- app/views/tenants/_sip_accounts_and_phones.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/tenants') diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml index f9d26f9..618236f 100644 --- a/app/views/tenants/_sip_accounts_and_phones.html.haml +++ b/app/views/tenants/_sip_accounts_and_phones.html.haml @@ -18,7 +18,7 @@ =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} + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount} %td - if tenant.users_sip_accounts.any? - if tenant.users_sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS') -- cgit v1.2.3 From bdad29d001523a2ba4f515e6202babaa61739fc9 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 18:02:06 +0100 Subject: Refactoring and caching. --- app/views/tenants/_admin_area.de.html.haml | 6 ++ app/views/tenants/_admin_area.html.haml | 7 +- app/views/tenants/_gs_parameter_table.html.haml | 24 ++++++ app/views/tenants/_table_of_functions.html.haml | 98 +++++++++++------------ app/views/tenants/_table_of_phone_books.html.haml | 1 - 5 files changed, 81 insertions(+), 55 deletions(-) create mode 100644 app/views/tenants/_gs_parameter_table.html.haml (limited to 'app/views/tenants') 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 -- cgit v1.2.3 From 7b5c903f96e1c97ad788962c88d6d285852d890e Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 20:50:18 +0100 Subject: Fixed caching. --- app/views/tenants/_gs_parameter_table.html.haml | 2 +- app/views/tenants/_table_of_functions.html.haml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/views/tenants') diff --git a/app/views/tenants/_gs_parameter_table.html.haml b/app/views/tenants/_gs_parameter_table.html.haml index 7663f46..3af06cf 100644 --- a/app/views/tenants/_gs_parameter_table.html.haml +++ b/app/views/tenants/_gs_parameter_table.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(['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 diff --git a/app/views/tenants/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml index ef2a2d0..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, 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 +- 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,7 +6,7 @@ %th Anzahl %th - - cache([I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.order(:updated_at).last]) do + - 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") @@ -17,7 +17,7 @@ = '-' %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 + - 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") @@ -28,7 +28,7 @@ = '-' %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 + - 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") @@ -39,7 +39,7 @@ = '-' %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 + - 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") -- cgit v1.2.3 From 96fc4789d9991548b9fd1144f185da1f3464f156 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 21:47:26 +0100 Subject: Fixed caching bugs. --- app/views/tenants/_admin_area.de.html.haml | 2 +- app/views/tenants/_admin_area.html.haml | 2 +- app/views/tenants/_sip_accounts_and_phones.html.haml | 4 ++-- app/views/tenants/_table_of_phone_books.html.haml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/views/tenants') diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index 4b8a9e6..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')) diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index b1b17a3..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')) diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml index 618236f..c698fef 100644 --- a/app/views/tenants/_sip_accounts_and_phones.html.haml +++ b/app/views/tenants/_sip_accounts_and_phones.html.haml @@ -12,7 +12,7 @@ - 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 + - cache(['tenant_show_tenant_sip_accounts',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) @@ -44,7 +44,7 @@ - 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 + - 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) diff --git a/app/views/tenants/_table_of_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml index a963bf4..6baca58 100644 --- a/app/views/tenants/_table_of_phone_books.html.haml +++ b/app/views/tenants/_table_of_phone_books.html.haml @@ -1,4 +1,4 @@ -- 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) -- cgit v1.2.3 From 8d622f127f8d951c50bbf3fd0921626fd3746dae Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 15 Jan 2013 22:42:15 +0100 Subject: Optimized caching. --- .../tenants/_sip_accounts_and_phones.html.haml | 64 ++++++++++++---------- app/views/tenants/show.html.haml | 15 ++--- 2 files changed, 42 insertions(+), 37 deletions(-) (limited to 'app/views/tenants') diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml index c698fef..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(['tenant_show_tenant_sip_accounts',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(['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} %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/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 -- cgit v1.2.3