aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-07-07 18:25:48 +0200
committerTeddy Wing2017-07-12 11:06:03 +0200
commitc7ceb38801b853154cdae31672ff2c105c8b191f (patch)
tree4fa3d8c5d1a6ed3c3ffd9af9655b5fadb5ee6eb1
parenta6a3122bf1d2c2f6fc6b0f27b25b14da16a9b976 (diff)
downloadchouette-core-c7ceb38801b853154cdae31672ff2c105c8b191f.tar.bz2
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
-rw-r--r--app/controllers/referential_lines_controller.rb12
-rw-r--r--app/views/referential_lines/_lines.html.slim13
-rw-r--r--app/views/referential_lines/index.html.slim33
-rw-r--r--config/routes.rb2
4 files changed, 1 insertions, 59 deletions
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
diff --git a/app/views/referential_lines/_lines.html.slim b/app/views/referential_lines/_lines.html.slim
deleted file mode 100644
index 54f22c978..000000000
--- a/app/views/referential_lines/_lines.html.slim
+++ /dev/null
@@ -1,13 +0,0 @@
-- if @lines.any?
- = table_builder @lines,
- { 'Oid' => Proc.new { |n| n.objectid.local_id }, :id => 'id',
- :number => 'number', :name => 'name', :network => Proc.new { |n| n.try(:network).try(:name) }, :company => Proc.new { |n| n.try(:company).try(:name) } },
- [:show],
- [],
- 'table table-bordered'
-
- .text-center
- = will_paginate @lines, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
-
-- else
- = replacement_msg t('referential_lines.search_no_results')
diff --git a/app/views/referential_lines/index.html.slim b/app/views/referential_lines/index.html.slim
deleted file mode 100644
index 6b4fd5f38..000000000
--- a/app/views/referential_lines/index.html.slim
+++ /dev/null
@@ -1,33 +0,0 @@
-= title_tag t('lines.index.title')
-
-= render partial: 'shared/lines_search_form', locals: { referential: @referential }
-
-#lines
- = render 'lines'
-
-- content_for :sidebar do
- ul.actions
- - if policy(Chouette::Line).create? && @referential.organisation == current_organisation
- li
- = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add'
-
- - if policy(Chouette::Line).destroy?
- #multiple_selection_menu
- h4 = t(".multi_selection")
-
- .disabled
- a.enable href="#"
- = t(".multi_selection_enable")
-
- .enabled style="display: none;"
- a.disable href="#"
- = t(".multi_selection_disable")
-
- ul.actions
- = link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm")
-
- a.select_all href="#"
- = t(".select_all")
- = " | "
- a.deselect_all href="#"
- = t(".deselect_all")
diff --git a/config/routes.rb b/config/routes.rb
index f75578106..aa6713857 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -99,7 +99,7 @@ ChouetteIhm::Application.routes.draw do
resources :networks, controller: "referential_networks"
match 'lines' => 'lines#destroy_all', :via => :delete
- resources :lines, controller: "referential_lines" do
+ resources :lines, controller: "referential_lines", except: :index do
resource :footnotes, controller: "line_footnotes"
delete :index, on: :collection, action: :delete_all
collection do