diff options
-rw-r--r-- | app/models/call_route.rb | 11 | ||||
-rw-r--r-- | app/views/call_routes/_index_core.html.haml | 11 | ||||
-rw-r--r-- | app/views/call_routes/show.html.haml | 11 | ||||
-rw-r--r-- | config/locales/views/call_routes/de.yml | 6 | ||||
-rw-r--r-- | config/locales/views/call_routes/en.yml | 6 |
5 files changed, 29 insertions, 16 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 28120c1..b4496ab 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -238,4 +238,15 @@ class CallRoute < ActiveRecord::Base end end end + + def endpoint + if self.endpoint_id.to_i > 0 + begin + return self.endpoint_type.camelize.constantize.where(:id => self.endpoint_id.to_i).first + rescue + return nil + end + end + end + end diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 2e9238e..f0acebb 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -4,7 +4,7 @@ %tr %th= t('call_routes.index.name') %th= t('route_elements.index.pattern') - %th= t('call_routes.index.endpoint_type') + %th= t('call_routes.index.endpoint') %tbody - for call_route in call_routes @@ -18,5 +18,10 @@ = ', ...' - else = '-' - %td= call_route.endpoint_type - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route}
\ No newline at end of file + %td + - endpoint = call_route.endpoint + - if endpoint + = endpoint + - else + = call_route.endpoint_type + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml index 70fe13e..09daf53 100644 --- a/app/views/call_routes/show.html.haml +++ b/app/views/call_routes/show.html.haml @@ -7,11 +7,12 @@ %strong= t('call_routes.show.name') + ":" = @call_route.name %p - %strong= t('call_routes.show.endpoint_type') + ":" - = @call_route.endpoint_type -%p - %strong= t('call_routes.show.endpoint_id') + ":" - = @call_route.endpoint_id + %strong= t('call_routes.show.endpoint') + ":" + - endpoint = @call_route.endpoint + - if endpoint + = endpoint + - else + = @call_route.endpoint_type = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } diff --git a/config/locales/views/call_routes/de.yml b/config/locales/views/call_routes/de.yml index 260b869..a8d6f4b 100644 --- a/config/locales/views/call_routes/de.yml +++ b/config/locales/views/call_routes/de.yml @@ -9,8 +9,7 @@ de: page_title: 'Liste aller Call Routen' routing_table: 'Routing Table' name: 'Name' - endpoint_type: 'Endpoint type' - endpoint_id: 'Endpoint' + endpoint: 'Endpoint' position: 'Position' actions: confirm_destroy: 'Sind Sie sicher, dass Sie folgendes löschen möchten: Call Route' @@ -23,8 +22,7 @@ de: page_title: 'Call Route bearbeiten' routing_table: 'Routing Table' name: 'Name' - endpoint_type: 'Endpoint type' - endpoint_id: 'Endpoint' + endpoint: 'Endpoint' position: 'Position' actions: confirm_destroy: 'Sind Sie sicher, dass die dieses Element löschen möchten?' diff --git a/config/locales/views/call_routes/en.yml b/config/locales/views/call_routes/en.yml index 25e4c51..8596474 100644 --- a/config/locales/views/call_routes/en.yml +++ b/config/locales/views/call_routes/en.yml @@ -9,8 +9,7 @@ en: page_title: 'Listing Call route' table: 'Table' name: 'Name' - endpoint_type: 'Endpoint type' - endpoint_id: 'Endpoint' + endpoint: 'Endpoint' position: 'Position' actions: confirm_destroy: 'Are you sure you want to delete this Call route?' @@ -23,8 +22,7 @@ en: page_title: 'Show Call route' table: 'Table' name: 'Name' - endpoint_type: 'Endpoint type' - endpoint_id: 'Endpoint' + endpoint: 'Endpoint' position: 'Position' actions: confirm_destroy: 'Are you sure you want to delete this element?' |