From c7ceb38801b853154cdae31672ff2c105c8b191f Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 7 Jul 2017 18:25:48 +0200 Subject: Remove ReferentialLines#index Delete this route and associated template files. Wasn't sure if using `exclude:` in the routes file was the best way to do this, as I'm not sure if there are other routes we want to exclude from here also. I visited the page because I'm migrating templates to the new table builder helper and this one uses table builder. Upon visiting the page, it looked pretty wonky, and after consulting with Jean-Paul and Luc, it turns out this page isn't used any more because the table of `Chouette::Line`s rendered there is now instead displayed on the Referentials#show page, obviating the need for this page. Refs #3479 --- app/controllers/referential_lines_controller.rb | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'app/controllers/referential_lines_controller.rb') diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index 4b4a822b4..fe81bee12 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -10,18 +10,6 @@ class ReferentialLinesController < ChouetteController belongs_to :referential - def index - @hide_group_of_line = referential.group_of_lines.empty? - index! do |format| - format.html { - if collection.out_of_bounds? - redirect_to params.merge(:page => 1) - end - build_breadcrumb :index - } - end - end - def show @routes = resource.routes -- cgit v1.2.3 From 6920db47172cb5b55f6bdeccb575821cbf3a9f10 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 10 Jul 2017 11:59:55 +0200 Subject: ReferentialLines#show: Render links from ReferentialLineDecorator Leverage our newly created `ReferentialLineDecorator` to render the header links, allowing us to use them both here and in the table of lines on the Referentials#show page. Used the extended decoration syntax to allow us to specify the `ReferentialLineDecorator`, otherwise Draper will infer `LineDecorator`, which is not what we want in this case. Refs #3479 --- app/controllers/referential_lines_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/controllers/referential_lines_controller.rb') diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index fe81bee12..1da64991d 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -37,6 +37,14 @@ class ReferentialLinesController < ChouetteController ) show! do + @line = ReferentialLineDecorator.decorate( + @line, + context: { + referential: referential, + current_organisation: current_organisation + } + ) + build_breadcrumb :show end end -- cgit v1.2.3