diff options
| author | Teddy Wing | 2017-07-11 17:05:59 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-07-12 11:11:14 +0200 |
| commit | ccbd1cfa43662933991dd85bef072e5ca0ae77c7 (patch) | |
| tree | 800b6e5f37efe33545b3018f7d931163fa4ce893 /app/controllers | |
| parent | d6185a881dc0428950629acfd16c632f413ac728 (diff) | |
| download | chouette-core-ccbd1cfa43662933991dd85bef072e5ca0ae77c7.tar.bz2 | |
Networks#show: Move header links into a decorator
In order to allow us to use these links in tables of networks via the
new table builder, move the link definitions into decorator
`#action_links`.
This changes both of these types of pages:
* http://stif-boiv.dev:3000/referentials/4/networks/118
* http://stif-boiv.dev:3000/line_referentials/1/networks/118
Refs #3479
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/networks_controller.rb | 5 | ||||
| -rw-r--r-- | app/controllers/referential_networks_controller.rb | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index ea8410c5b..2e2f3f0d1 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -12,7 +12,12 @@ class NetworksController < BreadcrumbController def show @map = NetworkMap.new(resource).with_helpers(self) + show! do + @network = @network.decorate(context: { + line_referential: line_referential + }) + build_breadcrumb :show end end diff --git a/app/controllers/referential_networks_controller.rb b/app/controllers/referential_networks_controller.rb index 30c7dd244..8426c6ba3 100644 --- a/app/controllers/referential_networks_controller.rb +++ b/app/controllers/referential_networks_controller.rb @@ -10,7 +10,15 @@ class ReferentialNetworksController < ChouetteController def show @map = NetworkMap.new(resource).with_helpers(self) + show! do + @network = ReferentialNetworkDecorator.decorate( + @network, + context: { + referential: referential + } + ) + build_breadcrumb :show end end |
