summaryrefslogtreecommitdiff
path: root/app/views/tenants
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/tenants')
-rw-r--r--app/views/tenants/_admin_area.html.haml70
-rw-r--r--app/views/tenants/_form_core.html.haml3
-rw-r--r--app/views/tenants/_gs_parameter_table.html.haml40
-rw-r--r--app/views/tenants/_index_core.html.haml33
-rw-r--r--app/views/tenants/_sip_accounts_and_phones.html.haml68
-rw-r--r--app/views/tenants/_table_of_automatic_call_distributors.html.haml8
-rw-r--r--app/views/tenants/_table_of_callthroughs.html.haml8
-rw-r--r--app/views/tenants/_table_of_conferences.html.haml8
-rw-r--r--app/views/tenants/_table_of_functions.html.haml53
-rw-r--r--app/views/tenants/_table_of_hunt_groups.html.haml8
-rw-r--r--app/views/tenants/_table_of_phones.html.haml7
-rw-r--r--app/views/tenants/_table_of_sip_accounts.html.haml25
-rw-r--r--app/views/tenants/show.html.haml15
13 files changed, 151 insertions, 195 deletions
diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml
index 627f221..28a8273 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -1,32 +1,40 @@
-= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => tenant}
-= render :partial => 'users_table', :locals => {:tenant => tenant}
-
-= render :partial => 'user_groups_table', :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 Konfiguration
-= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => tenant}
-
-%p
- Das System kann
- = PhoneModel.count
- verschiedene Telefonmodelle von den folgenden Herstellern verwalten:
- - Manufacturer.all.each do |manufacturer|
- - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ', ' do
- =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
- - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ' und ' do
- =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
- - else
- = succeed '.' do
- =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
-
-= render :partial => 'call_routes', :locals => {:tenant => tenant}
-
-= render :partial => 'gateways', :locals => {:tenant => tenant, :gateways => gateways} \ No newline at end of file
+.row
+ .span12
+ = render :partial => 'tenants/table_of_sip_accounts', :locals => {:tenant => tenant}
+ - if SipAccount.any?
+ = render :partial => 'tenants/table_of_phones', :locals => {:tenant => tenant}
+
+ - if SipAccount.any? || Gateway.any?
+ = render :partial => 'tenants/table_of_conferences', :locals => {:tenant => tenant}
+ = render :partial => 'tenants/table_of_callthroughs', :locals => {:tenant => tenant}
+ = render :partial => 'tenants/table_of_hunt_groups', :locals => {:tenant => tenant}
+ = render :partial => 'tenants/table_of_automatic_call_distributors', :locals => {:tenant => tenant}
+
+ = render :partial => 'tenants/users_table', :locals => {:tenant => tenant}
+ = render :partial => 'tenants/user_groups_table', :locals => {:tenant => tenant}
+
+ = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => tenant}
+
+ .well
+ %h2 Gemeinschaft Konfiguration
+ = render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => tenant}
+
+ %p
+ Das System kann
+ = PhoneModel.count
+ verschiedene Telefonmodelle von den folgenden Herstellern verwalten:
+ - Manufacturer.all.each do |manufacturer|
+ - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ', ' do
+ =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
+ - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
+ = succeed ' und ' do
+ =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
+ - else
+ = succeed '.' do
+ =link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + manufacturer, manufacturer_path(manufacturer)
+
+ = render :partial => 'call_routes', :locals => {:tenant => tenant}
+
+ = render :partial => 'gateways', :locals => {:tenant => tenant, :gateways => gateways} \ No newline at end of file
diff --git a/app/views/tenants/_form_core.html.haml b/app/views/tenants/_form_core.html.haml
index e0b173d..8f6e08f 100644
--- a/app/views/tenants/_form_core.html.haml
+++ b/app/views/tenants/_form_core.html.haml
@@ -1,3 +1,4 @@
.inputs
= f.input :name, :label => t('tenants.form.name.label'), :hint => conditional_hint('tenants.form.name.hint'), :autofocus => true
- = f.input :description, :label => t('tenants.form.description.label'), :hint => conditional_hint('tenants.form.description.hint')
+ - if !@tenant.new_record?
+ = f.input :description, :label => t('tenants.form.description.label'), :hint => conditional_hint('tenants.form.description.hint')
diff --git a/app/views/tenants/_gs_parameter_table.html.haml b/app/views/tenants/_gs_parameter_table.html.haml
index 8afdb0e..8b0d62c 100644
--- a/app/views/tenants/_gs_parameter_table.html.haml
+++ b/app/views/tenants/_gs_parameter_table.html.haml
@@ -1,24 +1,20 @@
- cache(['gs_parameters_tenant_overview_table', I18n.locale, tenant, GuiFunction.count, GuiFunction.reorder(:updated_at).last, GsParameter.count, GsParameter.reorder(:updated_at).last]) do
- %table{:class => 'table table-striped'}
- %tr
- %th
- Funktion
- %th
- Anzahl
- %th
- Letztes Update
+ %table.table.table-striped
+ %thead
+ %tr
+ %th
+ Funktion
+ %th
+ Anzahl
- %tr
- %td
- = t("gui_functions.name")
- %td
- = link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + GuiFunction.count.to_s, gui_functions_path
- %td
- = l GuiFunction.reorder(:updated_at).last.updated_at, :format => :short
- %tr
- %td
- = t("gs_parameters.name")
- %td
- = link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + GsParameter.count.to_s, gs_parameters_path
- %td
- = l GsParameter.reorder(:updated_at).last.updated_at, :format => :short
+ %tbody
+ %tr
+ %td
+ = t("gui_functions.name")
+ %td
+ = link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + GuiFunction.count.to_s, gui_functions_path
+ %tr
+ %td
+ = t("gs_parameters.name")
+ %td
+ = link_to link_to Haml::Engine.new("%i.icon-list").render + ' ' + GsParameter.count.to_s, gs_parameters_path
diff --git a/app/views/tenants/_index_core.html.haml b/app/views/tenants/_index_core.html.haml
index 721d624..a220b1b 100644
--- a/app/views/tenants/_index_core.html.haml
+++ b/app/views/tenants/_index_core.html.haml
@@ -1,17 +1,18 @@
-%table{:class => 'table table-striped'}
- %tr
- %th= t('tenants.index.name')
- %th= t('tenants.index.description')
-
-
- - for tenant in tenants
+%table.table.table-striped
+ %thead
%tr
- %td= tenant.name
- %td= tenant.description
- %td
- - if current_user && current_user.current_tenant != tenant && current_user.tenants.include?(tenant)
- = simple_form_for([current_user.current_tenant, current_user]) do |f|
- = f.hidden_field :current_tenant_id, :value => tenant.id
- .actions
- = f.button :submit, conditional_t('tenants.switch_to_tenant')
- =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => tenant} \ No newline at end of file
+ %th= t('tenants.index.name')
+ %th= t('tenants.index.description')
+
+ %tbody
+ - for tenant in tenants
+ %tr
+ %td= tenant.name
+ %td= tenant.description
+ %td
+ - if current_user && current_user.current_tenant != tenant && current_user.tenants.include?(tenant)
+ = simple_form_for([current_user.current_tenant, current_user]) do |f|
+ = f.hidden_field :current_tenant_id, :value => tenant.id
+ .actions
+ = f.button :submit, conditional_t('tenants.switch_to_tenant')
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => tenant} \ No newline at end of file
diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml
deleted file mode 100644
index bcc2dd6..0000000
--- a/app/views/tenants/_sip_accounts_and_phones.html.haml
+++ /dev/null
@@ -1,68 +0,0 @@
-%table{:class => 'table table-striped'}
- %tr
- %th
- %th= t("sip_accounts.index.page_title")
- %th= t("phones.index.page_title")
-
- - 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
- %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_phones_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
- %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')
- = 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)
- - if sip_account.phone_numbers.any?
- = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']'
- - else
- = "-"
-
- %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
- = '-'
diff --git a/app/views/tenants/_table_of_automatic_call_distributors.html.haml b/app/views/tenants/_table_of_automatic_call_distributors.html.haml
new file mode 100644
index 0000000..22796af
--- /dev/null
+++ b/app/views/tenants/_table_of_automatic_call_distributors.html.haml
@@ -0,0 +1,8 @@
+- cache(['tenant_show_table_of_automatic_call_distributors', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do
+ -# AutomaticCallDistributors
+ -#
+ - if (can?( :index, AutomaticCallDistributor ) && tenant.automatic_call_distributors.count > 0 ) || can?( :create, AutomaticCallDistributor )
+ %h2= t('automatic_call_distributors.index.page_title')
+ - if can?( :index, AutomaticCallDistributor ) && tenant.automatic_call_distributors.count > 0
+ = render "automatic_call_distributors/index_core", :automatic_call_distributors => tenant.automatic_call_distributors
+ = 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_callthroughs.html.haml b/app/views/tenants/_table_of_callthroughs.html.haml
new file mode 100644
index 0000000..9cd6bf1
--- /dev/null
+++ b/app/views/tenants/_table_of_callthroughs.html.haml
@@ -0,0 +1,8 @@
+- cache(['tenant_show_table_of_callthroughs', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last]) do
+ -# Callthroughs
+ -#
+ - if (can?( :index, Callthrough ) && tenant.callthroughs.count > 0 ) || can?( :create, Callthrough )
+ %h2= t('callthroughs.index.page_title')
+ - if can?( :index, Callthrough ) && tenant.callthroughs.count > 0
+ = render "callthroughs/index_core", :callthroughs => tenant.callthroughs
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough} \ No newline at end of file
diff --git a/app/views/tenants/_table_of_conferences.html.haml b/app/views/tenants/_table_of_conferences.html.haml
new file mode 100644
index 0000000..9775989
--- /dev/null
+++ b/app/views/tenants/_table_of_conferences.html.haml
@@ -0,0 +1,8 @@
+- cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last]) do
+ -# Conferences
+ -#
+ - if (can?( :index, Conference ) && tenant.conferences.count > 0 ) || can?( :create, Conference )
+ %h2= t('conferences.index.page_title')
+ - if can?( :index, Conference ) && tenant.conferences.count > 0
+ = render "conferences/index_core", :conferences => tenant.conferences
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference} \ 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
deleted file mode 100644
index d7af224..0000000
--- a/app/views/tenants/_table_of_functions.html.haml
+++ /dev/null
@@ -1,53 +0,0 @@
-- cache(['table_of_pbx_features', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do
- %table{:class => 'table table-striped'}
- %tr
- %th
- Funktion
- %th
- Anzahl
- %th
- - cache(['table_of_pbx_features_callthroughs_row', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last]) do
- %tr
- %td
- = t("callthroughs.name")
- %td
- - if tenant.callthroughs.any?
- = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.callthroughs.count.to_s, tenant_callthroughs_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough}
- - cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last]) do
- %tr
- %td
- = t("conferences.name")
- %td
- - if tenant.conferences.any?
-
- = link_to Haml::Engine.new("%i.icon-list").render + ' ' + tenant.conferences.count.to_s, tenant_conferences_path(tenant)
- - else
- = '-'
- %td
- = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference}
- - cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last]) do
- %tr
- %td
- = t("hunt_groups.name")
- %td
- - if tenant.hunt_groups.any?
- = link_to Haml::Engine.new("%i.icon-list").render + ' ' + 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(['table_of_pbx_features_automatic_call_distributors_row', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do
- %tr
- %td
- = t("automatic_call_distributors.name")
- %td
- - if tenant.automatic_call_distributors.any?
- = link_to Haml::Engine.new("%i.icon-list").render + ' ' + 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_hunt_groups.html.haml b/app/views/tenants/_table_of_hunt_groups.html.haml
new file mode 100644
index 0000000..aca570d
--- /dev/null
+++ b/app/views/tenants/_table_of_hunt_groups.html.haml
@@ -0,0 +1,8 @@
+- cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last]) do
+ -# HuntGroups
+ -#
+ - if (can?( :index, HuntGroup ) && tenant.hunt_groups.count > 0 ) || can?( :create, HuntGroup )
+ %h2= t('hunt_groups.index.page_title')
+ - if can?( :index, HuntGroup ) && tenant.hunt_groups.count > 0
+ = render "hunt_groups/index_core", :hunt_groups => tenant.hunt_groups
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup} \ No newline at end of file
diff --git a/app/views/tenants/_table_of_phones.html.haml b/app/views/tenants/_table_of_phones.html.haml
new file mode 100644
index 0000000..e87191d
--- /dev/null
+++ b/app/views/tenants/_table_of_phones.html.haml
@@ -0,0 +1,7 @@
+- cache(['tenant_show_table_of_phones', I18n.locale, tenant, tenant.phones.count, tenant.phones.reorder(:updated_at).last]) do
+ -# Phones
+ -#
+ %h2= t('phones.index.page_title')
+ - if tenant.phones.any?
+ = render "phones/index_core", :phones => tenant.phones
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Phone}
diff --git a/app/views/tenants/_table_of_sip_accounts.html.haml b/app/views/tenants/_table_of_sip_accounts.html.haml
new file mode 100644
index 0000000..34eeb14
--- /dev/null
+++ b/app/views/tenants/_table_of_sip_accounts.html.haml
@@ -0,0 +1,25 @@
+- cache(['tenant_show_table_of_sip_accounts', I18n.locale, tenant, tenant.sip_accounts.count, SipAccount.count, tenant.sip_accounts.reorder(:updated_at).last]) do
+ .row
+ - if GsParameter.get('AUTO_ADMIN_ONLINE_HELP') == true && !SipAccount.any?
+ .span4
+ -# SIP accounts
+ -#
+ %h2= t('sip_accounts.index.page_title')
+ - if tenant.sip_accounts.any?
+ = render "sip_accounts/index_core", :sip_accounts => tenant.sip_accounts
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount}
+
+ .span8
+ .well
+ %p
+ In der #{link_to 'Admin-Doku', page_help_path} finden Sie die Beschreibung wie ein neues Telefon mit einem SIP-Account eingerichtet werden kann. Dazu gibt es auch einen Screencast:
+ = render :partial => 'page/docu/screencast_list', :locals => {:screencast_name => 'firmen_sip_account_und_telefon_anlegen'}
+
+ - else
+ .span12
+ -# SIP accounts
+ -#
+ %h2= t('sip_accounts.index.page_title')
+ - if tenant.sip_accounts.any?
+ = render "sip_accounts/index_core", :sip_accounts => tenant.sip_accounts
+ = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount}
diff --git a/app/views/tenants/show.html.haml b/app/views/tenants/show.html.haml
index 53d3307..818e584 100644
--- a/app/views/tenants/show.html.haml
+++ b/app/views/tenants/show.html.haml
@@ -1,9 +1,16 @@
- content_for :title, @tenant.name
-- if !@tenant.description.blank?
- %p
- %strong= t('tenants.show.description') + ":"
- = @tenant.description
+%table.table.table-striped
+ %tbody
+ %tr
+ %td
+ %strong= t('tenants.show.name') + ":"
+ %td= @tenant.name
+ - if !@tenant.description.blank?
+ %tr
+ %td
+ %strong= t('tenants.show.description') + ":"
+ %td= @tenant.description
= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant }