diff options
| author | Vlatka Pavisic | 2017-04-11 15:35:01 +0200 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-04-11 15:35:01 +0200 | 
| commit | aa481c087b162bc775b4418e205f91c5b6bead19 (patch) | |
| tree | 914ba9b39e0338317bcc2bfd839f745647beda1a /app/views/routing_constraint_zones | |
| parent | 8adf909694b52959483818bf839d6e180015eb99 (diff) | |
| download | chouette-core-aa481c087b162bc775b4418e205f91c5b6bead19.tar.bz2 | |
Refs #3047: Associate RoutingConstraintZone with StopPoints
Diffstat (limited to 'app/views/routing_constraint_zones')
| -rw-r--r-- | app/views/routing_constraint_zones/_form.html.slim | 8 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/show.html.slim | 7 | 
2 files changed, 8 insertions, 7 deletions
diff --git a/app/views/routing_constraint_zones/_form.html.slim b/app/views/routing_constraint_zones/_form.html.slim index f72dd1471..e07b21fec 100644 --- a/app/views/routing_constraint_zones/_form.html.slim +++ b/app/views/routing_constraint_zones/_form.html.slim @@ -4,13 +4,15 @@        = f.input :name    .row      .col-lg-6.col-sm-12 -      = f.input :route_id, collection: @line.routes +      = f.input :route_id, collection: @line.routes, include_blank: false    .row      .col-lg-6.col-sm-12 -      / Temporarily limit the collection to 10 items... otherwise it kills RoR -      = f.input :stop_area_ids, as: :select, collection: Chouette::StopArea.limit(10), selected: @routing_constraint_zone.stop_area_ids, label: Chouette::StopArea.model_name.human.pluralize.capitalize, label_method: :name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Sélection de arrêts', 'multiple': 'multiple', style: 'width: 100%' } +      - stop_points_collection = @routing_constraint_zone.persisted? ? @routing_constraint_zone.route.stop_points : [] +      = f.input :stop_point_ids, id: 'stop_point_ids', as: :select, collection: stop_points_collection, selected: @routing_constraint_zone.stop_point_ids, label: Chouette::StopPoint.model_name.human.pluralize.capitalize, label_method: :name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Sélection des arrêts sur séquence d\'arrêts', 'multiple': 'multiple', style: 'width: 100%' }    .row      .col-lg-12.text-right        = link_to 'Annuler', :back, class: 'btn btn-link'        = f.button :submit, class: 'btn btn-danger' + + diff --git a/app/views/routing_constraint_zones/show.html.slim b/app/views/routing_constraint_zones/show.html.slim index 7b7b63623..351784ecc 100644 --- a/app/views/routing_constraint_zones/show.html.slim +++ b/app/views/routing_constraint_zones/show.html.slim @@ -9,10 +9,9 @@ p    = link_to @routing_constraint_zone.route.name, referential_line_route_path(@referential, @line, @routing_constraint_zone.route)  p -  label => "#{Chouette::StopArea.model_name.human.pluralize.capitalize} : " +  label => "#{Chouette::StopPoint.model_name.human.pluralize.capitalize} : "    br -  - @routing_constraint_zone.stop_areas.each do |stop_area| -    = link_to stop_area.name, referential_stop_area_path(@referential, stop_area) +  - @routing_constraint_zone.stop_points.each do |stop_point| +    = link_to stop_point.name, referential_stop_area_path(@referential, stop_point.stop_area)      br -  | 
