aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/routes_controller.rb
AgeCommit message (Collapse)Author
2018-04-04Refs 6226; Add a button to create opposite routesZog
2018-03-22Remove maps code. Refs #6296Alban Peignier
2018-03-15Routes: Add `/costs` routeTeddy Wing
Render the `costs` field of a `Chouette::Route` as JSON. This lives at: http://stif-boiv.dev:3000/referentials/4/lines/1857/routes/7/costs.json I want this in order to get the distance & time costs of a route so that I can merge them with `JourneyPattern#costs` on the frontend on `JourneyPatternsCollection#show`. Refs #6203
2018-01-25StopPointDecorator: Convert to new action links interfaceTeddy Wing
Subtleties were that the links need to reference `StopArea`s. In particular, the `edit` link goes to the `StopAreaReferential` path instead of the referential-StopArea path. Refs #5586
2017-11-28Refactoring move referentialSupport from chouetteController into childrensXinhui
2017-11-09Refs #4932 Change route duplication to redrect to routes#indexcedricnjanga
2017-10-20Breadcrumb for routesXinhui
2017-09-14Change wayback values in route Refs #3395 @4Luc Donnet
2017-09-11Fixes #4189@4h Route DuplicationRobert
* Duplication of Route is triggered by link and UI forwarded to edit of duplicatee - Changing route, only POST duplicate_referential_line_route --> RoutesController#duplicate - Removing route GET duplicate_referential_line_route --> RoutesController#duplicate - Removing controller action RoutesController#post_duplicate * Link in Route Decorator depends on new policy RoutePolicy#decorate? * Adapting specs
2017-08-11RoutesController: Add separate method for POST /duplicateTeddy Wing
Send POST requests for duplication to a new controller method so we can more easily handle them and separate setup and creation code. Note that the test doesn't work. The `to change` part succeeds even though it shouldn't. Still need to figure out what's going on there, but committing this to hand off the feature to Robert. Refs #4189
2017-08-11Routes#duplicate: Add breadcrumb to pageTeddy Wing
Build a breadcrumb. In order to do so, we need to set the `@line` instance variable (how would I know that? I wouldn't, damn implicit dependencies). Refs #4189
2017-08-11Routes#duplicate: Add page headerTeddy Wing
Set header text in the locale files and display it on the page given the route ID in the URL. Remove the third argument from `pageheader` because after looking at the helper method's signature, I see that it's not necessary. Refs #4189
2017-08-11RoutesController: Get rid of old commented codeTeddy Wing
This method was commented out in 2012. Safe to say we can remove it.
2017-08-11Add routes to Routes#duplicateTeddy Wing
A couple of new routes for a form that will allow us to duplicate an itinéraire/route inside a line. Refs #4189
2017-07-12Routes#show: Use new table builder helperTeddy Wing
Update the table builder helper for the table of `Chouette::StopPoints` on this page. Created a new `StopPointDecorator` which unfortunately has the same code as `StopAreaDecorator`, the only difference being that instead of using `object`, it uses `object.stop_area`. Need to work out how to eliminate that code duplication. Refs #3479
2017-07-07ReferentialLines#show: Use new table builder helperTeddy Wing
Convert the table of `Route`s on this page to use the new table builder helper. This gives us the links from the `RouteDecorator` in the gear menu next to each row in the table. Ended up removing the `route_sp` field from the `RouteDecorator` context because it seems like we can just grab that collection directly from the `Route` object. At first I thought about renaming it because after coming back to this code I thought, 'what does sp mean?'. Then after some investigation, it appears that we don't need to pass it in explicitly. Now, no need to bother with that from the ReferentialLines controller. The RoutesController does create a separate `@route_sp` variable, but this only changes the sort order of the stop points, not the contents of the collection. Thus it seems safe to get them directly from the Route in the decorator. Refs #3479
2017-06-19Routes#show: Use RouteDecorator#action_links to render header linksTeddy Wing
Instead of defining the header links in the view, get them from our decorator so we can reuse them. Need to wrap `@route` in the decorator in the controller and pass it the necessary context in order for it to be able to properly build links. Move `Chouette::RouteDecorator` to the top level app/decorators/ directory and remove it from the `Chouette` namespace. I had put it there to make it more similar to our model directory layout, but Draper isn't intelligent enough to look in subdirectories of `decorators` when using the `ActiveRecord::Base#decorate` method. Otherwise I suppose I could do `Chouette::RouteDecorator.decorate(@route)`, but that seemed not as clean since it doesn't take advantage of the default behaviour of Draper. Now going to have to do this for the other decorators. Refs #3479
2017-05-09minor esthetic correctionRobert
2017-05-05Refs #3297Robert
Nullification of foreign keys in delete route moved from an `after_destroy' to a `before_destroy' hook. (Motivation: Seemed like a good idea)
2017-05-05Refs: #3297 removed patch of inherited_resources in RoutesControllerRobert
2017-03-30Fix route form opposite_route option should be based on wayback selectionXinhui
Refs #2839
2017-02-22Refs #2629: adding switch comp. updating route formjpl
2017-02-21Refs #2629: updating routes#showjpl
2017-02-13Refs #2596 : Replace creation_time with timestampsVlatka Pavisic
2017-02-07Refs #2476 : Disable modification and deletion of resources from another ↵Vlatka Pavisic
referential; in progress
2017-01-16Refs #2399 : User routes permissionsVlatka Pavisic
2016-11-28Select only persisted route in RoutesController#candidate_opposite_routes. ↵Alban Peignier
Refs #2052
2016-11-28Define Route candidate_opposite_routes in RoutesController to fix loading in ↵Alban Peignier
referentials#new. Refs #2052
2016-11-09Refs #1872 : Route direction and wayback enumerationsvlatka pavisic
2015-12-16Add route_sections for tracesBruno Perles
2015-03-09Solving merge V2_5 pbsZakaria BOUZIANE
2015-02-20Merge branch 'V2_5' into footnotesMarc Florisson
2015-02-20Fix routes stop points list sizeLuc Donnet
2015-02-10Boarding / alighting problem fix and specZakaria BOUZIANE
2015-01-26add restrictions specific to HubMarc Florisson
2015-01-15Fix tests and merge masterLuc Donnet
2015-01-07Fix spec and update devise usageLuc Donnet
2014-12-11Add boarding and alighting to routes controllerLuc Donnet
2014-09-19refactor breadcrumbsMichel Etienne
2014-09-11insert breadcrumbMichel Etienne
2013-04-15destroy object with delete method (fks will propagate destructionsMichel Etienne
2012-09-06refactor opposite_route managementMichel Etienne
2012-08-21hover on stop points. Refs #61Marc Florisson
2012-08-02set objets per page to 12 (param in initializer)Michel Etienne
2012-06-29Use controller as helpers in Map to create correct paths. Refs #4Alban Peignier
2012-05-16refactor stop_pointsMarc Florisson
2012-05-15add route and stop_point viewsMarc Florisson
2012-05-04add map on route viewMarc Florisson
2012-04-24add route's viewsMarc Florisson
2012-04-23add route viewsMarc Florisson