summaryrefslogtreecommitdiff
path: root/app/views/switchboards
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-25 10:27:27 +0100
commitdf6e17e48995f25e72509986f30700d778b179b6 (patch)
treef432c24b8e4ad81009188650dabfd99194883265 /app/views/switchboards
parent11f186a118285fbc87a536af26730780a9ad01f5 (diff)
parentcce94a74aa5c9691f9b37cd9be5a6831f8063812 (diff)
Merge branch 'develop'5.1.2
Diffstat (limited to 'app/views/switchboards')
-rw-r--r--app/views/switchboards/_current_user_dashboard.html.haml33
-rw-r--r--app/views/switchboards/_form.html.haml7
-rw-r--r--app/views/switchboards/_form_core.html.haml2
-rw-r--r--app/views/switchboards/_index_core.html.haml10
-rw-r--r--app/views/switchboards/edit.html.haml12
-rw-r--r--app/views/switchboards/index.html.haml8
-rw-r--r--app/views/switchboards/new.html.haml3
-rw-r--r--app/views/switchboards/show.html.haml21
8 files changed, 96 insertions, 0 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/_form.html.haml b/app/views/switchboards/_form.html.haml
new file mode 100644
index 0000000..bb09713
--- /dev/null
+++ b/app/views/switchboards/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@user, @switchboard]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .form-actions
+ = f.button :submit, conditional_t('switchboards.form.submit')
diff --git a/app/views/switchboards/_form_core.html.haml b/app/views/switchboards/_form_core.html.haml
new file mode 100644
index 0000000..61b5934
--- /dev/null
+++ b/app/views/switchboards/_form_core.html.haml
@@ -0,0 +1,2 @@
+.inputs
+ = f.input :name, :label => t('switchboards.form.name.label'), :hint => conditional_hint('switchboards.form.name.hint'), :autofocus => true
diff --git a/app/views/switchboards/_index_core.html.haml b/app/views/switchboards/_index_core.html.haml
new file mode 100644
index 0000000..858f624
--- /dev/null
+++ b/app/views/switchboards/_index_core.html.haml
@@ -0,0 +1,10 @@
+%table.table.table-striped
+ %tr
+ %th= t('switchboards.index.name')
+ %th
+
+
+ - for switchboard in switchboards
+ %tr
+ %td= switchboard.name
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user, :child => switchboard} \ No newline at end of file
diff --git a/app/views/switchboards/edit.html.haml b/app/views/switchboards/edit.html.haml
new file mode 100644
index 0000000..f2e69f4
--- /dev/null
+++ b/app/views/switchboards/edit.html.haml
@@ -0,0 +1,12 @@
+- content_for :title, t("switchboards.edit.page_title")
+
+.row
+ .span12
+ = render "form"
+
+.row
+ .span12
+ - if @switchboard.switchboard_entries && @switchboard.switchboard_entries.count > 0
+ = render "switchboard_entries/index_core", :switchboard_entries => @switchboard.switchboard_entries
+
+ = render :partial => 'shared/create_link', :locals => {:parent => @switchboard, :child_class => SwitchboardEntry} \ No newline at end of file
diff --git a/app/views/switchboards/index.html.haml b/app/views/switchboards/index.html.haml
new file mode 100644
index 0000000..4f29d7d
--- /dev/null
+++ b/app/views/switchboards/index.html.haml
@@ -0,0 +1,8 @@
+- content_for :title, t("switchboards.index.page_title")
+
+.row
+ .span6
+ - if @switchboards && @switchboards.count > 0
+ = render :partial => "index_core", :locals => {:switchboards => @switchboards, :user => @user}
+
+ = render :partial => 'shared/create_link', :locals => {:parent => @user, :child_class => Switchboard} \ No newline at end of file
diff --git a/app/views/switchboards/new.html.haml b/app/views/switchboards/new.html.haml
new file mode 100644
index 0000000..9f5918f
--- /dev/null
+++ b/app/views/switchboards/new.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("switchboards.new.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml
new file mode 100644
index 0000000..a825806
--- /dev/null
+++ b/app/views/switchboards/show.html.haml
@@ -0,0 +1,21 @@
+- content_for :title, "Switchboard #{@switchboard.name}"
+
+.row
+ .span12
+ = 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")
+
+ .span6
+
+
+= subscribe_to "/switchboards/#{@switchboard.id}" \ No newline at end of file