summaryrefslogtreecommitdiff
path: root/app/views/switchboards
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/switchboards')
-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.haml3
-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.haml45
7 files changed, 78 insertions, 0 deletions
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..1ab0efe
--- /dev/null
+++ b/app/views/switchboards/edit.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("switchboards.edit.page_title")
+
+= render "form" \ 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..b81980c
--- /dev/null
+++ b/app/views/switchboards/show.html.haml
@@ -0,0 +1,45 @@
+- content_for :title, @switchboard.name
+
+
+.row
+ .span12
+ .well.pull-right
+ %p
+ =current_user
+
+ %ul.thumbnails
+ - @switchboard.switchboard_entries.each do |switchboard_entry|
+ %li.span1
+ %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(:mini).to_s, :class => 'img-rounded')
+ - else
+ - if switchboard_entry.sip_account.sip_accountable.male?
+ = image_tag 'icons/user-male-16x.png', :class => 'img-rounded'
+ - else
+ = image_tag 'icons/user-female-16x.png', :class => 'img-rounded'
+ %p
+ %small
+ = truncate(switchboard_entry.to_s, :length => 10)
+ %span{:class => "label #{(switchboard_entry.sip_account.registration ? '' : 'label-inverse')}"}
+ - if !switchboard_entry.sip_account.registration
+ %i.icon-ban-circle.icon-white
+ - if switchboard_entry.sip_account.phone_numbers.count > 1
+ - phone_numbers = []
+ - switchboard_entry.sip_account.phone_numbers.order(:position).each do |phone_number|
+ - if phone_number.number.length < 6
+ - phone_numbers << phone_number
+ - if phone_numbers.size == 0
+ - phone_numbers = switchboard_entry.sip_account.phone_numbers.order(:position)
+ - else
+ - phone_numbers = switchboard_entry.sip_account.phone_numbers
+ = render 'phone_numbers/listing', :phone_numbers => phone_numbers
+
+- 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")