summaryrefslogtreecommitdiff
path: root/app/views/switchboards
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/switchboards')
-rw-r--r--app/views/switchboards/_current_user_dashboard.html.haml33
-rw-r--r--app/views/switchboards/show.html.haml23
2 files changed, 45 insertions, 11 deletions
diff --git a/app/views/switchboards/_current_user_dashboard.html.haml b/app/views/switchboards/_current_user_dashboard.html.haml
new file mode 100644
index 0000000..8dd75b9
--- /dev/null
+++ b/app/views/switchboards/_current_user_dashboard.html.haml
@@ -0,0 +1,33 @@
+.dashboard
+ - current_user.sip_accounts.each do |sip_account|
+ %table.table.table-striped
+ %thead
+ %tr
+ %td
+ %td
+ Destination
+ %td
+ Start
+ %td{:span => '2'}
+ Caller
+ %tbody
+ - sip_account.call_legs.where(callstate: 'RINGING').each do |call_leg|
+ %tr.warning
+ %td
+ %i.icon-bell
+ %td
+ %span.label.label-info
+ =sip_account.phone_numbers.first.to_s
+ %td=l Time.at(call_leg.start_stamp)
+ %td=call_leg.callee_name
+ %td=call_leg.callee_number
+
+ - sip_account.b_call_legs.where(direction: 'inbound').each do |call_leg|
+ %tr
+ %td
+ %td
+ %span.label.label-info
+ =sip_account.phone_numbers.first.to_s
+ %td=l Time.at(call_leg.start_stamp)
+ %td=call_leg.b_caller_id_name
+ %td=call_leg.b_caller_id_number
diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml
index 2932366..a825806 100644
--- a/app/views/switchboards/show.html.haml
+++ b/app/views/switchboards/show.html.haml
@@ -1,20 +1,21 @@
-- content_for :title, @switchboard.name
+- content_for :title, "Switchboard #{@switchboard.name}"
.row
.span12
- .well.pull-right
- %p
- =current_user
+ = render :partial => "current_user_dashboard", :current_user => current_user
%ul.thumbnails
= render :partial => "switchboard_entries/switchboard_entry", :collection => @switchboard_entries
-- if can? :edit, @switchboard
- .row
- .span12
- %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) }
- %i.icon-edit.icon-white
- %span.hidden-phone
- =t("switchboard_entries.index.page_title")
+ - if can? :edit, @switchboard
+ .row
+ .span12
+ %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) }
+ %i.icon-edit.icon-white
+ %span.hidden-phone
+ =t("switchboard_entries.index.page_title")
+
+ .span6
+
= subscribe_to "/switchboards/#{@switchboard.id}" \ No newline at end of file