diff options
author | Peter Kozak <spag@golwen.net> | 2013-02-25 09:29:40 -0500 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-02-25 09:29:40 -0500 |
commit | 0442cd19bc9383669b506185356227361a16e442 (patch) | |
tree | fd6c9f9220ace7a58bd723e9a7103834a695770c /app/views | |
parent | 5dcdeb1c1f8c53fd80a0443d61a289e583091416 (diff) |
call_forwards - polymorphism added
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/call_forwards/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/call_forwards/_index_core.html.haml | 14 | ||||
-rw-r--r-- | app/views/call_forwards/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/call_forwards/show.html.haml | 24 | ||||
-rw-r--r-- | app/views/gs_nodes/sync.xml.haml | 2 | ||||
-rw-r--r-- | app/views/sip_accounts/_form_core.html.haml | 2 |
6 files changed, 22 insertions, 24 deletions
diff --git a/app/views/call_forwards/_form.html.haml b/app/views/call_forwards/_form.html.haml index 58ffd78..1944fc4 100644 --- a/app/views/call_forwards/_form.html.haml +++ b/app/views/call_forwards/_form.html.haml @@ -1,4 +1,4 @@ -= simple_form_for([ @phone_number, @call_forward ]) do |f| += simple_form_for([ @parent, @call_forward ]) do |f| = f.error_notification = render "form_core", :f => f diff --git a/app/views/call_forwards/_index_core.html.haml b/app/views/call_forwards/_index_core.html.haml index 878e0e2..48afa54 100644 --- a/app/views/call_forwards/_index_core.html.haml +++ b/app/views/call_forwards/_index_core.html.haml @@ -2,7 +2,7 @@ %thead %tr - if !@phone_number - %th= t('call_forwards.index.phone_number_id') + %th= t('call_forwards.index.call_forwardable') %th= t('call_forwards.index.call_forward_case_id') %th= t('call_forwards.index.timeout') %th= t('call_forwards.index.destination') @@ -15,18 +15,18 @@ - for call_forward in call_forwards %tr - if !@phone_number - %td= call_forward.phone_number + %td= call_forward.call_forwardable %td= t("call_forward_cases.#{call_forward.call_forward_case.value}") %td= call_forward.timeout %td = call_forward.destination - - if call_forward.call_forwardable_type + - if call_forward.destinationable_type %br - = call_forward.call_forwardable_type - - if call_forward.call_forwardable - = ": #{call_forward.call_forwardable}" + = call_forward.destinationable_type + - if call_forward.destinationable_id + = ": #{call_forward.destinationable}" %td= call_forward.source - if GuiFunction.display?('depth_field_value_in_index_table', current_user) %td= call_forward.depth %td= call_forward.active - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => call_forward.phone_number, :child => call_forward}
\ No newline at end of file + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => call_forward.call_forwardable, :child => call_forward}
\ No newline at end of file diff --git a/app/views/call_forwards/index.html.haml b/app/views/call_forwards/index.html.haml index 91b923a..e206653 100644 --- a/app/views/call_forwards/index.html.haml +++ b/app/views/call_forwards/index.html.haml @@ -3,4 +3,4 @@ - if @call_forwards.count > 0 = render "index_core", :call_forwards => @call_forwards -= render :partial => 'shared/create_link', :locals => {:parent => @phone_number, :child_class => CallForward}
\ No newline at end of file += render :partial => 'shared/create_link', :locals => {:parent => @parent, :child_class => CallForward}
\ No newline at end of file diff --git a/app/views/call_forwards/show.html.haml b/app/views/call_forwards/show.html.haml index c2187b1..9f9d27a 100644 --- a/app/views/call_forwards/show.html.haml +++ b/app/views/call_forwards/show.html.haml @@ -1,25 +1,23 @@ - content_for :title, t("call_forwards.show.page_title") %p - %strong= t('call_forwards.show.phone_number_id') + ":" - = @call_forward.phone_number + %strong= t('call_forwards.show.call_forwardable') + ":" + = "#{@call_forward.call_forwardable_type}: #{@call_forward.call_forwardable}" %p - %strong= t('call_forwards.show.call_forward_case_id') + ":" + %strong= t('call_forwards.show.call_forward_case') + ":" = t("call_forward_cases.#{@call_forward.call_forward_case.value}") %p %strong= t('call_forwards.show.timeout') + ":" = @call_forward.timeout %p %strong= t('call_forwards.show.destination') + ":" - = @call_forward.destination -- if @call_forward.call_forwardable_type == 'HuntGroup' && @call_forward.call_forwardable.class == HuntGroup - %p - %strong= t('call_forwards.show.hunt_group') + ":" - = @call_forward.call_forwardable -- if @call_forward.call_forwardable_type == 'Voicemail' - %p - %strong= t('call_forwards.show.to_voicemail') + ":" - = 'active' + - if @call_forward.destinationable_id && @call_forward.destinationable + = "#{@call_forward.destinationable_type}: #{@call_forward.destinationable}" + - elsif !@call_forward.destinationable_type.blank? + = "#{@call_forward.destinationable_type}: #{@call_forward.destination}" + - else + = @call_forward.destination + %p %strong= t('call_forwards.show.source') + ":" = @call_forward.source @@ -30,4 +28,4 @@ %strong= t('call_forwards.show.active') + ":" = @call_forward.active -= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number, :child => @call_forward }
\ No newline at end of file += render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @parent, :child => @call_forward }
\ No newline at end of file diff --git a/app/views/gs_nodes/sync.xml.haml b/app/views/gs_nodes/sync.xml.haml index a2fa71a..bba5c4e 100644 --- a/app/views/gs_nodes/sync.xml.haml +++ b/app/views/gs_nodes/sync.xml.haml @@ -55,7 +55,7 @@ - if !@call_forwards.blank? %call_forwards - @call_forwards.each do |call_forward| - %call_forward{ :uuid => call_forward.uuid, :service => call_forward.call_forward_case.try(:value), :timeout => call_forward.timeout, :destination => call_forward.destination, :source => call_forward.source, :active => call_forward.active.to_s, :created_at => call_forward.created_at, :updated_at => call_forward.updated_at, :phone_number_uuid => call_forward.phone_number.try(:uuid), :depth => call_forward.depth, :call_forwardable_type => call_forward.call_forwardable_type, :call_forwardable_uuid => call_forward.call_forwardable.try(:uuid), :position => call_forward.position} + %call_forward{ :uuid => call_forward.uuid, :service => call_forward.call_forward_case.try(:value), :timeout => call_forward.timeout, :destination => call_forward.destination, :source => call_forward.source, :active => call_forward.active.to_s, :created_at => call_forward.created_at, :updated_at => call_forward.updated_at, :phone_number_uuid => call_forward.phone_number.try(:uuid), :depth => call_forward.depth, :call_forwardable_type => call_forward.call_forwardable_type, :call_forwardable_uuid => call_forward.call_forwardable.try(:uuid), :destinationable_type => call_forward.destinationable_type, :destinationable_uuid => call_forward.destinationable.try(:uuid), :position => call_forward.position} - if !@softkeys.blank? %softkeys diff --git a/app/views/sip_accounts/_form_core.html.haml b/app/views/sip_accounts/_form_core.html.haml index 1a8876a..1a09912 100644 --- a/app/views/sip_accounts/_form_core.html.haml +++ b/app/views/sip_accounts/_form_core.html.haml @@ -13,6 +13,6 @@ - if @sip_account.sip_accountable_type == 'User' = 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 + - if CallForward.where(:call_forwardable_id => @sip_account.phone_number_ids, :call_forwardable_type => 'PhoneNumber').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') = f.input :language_code, :collection => Language.all.collect{|l| [l.to_s, l.code]}, :label => t('sip_accounts.form.language_code.label'), :hint => conditional_hint('sip_accounts.form.language_id.hint'), :include_blank => false |