summaryrefslogtreecommitdiff
path: root/app/views/access_authorizations
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
commiteaad37485fe59d0306c37cc038dda6d210052910 (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/access_authorizations
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
parentb80bd744ad873f6fc43018bc4bfb90677de167bd (diff)
Merge branch 'develop'
Diffstat (limited to 'app/views/access_authorizations')
-rw-r--r--app/views/access_authorizations/_form.html.haml7
-rw-r--r--app/views/access_authorizations/_form_core.html.haml11
-rw-r--r--app/views/access_authorizations/_index_core.html.haml21
-rw-r--r--app/views/access_authorizations/edit.html.haml3
-rw-r--r--app/views/access_authorizations/index.html.haml6
-rw-r--r--app/views/access_authorizations/new.html.haml3
-rw-r--r--app/views/access_authorizations/show.html.haml22
7 files changed, 73 insertions, 0 deletions
diff --git a/app/views/access_authorizations/_form.html.haml b/app/views/access_authorizations/_form.html.haml
new file mode 100644
index 0000000..fa417d9
--- /dev/null
+++ b/app/views/access_authorizations/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([@parent, @access_authorization]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('access_authorizations.form.submit') \ No newline at end of file
diff --git a/app/views/access_authorizations/_form_core.html.haml b/app/views/access_authorizations/_form_core.html.haml
new file mode 100644
index 0000000..10530d7
--- /dev/null
+++ b/app/views/access_authorizations/_form_core.html.haml
@@ -0,0 +1,11 @@
+.inputs
+ = f.input :name, :label => t('access_authorizations.form.name.label'), :hint => conditional_hint('access_authorizations.form.name.hint')
+ = f.input :login, :label => t('access_authorizations.form.login.label'), :hint => conditional_hint('access_authorizations.form.login.hint')
+ = f.input :pin, :label => t('access_authorizations.form.pin.label'), :hint => conditional_hint('access_authorizations.form.pin.hint')
+ - if SipAccount.count < 50
+ = f.association :sip_account, :label => t('callthroughs.form.sip_account.label'), :hint => conditional_hint('callthroughs.form.sip_account.hint')
+ - else
+ = f.input :sip_account_id, :label => t('callthroughs.form.sip_account_id.label'), :hint => conditional_hint('callthroughs.form.sip_account_id.hint')
+
+ = f.simple_fields_for :phone_numbers do |phone_number|
+ = render "phone_numbers/form_core", :f => phone_number \ No newline at end of file
diff --git a/app/views/access_authorizations/_index_core.html.haml b/app/views/access_authorizations/_index_core.html.haml
new file mode 100644
index 0000000..083b16b
--- /dev/null
+++ b/app/views/access_authorizations/_index_core.html.haml
@@ -0,0 +1,21 @@
+%table
+ %tr
+ %th= t('access_authorizations.index.name')
+ %th= t('access_authorizations.index.login')
+ %th= t('access_authorizations.index.pin')
+ %th= t('callthroughs.index.phone_numbers')
+
+ - reset_cycle
+ - for access_authorization in access_authorizations
+ - show_path_method = method( :"#{access_authorization.access_authorizationable.class.name.underscore}_access_authorization_path" )
+ - edit_path_method = method( :"edit_#{access_authorization.access_authorizationable.class.name.underscore}_access_authorization_path" )
+ %tr{:class => cycle('odd', 'even')}
+ %td= access_authorization.name
+ %td= access_authorization.login
+ %td= access_authorization.pin
+ %td
+ =render 'phone_numbers/listing', :phone_numbers => access_authorization.phone_numbers
+ - if access_authorization.phone_numbers.count > 0
+ %br
+ = link_to t('phone_numbers.index.actions.create'), new_access_authorization_phone_number_path(access_authorization)
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => access_authorization.access_authorizationable, :child => access_authorization} \ No newline at end of file
diff --git a/app/views/access_authorizations/edit.html.haml b/app/views/access_authorizations/edit.html.haml
new file mode 100644
index 0000000..414f094
--- /dev/null
+++ b/app/views/access_authorizations/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("access_authorizations.edit.page_title")
+
+= render "form"
diff --git a/app/views/access_authorizations/index.html.haml b/app/views/access_authorizations/index.html.haml
new file mode 100644
index 0000000..05b27db
--- /dev/null
+++ b/app/views/access_authorizations/index.html.haml
@@ -0,0 +1,6 @@
+- title t("access_authorizations.index.page_title")
+
+- if @access_authorizations.count > 0
+ = render "index_core", :access_authorizations => @access_authorizations
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => AccessAuthorization} \ No newline at end of file
diff --git a/app/views/access_authorizations/new.html.haml b/app/views/access_authorizations/new.html.haml
new file mode 100644
index 0000000..0bbf16c
--- /dev/null
+++ b/app/views/access_authorizations/new.html.haml
@@ -0,0 +1,3 @@
+- title t("access_authorizations.new.page_title")
+
+= render "form"
diff --git a/app/views/access_authorizations/show.html.haml b/app/views/access_authorizations/show.html.haml
new file mode 100644
index 0000000..17d1d9b
--- /dev/null
+++ b/app/views/access_authorizations/show.html.haml
@@ -0,0 +1,22 @@
+- title t("access_authorizations.show.page_title")
+
+%p
+ %strong= t('access_authorizations.show.name') + ":"
+ = @access_authorization.name
+%p
+ %strong= t('access_authorizations.show.login') + ":"
+ = @access_authorization.login
+%p
+ %strong= t('access_authorizations.show.pin') + ":"
+ = @access_authorization.pin
+%p
+ %strong= t('access_authorizations.show.sip_account_id') + ":"
+ = @access_authorization.sip_account || t('access_authorizations.none')
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @parent, :child => @access_authorization }
+
+%h2= t('callthroughs.form.phone_numbers.label')
+- if @access_authorization.phone_numbers.count > 0
+ = render 'phone_numbers/index_core', :phone_numbers => @access_authorization.phone_numbers
+ %br
+= render :partial => 'shared/create_link', :locals => {:parent => @access_authorization, :child_class => PhoneNumber} \ No newline at end of file