summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-13 17:23:47 +0100
committerspag <spag@golwen.net>2013-01-13 17:23:47 +0100
commit0b717b40b596fcd6ba238b2b3066b33a91289fdf (patch)
tree5b225d4085ac89532413ed224438d3ba187fda5f /app/views
parent0d5114566e73c44799eac83d46f159cd979f4fcc (diff)
parent9567f239586f253002dea0ed654b7bd18a15e572 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/views')
-rw-r--r--app/views/phones/_form_core.html.haml2
-rw-r--r--app/views/phones/show.html.haml2
-rw-r--r--app/views/tenants/_admin_area.de.html.haml3
-rw-r--r--app/views/tenants/_admin_area.html.haml2
-rw-r--r--app/views/tenants/_sip_accounts_and_phones.html.haml117
-rw-r--r--app/views/tenants/_table_of_functions.html.haml2
-rw-r--r--app/views/tenants/_table_of_phone_books.html.haml2
7 files changed, 64 insertions, 66 deletions
diff --git a/app/views/phones/_form_core.html.haml b/app/views/phones/_form_core.html.haml
index b09ee35..17b9ca8 100644
--- a/app/views/phones/_form_core.html.haml
+++ b/app/views/phones/_form_core.html.haml
@@ -11,5 +11,5 @@
- if defined? GsParameter.get('NIGHTLY_REBOOT_OF_PHONES') && GsParameter.get('NIGHTLY_REBOOT_OF_PHONES') == true
= f.input :nightly_reboot, :label => t('phones.form.nightly_reboot.label'), :hint => conditional_hint('phones.form.nightly_reboot.hint')
- - if defined? PROVISIONING_KEY_LENGTH && PROVISIONING_KEY_LENGTH > 0
+ - if !GsParameter.get('PROVISIONING_KEY_LENGTH').nil? && GsParameter.get('PROVISIONING_KEY_LENGTH') > 0
= f.input :provisioning_key_active, :label => t('phones.form.provisioning_key_active.label'), :hint => conditional_hint('phones.form.provisioning_key_active.hint')
diff --git a/app/views/phones/show.html.haml b/app/views/phones/show.html.haml
index f20facd..0e0dad5 100644
--- a/app/views/phones/show.html.haml
+++ b/app/views/phones/show.html.haml
@@ -21,7 +21,7 @@
%strong= t('phones.show.nightly_reboot') + ":"
= @phone.nightly_reboot
-- if defined? PROVISIONING_KEY_LENGTH && PROVISIONING_KEY_LENGTH > 0
+- if !GsParameter.get('PROVISIONING_KEY_LENGTH').nil? && GsParameter.get('PROVISIONING_KEY_LENGTH') > 0
%p
%strong= t('phones.show.provisioning_key_active') + ":"
= @phone.provisioning_key_active
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
index c3411bc..d111c9d 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.count, Manufacturer.order(:updated_at).last, PhoneModel.count]) do
+- cache([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'))
@@ -32,4 +32,3 @@
= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant}
= 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 56b0820..b479995 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.count, Manufacturer.order(:updated_at).last, PhoneModel.count]) do
+- cache([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 9059126..f9d26f9 100644
--- a/app/views/tenants/_sip_accounts_and_phones.html.haml
+++ b/app/views/tenants/_sip_accounts_and_phones.html.haml
@@ -1,65 +1,64 @@
-- cache([I18n.locale, tenant, Phone.count, Phone.order(:updated_at).last, PhoneNumber.count, PhoneNumber.order(:updated_at).last, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do
- %table
- %tr{:class => 'even'}
- %th
- %th
- = tenant
- %th= t("users.index.page_title")
+%table
+ %tr{:class => 'even'}
+ %th
+ %th
+ = tenant
+ %th= t("users.index.page_title")
- %tr{:class => 'odd'}
- %td= t("sip_accounts.index.page_title")
- - cache([I18n.locale, tenant, tenant.sip_accounts.count, tenant.sip_accounts.order(: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}
- %td
- - if tenant.users_sip_accounts.any?
- - if tenant.users_sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
- = tenant.users_sip_accounts.count
- - else
- - tenant.users_sip_accounts.each do |sip_account|
- - if sip_account != tenant.users_sip_accounts.last
- = succeed ', ' do
- =link_to "#{sip_account.caller_name}", user_sip_account_path(sip_account.sip_accountable,sip_account)
- - if sip_account.phone_numbers.any?
- = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
- - else
- =link_to "#{sip_account.caller_name}", user_sip_account_path(sip_account.sip_accountable,sip_account)
+ %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([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}
+ %td
+ - if tenant.users_sip_accounts.any?
+ - if tenant.users_sip_accounts.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS')
+ = tenant.users_sip_accounts.count
- else
- = "-"
-
- %tr{:class => 'even'}
- %td= t("phones.index.page_title")
- - cache([I18n.locale, tenant, tenant.phones.count, tenant.phones.order(: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)
+ - tenant.users_sip_accounts.each do |sip_account|
+ - if sip_account != tenant.users_sip_accounts.last
+ = succeed ', ' do
+ =link_to "#{sip_account.caller_name}", user_sip_account_path(sip_account.sip_accountable,sip_account)
+ - if sip_account.phone_numbers.any?
+ = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
- else
- - 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')
- = tenant.users_phones.count
- - else
- - tenant.users_phones.each do |phone|
- - if phone != tenant.users_phones.last
- = succeed ', ' do
- = 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
- = link_to "#{phone.phone_model.to_s} (#{phone.pretty_mac_address})#{(phone.ip_address.blank? ? '' : " - #{phone.ip_address}")}", user_phone_path(phone.phoneable, phone)
+ =link_to "#{sip_account.caller_name}", user_sip_account_path(sip_account.sip_accountable,sip_account)
+ - if sip_account.phone_numbers.any?
+ = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
+ - 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
- = '-' \ No newline at end of file
+ - cache([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')
+ = tenant.users_phones.count
+ - else
+ - tenant.users_phones.each do |phone|
+ - if phone != tenant.users_phones.last
+ = succeed ', ' do
+ = 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
+ = 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/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml
index d4d3950..79ea2b1 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)]) do
+- cache([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_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml
index ef118c7..811fe26 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]) do
+- cache([I18n.locale, tenant, tenant.phone_books]) do
-# Phone books
-#
- if GuiFunction.display?('show_phone_books_in_user_show_view', current_user)