summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 18:32:13 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-10 18:32:13 +0100
commitb9aeac77779f7a9ae0e51b8d95adc7d542e09ece (patch)
tree7bdec18d5bc3f45cd924aa01d351d0c1ea8179c1
parent3004ad318aecab81d8d3fb451901efc4d485e9ab (diff)
Small fixes.
-rw-r--r--app/views/switchboard_entries/_index_core.html.haml19
-rw-r--r--app/views/switchboard_entries/_switchboard_entry.html.haml11
-rw-r--r--app/views/users/_switchboards.html.haml2
3 files changed, 14 insertions, 18 deletions
diff --git a/app/views/switchboard_entries/_index_core.html.haml b/app/views/switchboard_entries/_index_core.html.haml
index 406db71..d647626 100644
--- a/app/views/switchboard_entries/_index_core.html.haml
+++ b/app/views/switchboard_entries/_index_core.html.haml
@@ -5,12 +5,13 @@
%th= t('switchboard_entries.index.name')
%th
- %tbody{ :id => "switchboard_entries", :'data-update-url' => sort_switchboard_switchboard_entries_path(switchboard_entries.first.switchboard) }
- - for switchboard_entry in switchboard_entries
- = content_tag_for :tr, switchboard_entry do
- %td
- %span.handle
- %i.icon-resize-vertical
- %td= switchboard_entry.sip_account
- %td= switchboard_entry.name
- =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => switchboard_entry.switchboard, :child => switchboard_entry} \ No newline at end of file
+ - if switchboard_entries.any?
+ %tbody{ :id => "switchboard_entries", :'data-update-url' => sort_switchboard_switchboard_entries_path(switchboard_entries.first.switchboard) }
+ - for switchboard_entry in switchboard_entries
+ = content_tag_for :tr, switchboard_entry do
+ %td
+ %span.handle
+ %i.icon-resize-vertical
+ %td= switchboard_entry.sip_account
+ %td= switchboard_entry.name
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => switchboard_entry.switchboard, :child => switchboard_entry} \ No newline at end of file
diff --git a/app/views/switchboard_entries/_switchboard_entry.html.haml b/app/views/switchboard_entries/_switchboard_entry.html.haml
index 5608757..8d8e747 100644
--- a/app/views/switchboard_entries/_switchboard_entry.html.haml
+++ b/app/views/switchboard_entries/_switchboard_entry.html.haml
@@ -21,12 +21,7 @@
%i.icon-user.icon-white
- if switchboard_entry.sip_account.call_legs(:where => ["RINGING"]).size != 0
%span.label.label-info
- %i.icon-bell.icon-white
- - if switchboard_entry.sip_account.non_e164_phone_numbers.size == 0
- - phone_numbers = switchboard_entry.sip_account.phone_numbers
- - else
- - phone_numbers = switchboard_entry.sip_account.non_e164_phone_numbers
-
- - phone_numbers.each do |phone_number|
+ %i.icon-bell.icon-white
+ - if switchboard_entry.sip_account.phone_numbers.any?
%span.label
- = phone_number.number
+ = switchboard_entry.sip_account.phone_numbers.first.number
diff --git a/app/views/users/_switchboards.html.haml b/app/views/users/_switchboards.html.haml
index 8dca15f..183b6ae 100644
--- a/app/views/users/_switchboards.html.haml
+++ b/app/views/users/_switchboards.html.haml
@@ -1,6 +1,6 @@
-# Switchboards
-#
-- if (can?( :index, Switchboard ) && user.switchboards.any? ) || can?( :create, Switchboard )
+- if SipAccount.any? && (can?( :index, Switchboard ) && user.switchboards.any? ) || can?( :create, Switchboard )
%h2= t('switchboards.index.page_title')
- if can?( :index, Switchboard ) && user.switchboards.count > 0
= render :partial => "switchboards/index_core", :locals => {:switchboards => user.switchboards, :user => user}