aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/stop_areas
diff options
context:
space:
mode:
authorZog2018-01-29 20:48:04 +0100
committerZog2018-02-01 14:40:25 +0100
commit65c43ed46adcd4c08d9ae3c1bb25c9cf8d7a0f62 (patch)
tree82664ca27014c1b3263728c94ec71495f0e8857f /app/views/stop_areas
parent82de76f0efce7558a3fe240edf4e2293a8788ee1 (diff)
downloadchouette-core-65c43ed46adcd4c08d9ae3c1bb25c9cf8d7a0f62.tar.bz2
Refs #5758; Add corresponding feature `stop_area_localized_names`
Diffstat (limited to 'app/views/stop_areas')
-rw-r--r--app/views/stop_areas/_form.html.slim7
-rw-r--r--app/views/stop_areas/show.html.slim7
2 files changed, 12 insertions, 2 deletions
diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim
index c2b9a7f4f..67af39dc6 100644
--- a/app/views/stop_areas/_form.html.slim
+++ b/app/views/stop_areas/_form.html.slim
@@ -6,6 +6,13 @@
/= @map.to_html
= f.input :id, as: :hidden
= f.input :name, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")}
+ - if has_feature?(:stop_area_localized_names)
+ .form-group
+ .col-sm-3.col-xs-5
+ .col-sm-9.col-xs-7
+ - f.object.localized_names.each do |k, v|
+ .col-md-6= f.input "localized_names[#{k}]", input_html: {value: v}, label: label_for_country(k)
+
.form-group
.col-sm-3.col-xs-5
.col-sm-9.col-xs-7
diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim
index 67f309cef..300d714e8 100644
--- a/app/views/stop_areas/show.html.slim
+++ b/app/views/stop_areas/show.html.slim
@@ -7,12 +7,15 @@
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
- attributes = { t('id_reflex') => @stop_area.get_objectid.short_id }
- - @stop_area.localized_names.each do |k, v|
- - attributes.merge!({label_for_country(k, @stop_area.human_attribute_name(:name)) => v }) if v.present?
+
+ - if has_feature?(:stop_area_localized_names)
+ - @stop_area.localized_names.each do |k, v|
+ - attributes.merge!({label_for_country(k, @stop_area.human_attribute_name(:name)) => v }) if v.present?
- attributes.merge!({ @stop_area.human_attribute_name(:parent) => @stop_area.parent ? link_to(@stop_area.parent.name, stop_area_referential_stop_area_path(@stop_area_referential, @stop_area.parent)) : "-" }) if @stop_area.commercial?
- attributes.merge!({ @stop_area.human_attribute_name(:stop_area_type) => Chouette::AreaType.find(@stop_area.area_type).try(:label),
@stop_area.human_attribute_name(:registration_number) => @stop_area.registration_number
})
+
- attributes.merge!(@stop_area.human_attribute_name(:waiting_time) => @stop_area.waiting_time_text) if has_feature?(:stop_area_waiting_time)
- attributes.merge!({ "Coordonnées" => geo_data(@stop_area, @stop_area_referential),
@stop_area.human_attribute_name(:zip_code) => @stop_area.zip_code,