From 3a0ea10cdd6084a8beb235f5c1573c22a5d733f0 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 14 Mar 2013 20:21:59 +0100 Subject: Added a dashboard for Switchboard. --- .../_switchboard_entry.html.haml | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'app/views/switchboard_entries') diff --git a/app/views/switchboard_entries/_switchboard_entry.html.haml b/app/views/switchboard_entries/_switchboard_entry.html.haml index b2b6bff..8d4ee92 100644 --- a/app/views/switchboard_entries/_switchboard_entry.html.haml +++ b/app/views/switchboard_entries/_switchboard_entry.html.haml @@ -12,16 +12,22 @@ %small = truncate(switchboard_entry.to_s, :length => 10) %br - - if !switchboard_entry.sip_account.registration - %span.label.label-inverse - %i.icon-ban-circle.icon-white - - else - - if switchboard_entry.sip_account.call_legs(:where => ["HELD", "ACTIVE"]).size != 0 - %span.label.label-success - %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.phone_numbers.any? %span.label - = switchboard_entry.sip_account.phone_numbers.first.number + = switchboard_entry.sip_account.phone_numbers.first.number + + %br + + - if switchboard_entry.sip_account.registration + - switchboard_entry.sip_account.calls.each do |call| + - if call.callstate == 'RINGING' + %span.label.label-info + %i.icon-bell.icon-white + = "from #{call.callee_number}" + + - if call.callstate == 'EARLY' + %span.label.label-info + = "calls #{call.destination}" + - else + %span.label.label-inverse + %i.icon-ban-circle.icon-white -- cgit v1.2.3 From 0b4e3dfd031b21c26f7bc9c7c05cd931950ecbd6 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 14 Mar 2013 21:34:06 +0100 Subject: Switchboard stuff --- .../_switchboard_entry.html.haml | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'app/views/switchboard_entries') diff --git a/app/views/switchboard_entries/_switchboard_entry.html.haml b/app/views/switchboard_entries/_switchboard_entry.html.haml index 8d4ee92..b82bb74 100644 --- a/app/views/switchboard_entries/_switchboard_entry.html.haml +++ b/app/views/switchboard_entries/_switchboard_entry.html.haml @@ -1,16 +1,16 @@ -%li.span1{:id => "switchboard_entry_id_#{switchboard_entry.id}"} +%li.span2{:id => "switchboard_entry_id_#{switchboard_entry.id}"} %div.thumbnail %a.thumbnail{:href => tenant_user_path(switchboard_entry.sip_account.sip_accountable.current_tenant, switchboard_entry.sip_account.sip_accountable)} - if switchboard_entry.sip_account.sip_accountable.image? - = image_tag(switchboard_entry.sip_account.sip_accountable.image_url(:small).to_s, :class => 'img-rounded') + = image_tag(switchboard_entry.sip_account.sip_accountable.image_url(:profile).to_s, :class => 'img-rounded', :style => 'width: 100px;') - else - if switchboard_entry.sip_account.sip_accountable.male? - = image_tag 'icons/user-male-16x.png', :class => 'img-rounded' + = image_tag('icons/user-male-16x.png', :class => 'img-rounded', :style => 'width: 100px;') - else - = image_tag 'icons/user-female-16x.png', :class => 'img-rounded' + = image_tag('icons/user-female-16x.png', :class => 'img-rounded', :style => 'width: 100px;') %p %small - = truncate(switchboard_entry.to_s, :length => 10) + = truncate(switchboard_entry.to_s, :length => 23) %br - if switchboard_entry.sip_account.phone_numbers.any? %span.label @@ -19,15 +19,23 @@ %br - if switchboard_entry.sip_account.registration - - switchboard_entry.sip_account.calls.each do |call| - - if call.callstate == 'RINGING' - %span.label.label-info - %i.icon-bell.icon-white - = "from #{call.callee_number}" + - switchboard_entry.sip_account.call_legs.where(callstate: 'RINGING').each do |call_leg| + %span.label.label-warning + %i.icon-bell.icon-white + = "#{call_leg.caller_id_number}" + + - switchboard_entry.sip_account.call_legs.where(callstate: 'EARLY').each do |call_leg| + %span.label.label-info + = "calls #{call_leg.destination}" + + - switchboard_entry.sip_account.call_legs.where(callstate: 'ACTIVE').each do |call_leg| + %span.label.label-info + = "#{call_leg.b_caller_id_number} => #{call_leg.callee_number}" + + - switchboard_entry.sip_account.b_call_legs.where(b_callstate: 'ACTIVE').each do |b_call_leg| + %span.label.label-info + = "#{b_call_leg.b_caller_id_number} => #{b_call_leg.destination}" - - if call.callstate == 'EARLY' - %span.label.label-info - = "calls #{call.destination}" - else %span.label.label-inverse %i.icon-ban-circle.icon-white -- cgit v1.2.3 From 5ed3837a8688e46a33d3ad3b0eb0343eb1a5ba85 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 14 Mar 2013 21:41:33 +0100 Subject: Switchboard UI improvements. --- app/views/switchboard_entries/_switchboard_entry.html.haml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/views/switchboard_entries') diff --git a/app/views/switchboard_entries/_switchboard_entry.html.haml b/app/views/switchboard_entries/_switchboard_entry.html.haml index b82bb74..8c44153 100644 --- a/app/views/switchboard_entries/_switchboard_entry.html.haml +++ b/app/views/switchboard_entries/_switchboard_entry.html.haml @@ -12,7 +12,7 @@ %small = truncate(switchboard_entry.to_s, :length => 23) %br - - if switchboard_entry.sip_account.phone_numbers.any? + - if switchboard_entry.sip_account.phone_numbers.any? && !switchboard_entry.sip_account.call_legs.where(callstate: 'ACTIVE').any? && !switchboard_entry.sip_account.b_call_legs.where(b_callstate: 'ACTIVE').any? %span.label = switchboard_entry.sip_account.phone_numbers.first.number @@ -29,12 +29,16 @@ = "calls #{call_leg.destination}" - switchboard_entry.sip_account.call_legs.where(callstate: 'ACTIVE').each do |call_leg| + %span.label + = "#{switchboard_entry.sip_account.phone_numbers.first.number} => " %span.label.label-info - = "#{call_leg.b_caller_id_number} => #{call_leg.callee_number}" + = "#{call_leg.callee_number}" - switchboard_entry.sip_account.b_call_legs.where(b_callstate: 'ACTIVE').each do |b_call_leg| %span.label.label-info - = "#{b_call_leg.b_caller_id_number} => #{b_call_leg.destination}" + = "#{b_call_leg.b_caller_id_number} =>" + %span.label + = switchboard_entry.sip_account.phone_numbers.first.number - else %span.label.label-inverse -- cgit v1.2.3