summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-05 01:44:21 -0500
committerPeter Kozak <spag@golwen.net>2013-03-05 01:44:21 -0500
commitef4bb3de4a23e0a4068c46caf05e2150e9922b71 (patch)
tree3a1e76d4c16ab12360da9a7eea9dee22c3f3ef61 /app
parent45fe4f5022f7181aa5d6e66f03ba3c8cf281879a (diff)
display last missed call on idle screen
Diffstat (limited to 'app')
-rw-r--r--app/views/config_polycom/idle_screen.xml.haml17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/views/config_polycom/idle_screen.xml.haml b/app/views/config_polycom/idle_screen.xml.haml
index fa52c4f..f6d8cf9 100644
--- a/app/views/config_polycom/idle_screen.xml.haml
+++ b/app/views/config_polycom/idle_screen.xml.haml
@@ -3,5 +3,18 @@
%head
%title= @sip_account.caller_name
%body
- - @sip_account.phone_numbers.each do |number|
- %br= number.number
+ - phone_numbers = @sip_account.phone_numbers.order(:position)
+ - if phone_numbers[0]
+ %strong= phone_numbers[0].number
+ - else
+ %strong= sip_account.to_s
+ - if phone_numbers[1]
+ %strong= phone_numbers[1].number
+ - if phone_numbers[2]
+ %strong= phone_numbers[2].number
+ - if phone_numbers[3]
+ %strong ...
+ - call = @sip_account.call_histories.where(:entry_type => 'missed').order('start_stamp DESC').first
+ %p
+ Missed:
+ %br= "#{call.start_stamp.strftime('%d.%m %H:%M')} #{call.display_name} #{call.display_number}"