summaryrefslogtreecommitdiff
path: root/app/views/tenants
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-23 10:40:33 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-23 10:40:33 +0100
commite4da52d673f12673614f7f9303ad384c77dbc37c (patch)
tree445a69f7b2ae1432179ba8e6c77ab633f3b1af97 /app/views/tenants
parent7b745a37f1729052e2278cbb10ac6d43484b94a3 (diff)
Improved UI for tenant#show
Diffstat (limited to 'app/views/tenants')
-rw-r--r--app/views/tenants/_admin_area.html.haml9
-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.haml56
-rw-r--r--app/views/tenants/_table_of_hunt_groups.html.haml8
6 files changed, 39 insertions, 58 deletions
diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml
index d634f73..1a05264 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -16,8 +16,13 @@
= render :partial => 'user_groups_table', :locals => {:tenant => tenant}
-%h2 Features
-= render :partial => 'tenants/table_of_functions', :locals => {:tenant => tenant}
+= 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/table_of_phone_books', :locals => {:tenant => tenant}
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 3587eb8..0000000
--- a/app/views/tenants/_table_of_functions.html.haml
+++ /dev/null
@@ -1,56 +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'}
- %thead
- %tr
- %th
- Funktion
- %th
- Anzahl
- %th
-
- %tbody
- - 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