summaryrefslogtreecommitdiff
path: root/app/views/tenants
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-20 20:57:35 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-20 20:57:35 +0100
commit4e67f8769a3a3199bfb5b363fe9baa231c329a2b (patch)
tree3479e67255b6612e1eca50245bb886680d305eb7 /app/views/tenants
parenta2abe7dffb8fe31687910ca4be6dc0374a247d00 (diff)
Refactoring
Diffstat (limited to 'app/views/tenants')
-rw-r--r--app/views/tenants/_admin_area.de.html.haml32
-rw-r--r--app/views/tenants/_admin_area.html.haml24
-rw-r--r--app/views/tenants/show.html.haml4
3 files changed, 15 insertions, 45 deletions
diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml
deleted file mode 100644
index 6a4bef9..0000000
--- a/app/views/tenants/_admin_area.de.html.haml
+++ /dev/null
@@ -1,32 +0,0 @@
-= 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 manufacturer, manufacturer_path(manufacturer)
- - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ' und ' do
- =link_to manufacturer, manufacturer_path(manufacturer)
- - else
- = succeed '.' do
- =link_to manufacturer, manufacturer_path(manufacturer)
-
-= 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 b974c02..7e7e46b 100644
--- a/app/views/tenants/_admin_area.html.haml
+++ b/app/views/tenants/_admin_area.html.haml
@@ -1,30 +1,32 @@
-= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant}
+= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => tenant}
-= render :partial => 'users_table', :locals => {:tenant => @tenant}
+= render :partial => 'users_table', :locals => {:tenant => tenant}
-= render :partial => 'user_groups_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_functions', :locals => {:tenant => tenant}
-= render :partial => 'tenants/table_of_phone_books', :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 Gemeinschaft Konfiguration
+= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => tenant}
%p
- This system can setup
+ Das System kann
= PhoneModel.count
- different phone models from the manufacturers
+ 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 manufacturer, manufacturer_path(manufacturer)
- elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last
- = succeed ' and ' do
+ = succeed ' und ' do
=link_to manufacturer, manufacturer_path(manufacturer)
- else
= 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, :gateways => gateways} \ No newline at end of file
diff --git a/app/views/tenants/show.html.haml b/app/views/tenants/show.html.haml
index f5cff5f..9b9d4ec 100644
--- a/app/views/tenants/show.html.haml
+++ b/app/views/tenants/show.html.haml
@@ -7,5 +7,5 @@
= 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
+- if @tenant.user_groups.where(:name => 'Admins').any? && @tenant.user_groups.where(:name => 'Admins').first.users.include?(current_user)
+ = render :partial => 'admin_area', :locals => { :tenant => @tenant, :gateways => @gateways} \ No newline at end of file