summaryrefslogtreecommitdiff
path: root/app/views/sip_accounts
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:01:45 +0100
commitb80bd744ad873f6fc43018bc4bfb90677de167bd (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/sip_accounts
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
Start of GS5.
Diffstat (limited to 'app/views/sip_accounts')
-rw-r--r--app/views/sip_accounts/_form.html.haml7
-rw-r--r--app/views/sip_accounts/_form_core.html.haml12
-rw-r--r--app/views/sip_accounts/_index_core.html.haml28
-rw-r--r--app/views/sip_accounts/edit.html.haml3
-rw-r--r--app/views/sip_accounts/index.html.haml6
-rw-r--r--app/views/sip_accounts/new.html.haml3
-rw-r--r--app/views/sip_accounts/show.html.haml50
7 files changed, 109 insertions, 0 deletions
diff --git a/app/views/sip_accounts/_form.html.haml b/app/views/sip_accounts/_form.html.haml
new file mode 100644
index 0000000..f209bf4
--- /dev/null
+++ b/app/views/sip_accounts/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for([ @parent, @sip_account ]) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('sip_accounts.form.submit') \ No newline at end of file
diff --git a/app/views/sip_accounts/_form_core.html.haml b/app/views/sip_accounts/_form_core.html.haml
new file mode 100644
index 0000000..dbd27fe
--- /dev/null
+++ b/app/views/sip_accounts/_form_core.html.haml
@@ -0,0 +1,12 @@
+.inputs
+ = f.input :auth_name, :as => :string, :label => t('sip_accounts.form.auth_name.label'), :hint => conditional_hint('sip_accounts.form.auth_name.hint')
+ = f.input :password, :as => :string, :label => t('sip_accounts.form.password.label'), :hint => conditional_hint('sip_accounts.form.password.hint')
+ = f.input :caller_name, :as => :string, :label => t('sip_accounts.form.caller_name.label'), :hint => conditional_hint('sip_accounts.form.caller_name.hint')
+ = f.input :voicemail_pin, :as => :string, :label => t('sip_accounts.form.voicemail_pin.label'), :hint => conditional_hint('sip_accounts.form.voicemail_pin.hint')
+ = f.input :call_waiting, :label => t('sip_accounts.form.call_waiting.label'), :hint => conditional_hint('sip_accounts.form.call_waiting.hint')
+ = f.input :clir, :label => t('sip_accounts.form.clir.label'), :hint => conditional_hint('sip_accounts.form.clir.hint')
+ = f.input :clip, :label => t('sip_accounts.form.clip.label'), :hint => conditional_hint('sip_accounts.form.clip.hint')
+ = f.input :hotdeskable, :label => t('sip_accounts.form.hotdeskable.label'), :hint => conditional_hint('sip_accounts.form.hotdeskable.hint')
+ = f.input :clip_no_screening, :label => t('sip_accounts.form.clip_no_screening.label'), :hint => conditional_hint('sip_accounts.form.clip_no_screening.hint')
+ - if CallForward.where(:phone_number_id => @sip_account.phone_number_ids).count == 0 || @sip_account.callforward_rules_act_per_sip_account == true
+ = f.input :callforward_rules_act_per_sip_account, :label => t('sip_accounts.form.callforward_rules_act_per_sip_account.label'), :hint => conditional_hint('sip_accounts.form.callforward_rules_act_per_sip_account.hint')
diff --git a/app/views/sip_accounts/_index_core.html.haml b/app/views/sip_accounts/_index_core.html.haml
new file mode 100644
index 0000000..7f8dcd2
--- /dev/null
+++ b/app/views/sip_accounts/_index_core.html.haml
@@ -0,0 +1,28 @@
+%table
+ %tr
+ %th= t('sip_accounts.index.online')
+ %th= t('sip_accounts.index.caller_name')
+ %th= t('sip_accounts.index.phone_numbers')
+ %th= t('phones.name')
+
+ - reset_cycle
+ - for sip_account in sip_accounts
+ %tr{:class => cycle('odd', 'even')}
+ %td
+ - if sip_account.registration
+ %img{:src => '/assets/icons/phone-down-green-32x.png'}
+ - else
+ %img{:src => '/assets/icons/phone-down-grey-32x.png'}
+ %td
+ = sip_account.caller_name
+ - phone_numbers = sip_account.phone_numbers
+ %td
+ - if sip_account.phone_numbers.count > 0
+ = render 'phone_numbers/listing', :phone_numbers => sip_account.phone_numbers.order(:number)
+ %br
+ = render :partial => 'shared/create_link', :locals => {:parent => sip_account, :child_class => PhoneNumber, :short_link => true}
+
+ %td
+ - sip_account.phones.each do |phone|
+ = link_to phone.to_s, method( :"#{phone.phoneable_type.underscore}_phone_path" ).( phone.phoneable_id, phone )
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => sip_account.sip_accountable, :child => sip_account} \ No newline at end of file
diff --git a/app/views/sip_accounts/edit.html.haml b/app/views/sip_accounts/edit.html.haml
new file mode 100644
index 0000000..c070ff7
--- /dev/null
+++ b/app/views/sip_accounts/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("sip_accounts.edit.page_title")
+
+= render "form"
diff --git a/app/views/sip_accounts/index.html.haml b/app/views/sip_accounts/index.html.haml
new file mode 100644
index 0000000..1131770
--- /dev/null
+++ b/app/views/sip_accounts/index.html.haml
@@ -0,0 +1,6 @@
+- title t("sip_accounts.index.page_title")
+
+- if @sip_accounts.count > 0
+ = render "index_core", :sip_accounts => @sip_accounts
+
+= render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => SipAccount} \ No newline at end of file
diff --git a/app/views/sip_accounts/new.html.haml b/app/views/sip_accounts/new.html.haml
new file mode 100644
index 0000000..9d44680
--- /dev/null
+++ b/app/views/sip_accounts/new.html.haml
@@ -0,0 +1,3 @@
+- title t("sip_accounts.new.page_title")
+
+= render "form"
diff --git a/app/views/sip_accounts/show.html.haml b/app/views/sip_accounts/show.html.haml
new file mode 100644
index 0000000..c6344cd
--- /dev/null
+++ b/app/views/sip_accounts/show.html.haml
@@ -0,0 +1,50 @@
+- title t("sip_accounts.show.page_title")
+
+%p
+ %strong= t('sip_accounts.show.auth_name') + ":"
+ = @sip_account.auth_name
+%p
+ %strong= t('sip_accounts.show.caller_name') + ":"
+ = @sip_account.caller_name
+%p
+ %strong= t('sip_accounts.show.password') + ":"
+ = @sip_account.password
+%p
+ %strong= t('sip_accounts.show.call_waiting') + ":"
+ = @sip_account.call_waiting
+%p
+ %strong= t('sip_accounts.show.clir') + ":"
+ = @sip_account.clir
+%p
+ %strong= t('sip_accounts.show.clip_no_screening') + ":"
+ = @sip_account.clip_no_screening
+%p
+ %strong= t('sip_accounts.show.hotdeskable') + ":"
+ = @sip_account.hotdeskable
+%p
+ %strong= t('sip_accounts.show.callforward_rules_act_per_sip_account') + ":"
+ = @sip_account.callforward_rules_act_per_sip_account
+- if @sip_account.registration.try(:network_ip) && @sip_account.registration.try(:network_port)
+ %p
+ %strong= t('sip_accounts.show.registration') + ":"
+ = "#{@sip_account.registration.network_ip}:#{@sip_account.registration.network_port}"
+- if @sip_account.registration.try(:expires)
+ %p
+ %strong= t('sip_accounts.show.expires') + ":"
+ = "#{@sip_account.registration.try(:expires) - Time.now.to_i} s"
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @sip_account.sip_accountable, :child => @sip_account }
+
+- if @sip_account.phone_numbers.count > 0 || can?(:create, @sip_account.phone_numbers.build)
+ %h2= t('phone_numbers.index.page_title')
+ - if @sip_account.phone_numbers.count > 0
+ = render "phone_numbers/index_core", :phone_numbers => @sip_account.phone_numbers
+ %br
+ = render :partial => 'shared/create_link', :locals => { :parent => @sip_account, :child_class => PhoneNumber }
+
+- if @sip_account.softkeys.count > 0 || can?(:create, @sip_account.softkeys.build)
+ %h2= t("softkeys.index.page_title")
+ - if @sip_account.softkeys.count > 0
+ = render "softkeys/index_core", :softkeys => @sip_account.softkeys
+ %br
+ = render :partial => 'shared/create_link', :locals => { :parent => @sip_account, :child_class => Softkey } \ No newline at end of file