aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-12-13 18:03:19 +0100
committerXinhui2017-12-13 18:03:19 +0100
commitf9d51d00b98c47beb9cc1d6effe3339c4b4a3f9e (patch)
tree29243d7840847cfcdf446f1bd8c2c5482c88c38d
parent9146198415d07833833467e98ba909ed5454720f (diff)
downloadchouette-core-f9d51d00b98c47beb9cc1d6effe3339c4b4a3f9e.tar.bz2
Line#show display secondary companies as a list
Refs #5142
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/views/lines/show.html.slim2
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index d2cdaaa20..6b35863f6 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3,6 +3,14 @@ module ApplicationHelper
include NewapplicationHelper
+ def array_to_html_list items
+ content_tag :ul do
+ items.each do |item|
+ concat content_tag :li, item
+ end
+ end
+ end
+
def page_header_title(object)
# Unwrap from decorator, we want to know the object model name
object = object.object if object.try(:object)
diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim
index 4969ca3cd..d62fe30d6 100644
--- a/app/views/lines/show.html.slim
+++ b/app/views/lines/show.html.slim
@@ -20,7 +20,7 @@
'Activé' => (@line.deactivated? ? t('false') : t('true')),
@line.human_attribute_name(:network_id) => (@line.network.nil? ? t('lines.index.unset') : @line.network.name),
@line.human_attribute_name(:company_id) => (@line.company.nil? ? t('lines.index.unset') : @line.company.name),
- 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.collect(&:name).join(', ')),
+ 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : array_to_html_list(@line.secondary_companies.collect(&:name))),
'Nom court' => @line.number,
'Code public' => (@line.registration_number ? @line.registration_number : '-'),
@line.human_attribute_name(:transport_mode) => (@line.transport_mode.present? ? t("enumerize.transport_mode.#{@line.transport_mode}") : '-'),