summaryrefslogtreecommitdiff
path: root/app/views/sip_accounts
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/sip_accounts')
-rw-r--r--app/views/sip_accounts/_form_core.html.haml8
-rw-r--r--app/views/sip_accounts/_index_core.html.haml57
-rw-r--r--app/views/sip_accounts/show.html.haml94
3 files changed, 101 insertions, 58 deletions
diff --git a/app/views/sip_accounts/_form_core.html.haml b/app/views/sip_accounts/_form_core.html.haml
index 495ae84..1b96d27 100644
--- a/app/views/sip_accounts/_form_core.html.haml
+++ b/app/views/sip_accounts/_form_core.html.haml
@@ -1,7 +1,11 @@
.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'), :autofocus => true
+ - if @sip_account && @sip_account.new_record?
+ = f.hidden_field :auth_name
+ = f.hidden_field :password
+ - else
+ = 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 :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')
diff --git a/app/views/sip_accounts/_index_core.html.haml b/app/views/sip_accounts/_index_core.html.haml
index 8d9791d..34aac64 100644
--- a/app/views/sip_accounts/_index_core.html.haml
+++ b/app/views/sip_accounts/_index_core.html.haml
@@ -1,26 +1,35 @@
-%table{:class => 'table table-striped'}
- %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')
- %th{:colspan => '3'}
-
- - for sip_account in sip_accounts
+%table.table.table-striped
+ %thead
%tr
- %td
- - if sip_account.registration
- %i.icon-ok
- - else
- %i.icon-thumbs-down
- %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)
+ %th
+ %span.hidden-phone
+ = t('sip_accounts.index.online')
+ %th= t('sip_accounts.index.caller_name')
+ %th
+ %span.hidden-phone
+ = t('sip_accounts.index.phone_numbers')
+ - if sip_accounts.map{ |sip_account| sip_account.phone_sip_accounts.any? }.include?(true)
+ %th
+ %span.hidden-phone
+ = t('phones.name')
- %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
+ %tbody
+ - for sip_account in sip_accounts
+ %tr{:class => (sip_account.registration ? '' : 'warning')}
+ %td
+ - if sip_account.registration
+ %i.icon-ok
+ - else
+ %i.icon-thumbs-down
+ %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)
+ - if sip_accounts.map{ |sip_account| sip_account.phone_sip_accounts.any? }.include?(true)
+ %td
+ %span.hidden-phone
+ - 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}
diff --git a/app/views/sip_accounts/show.html.haml b/app/views/sip_accounts/show.html.haml
index 4f6244f..72e10df 100644
--- a/app/views/sip_accounts/show.html.haml
+++ b/app/views/sip_accounts/show.html.haml
@@ -1,37 +1,67 @@
- content_for :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"
+%table.table.table-striped
+ %tbody
+ %tr
+ %td
+ %strong= t('sip_accounts.show.caller_name') + ":"
+ %td
+ = @sip_account.caller_name
+ %tr
+ %td
+ %strong= t('sip_accounts.show.auth_name') + ":"
+ %td
+ = @sip_account.auth_name
+ %tr
+ %td
+ %strong= t('sip_accounts.show.password') + ":"
+ %td
+ = @sip_account.password
+ %tr
+ %td
+ %strong= t('sip_accounts.show.call_waiting') + ":"
+ %td
+ = @sip_account.call_waiting == true ? t('simple_form.yes') : t('simple_form.no')
+ %tr
+ %td
+ %strong= t('sip_accounts.show.clir') + ":"
+ %td
+ = @sip_account.clir == true ? t('simple_form.yes') : t('simple_form.no')
+ %tr
+ %td
+ %strong= t('sip_accounts.show.clip_no_screening') + ":"
+ %td
+ = @sip_account.clip_no_screening
+ %tr
+ %td
+ %strong= t('sip_accounts.show.hotdeskable') + ":"
+ %td
+ = @sip_account.hotdeskable == true ? t('simple_form.yes') : t('simple_form.no')
+ %tr
+ %td
+ %strong= t('sip_accounts.show.callforward_rules_act_per_sip_account') + ":"
+ %td
+ = @sip_account.callforward_rules_act_per_sip_account == true ? t('simple_form.yes') : t('simple_form.no')
+
+ - if @sip_account.registration.try(:network_ip) && @sip_account.registration.try(:network_port)
+ %tr
+ %td
+ %strong= t('sip_accounts.show.registration') + ":"
+ %td
+ = "#{@sip_account.registration.network_ip}:#{@sip_account.registration.network_port}"
+ - if @sip_account.registration.try(:expires)
+ %tr
+ %td
+ %strong= t('sip_accounts.show.expires') + ":"
+ %td
+ = "#{@sip_account.registration.try(:expires) - Time.now.to_i} s"
+ - if @sip_account.registration.try(:user_agent)
+ %tr
+ %td
+ %strong= t('sip_accounts.show.user_agent') + ":"
+ %td
+ = @sip_account.registration.try(:user_agent)
+
= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @sip_account.sip_accountable, :child => @sip_account }