summaryrefslogtreecommitdiff
path: root/app/views/callthroughs
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/callthroughs')
-rw-r--r--app/views/callthroughs/_form.html.haml7
-rw-r--r--app/views/callthroughs/_form_core.html.haml24
-rw-r--r--app/views/callthroughs/_index_core.html.haml17
-rw-r--r--app/views/callthroughs/edit.html.haml3
-rw-r--r--app/views/callthroughs/index.html.haml6
-rw-r--r--app/views/callthroughs/new.html.haml3
-rw-r--r--app/views/callthroughs/show.html.haml27
7 files changed, 87 insertions, 0 deletions
diff --git a/app/views/callthroughs/_form.html.haml b/app/views/callthroughs/_form.html.haml
new file mode 100644
index 0000000..99f92d0
--- /dev/null
+++ b/app/views/callthroughs/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@tenant, @callthrough]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('callthroughs.form.submit')
diff --git a/app/views/callthroughs/_form_core.html.haml b/app/views/callthroughs/_form_core.html.haml
new file mode 100644
index 0000000..1f137d9
--- /dev/null
+++ b/app/views/callthroughs/_form_core.html.haml
@@ -0,0 +1,24 @@
+.inputs
+ = f.input :name, :label => t('callthroughs.form.name.label'), :hint => conditional_hint('callthroughs.form.name.hint')
+
+ %h2= t('callthroughs.form.phone_numbers.label')
+ - if !t('callthroughs.form.phone_numbers.hint').blank?
+ %p= t('callthroughs.form.phone_numbers.hint')
+ = f.simple_fields_for :phone_numbers do |phone_number|
+ = render "phone_numbers/form_core", :f => phone_number
+ %p
+
+ - if @callthrough && @callthrough.access_authorizations.size > 0
+ %h2= t('callthroughs.form.access_authorizations.label')
+ - if !t('callthroughs.form.access_authorizations.hint').blank?
+ %p= t('callthroughs.form.access_authorizations.hint')
+ = f.simple_fields_for :access_authorizations do |access_authorization|
+ = render "access_authorizations/form_core", :f => access_authorization
+
+ - if CALLTHROUGH_HAS_WHITELISTS == true
+ - if @callthrough && @callthrough.whitelists.size > 0
+ %h2= t('callthroughs.form.whitelists.label')
+ - if !t('callthroughs.form.whitelists.hint').blank?
+ %p= t('callthroughs.form.whitelists.hint')
+ = f.simple_fields_for :whitelists do |whitelist|
+ = render "whitelists/form_core", :f => whitelist
diff --git a/app/views/callthroughs/_index_core.html.haml b/app/views/callthroughs/_index_core.html.haml
new file mode 100644
index 0000000..f1802d4
--- /dev/null
+++ b/app/views/callthroughs/_index_core.html.haml
@@ -0,0 +1,17 @@
+%table
+ %tr
+ %th= t('callthroughs.index.name')
+ %th= t('callthroughs.index.phone_numbers')
+ %th= t('callthroughs.index.access_authorized_phone_numbers')
+ - if CALLTHROUGH_HAS_WHITELISTS == true
+ %th= t('callthroughs.index.whitelist_phone_numbers')
+
+ - reset_cycle
+ - for callthrough in callthroughs
+ %tr{:class => cycle('odd', 'even')}
+ %td= callthrough.name
+ %td=render 'phone_numbers/listing', :phone_numbers => callthrough.phone_numbers
+ %td=render 'phone_numbers/listing', :phone_numbers => callthrough.access_authorization_phone_numbers
+ - if CALLTHROUGH_HAS_WHITELISTS == true
+ %td=render 'phone_numbers/listing', :phone_numbers => callthrough.whitelisted_phone_numbers
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => callthrough.tenant, :child => callthrough} \ No newline at end of file
diff --git a/app/views/callthroughs/edit.html.haml b/app/views/callthroughs/edit.html.haml
new file mode 100644
index 0000000..44fe17e
--- /dev/null
+++ b/app/views/callthroughs/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("callthroughs.edit.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/callthroughs/index.html.haml b/app/views/callthroughs/index.html.haml
new file mode 100644
index 0000000..c595351
--- /dev/null
+++ b/app/views/callthroughs/index.html.haml
@@ -0,0 +1,6 @@
+- title t("callthroughs.index.page_title")
+
+- if @callthroughs.count > 0
+ = render "index_core", :callthroughs => @callthroughs
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => Callthrough} \ No newline at end of file
diff --git a/app/views/callthroughs/new.html.haml b/app/views/callthroughs/new.html.haml
new file mode 100644
index 0000000..ff47c1c
--- /dev/null
+++ b/app/views/callthroughs/new.html.haml
@@ -0,0 +1,3 @@
+- title t("callthroughs.new.page_title")
+
+= render "form"
diff --git a/app/views/callthroughs/show.html.haml b/app/views/callthroughs/show.html.haml
new file mode 100644
index 0000000..55bd6eb
--- /dev/null
+++ b/app/views/callthroughs/show.html.haml
@@ -0,0 +1,27 @@
+- title t("callthroughs.show.page_title")
+
+%p
+ %strong= t('callthroughs.show.name') + ":"
+ = @callthrough.name
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @callthrough.tenant, :child => @callthrough }
+
+
+%h2= t('callthroughs.form.phone_numbers.label')
+- if @callthrough.phone_numbers.count > 0
+ = render 'phone_numbers/index_core', :phone_numbers => @callthrough.phone_numbers
+ %br
+= render :partial => 'shared/create_link', :locals => {:parent => @callthrough, :child_class => PhoneNumber}
+
+%h2= t('callthroughs.form.access_authorizations.label')
+- if @callthrough.access_authorizations.count > 0
+ = render 'access_authorizations/index_core', :access_authorizations => @callthrough.access_authorizations
+ %br
+= render :partial => 'shared/create_link', :locals => {:parent => @callthrough, :child_class => AccessAuthorization}
+
+- if CALLTHROUGH_HAS_WHITELISTS == true
+ %h2= t('callthroughs.form.whitelists.label')
+ - if @callthrough.whitelisted_phone_numbers.count > 0
+ = render 'whitelists/index_core', :whitelists => @callthrough.whitelists
+ %br
+ = render :partial => 'shared/create_link', :locals => {:parent => @callthrough, :child_class => Whitelist} \ No newline at end of file