aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorLuc Donnet2017-10-30 11:45:07 +0100
committerGitHub2017-10-30 11:45:07 +0100
commitcb7e16653eb1dcb71fb46c84d7c1f3ea8aafd69a (patch)
treeb9e3993c435c63517366c1ce11b9d3a9efa5b793 /app/controllers
parent76d1787b32e28e4dbb3664e2bad99366781fdcd2 (diff)
parentd68f820ee402cd94d9f5fd4405f49436c4847c4b (diff)
downloadchouette-core-cb7e16653eb1dcb71fb46c84d7c1f3ea8aafd69a.tar.bz2
Merge pull request #104 from af83/4726-breadcrumb
4726 breadcrumb
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/access_links_controller.rb16
-rw-r--r--app/controllers/access_points_controller.rb6
-rw-r--r--app/controllers/api_keys_controller.rb2
-rw-r--r--app/controllers/breadcrumb_controller.rb41
-rw-r--r--app/controllers/calendars_controller.rb6
-rw-r--r--app/controllers/chouette_controller.rb3
-rw-r--r--app/controllers/companies_controller.rb4
-rw-r--r--app/controllers/compliance_check_sets_controller.rb4
-rw-r--r--app/controllers/compliance_control_blocks_controller.rb4
-rw-r--r--app/controllers/compliance_control_sets_controller.rb2
-rw-r--r--app/controllers/compliance_controls_controller.rb2
-rw-r--r--app/controllers/concerns/policy_checker.rb1
-rw-r--r--app/controllers/connection_links_controller.rb6
-rw-r--r--app/controllers/dashboards_controller.rb2
-rw-r--r--app/controllers/exports_controller.rb16
-rw-r--r--app/controllers/group_of_lines_controller.rb7
-rw-r--r--app/controllers/import_messages_controller.rb2
-rw-r--r--app/controllers/import_resources_controller.rb4
-rw-r--r--app/controllers/imports_controller.rb13
-rw-r--r--app/controllers/journey_patterns_collections_controller.rb1
-rw-r--r--app/controllers/journey_patterns_controller.rb4
-rw-r--r--app/controllers/line_footnotes_controller.rb6
-rw-r--r--app/controllers/line_referentials_controller.rb2
-rw-r--r--app/controllers/lines_controller.rb5
-rw-r--r--app/controllers/networks_controller.rb6
-rw-r--r--app/controllers/organisations_controller.rb4
-rw-r--r--app/controllers/referential_companies_controller.rb2
-rw-r--r--app/controllers/referential_group_of_lines_controller.rb5
-rw-r--r--app/controllers/referential_lines_controller.rb2
-rw-r--r--app/controllers/referential_networks_controller.rb4
-rw-r--r--app/controllers/referential_stop_areas_controller.rb13
-rw-r--r--app/controllers/referentials_controller.rb5
-rw-r--r--app/controllers/route_sections_controller.rb5
-rw-r--r--app/controllers/routes_controller.rb3
-rw-r--r--app/controllers/routing_constraint_zones_controller.rb4
-rw-r--r--app/controllers/rule_parameter_sets_controller.rb8
-rw-r--r--app/controllers/stop_area_referentials_controller.rb2
-rw-r--r--app/controllers/stop_areas_controller.rb16
-rw-r--r--app/controllers/time_tables_controller.rb10
-rw-r--r--app/controllers/timebands_controller.rb7
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/controllers/vehicle_journey_imports_controller.rb4
-rw-r--r--app/controllers/vehicle_journeys_controller.rb1
-rw-r--r--app/controllers/workbenches_controller.rb6
44 files changed, 49 insertions, 219 deletions
diff --git a/app/controllers/access_links_controller.rb b/app/controllers/access_links_controller.rb
index 6f1ad8bfd..936b8ea5e 100644
--- a/app/controllers/access_links_controller.rb
+++ b/app/controllers/access_links_controller.rb
@@ -21,9 +21,7 @@ class AccessLinksController < ChouetteController
@access_point = Chouette::AccessPoint.find(params[:access_point_id])
#@access_link = Chouette::AccessLink.find(params[:id])
@stop_area = @access_link.stop_area
- show! do |format|
- format.html {build_breadcrumb :show}
- end
+ show!
end
def new
@@ -41,9 +39,7 @@ class AccessLinksController < ChouetteController
data[:name] = name
end
@access_link = Chouette::AccessLink.new(data.permit!)
- new! do
- build_breadcrumb :new
- end
+ new!
end
def create
@@ -59,9 +55,7 @@ class AccessLinksController < ChouetteController
@access_link = Chouette::AccessLink.find(params[:id])
@stop_area = @access_link.stop_area
@orientation = @access_link.link_orientation_type
- edit! do
- build_breadcrumb :edit
- end
+ edit!
end
def update
@@ -69,9 +63,7 @@ class AccessLinksController < ChouetteController
@access_link = Chouette::AccessLink.find(params[:id])
@stop_area = @access_link.stop_area
@orientation = @access_link.link_orientation_type
- update! do |success, failure|
- build_breadcrumb :edit
- end
+ update!
end
protected
diff --git a/app/controllers/access_points_controller.rb b/app/controllers/access_points_controller.rb
index d43880c0b..477875cc9 100644
--- a/app/controllers/access_points_controller.rb
+++ b/app/controllers/access_points_controller.rb
@@ -6,7 +6,6 @@ class AccessPointsController < ChouetteController
end
respond_to :html, :kml, :xml, :json
-
include PolicyChecker
def index
@@ -32,7 +31,6 @@ class AccessPointsController < ChouetteController
}
end
- format.html {build_breadcrumb :show}
end
end
@@ -40,9 +38,7 @@ class AccessPointsController < ChouetteController
def edit
access_point.position ||= access_point.default_position
map.editable = true
- edit! do
- build_breadcrumb :edit
- end
+ edit!
end
diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb
index 7ae8d4732..eebad5e7b 100644
--- a/app/controllers/api_keys_controller.rb
+++ b/app/controllers/api_keys_controller.rb
@@ -1,4 +1,4 @@
-class ApiKeysController < BreadcrumbController
+class ApiKeysController < InheritedResources::Base
defaults resource_class: Api::V1::ApiKey
include PolicyChecker
diff --git a/app/controllers/breadcrumb_controller.rb b/app/controllers/breadcrumb_controller.rb
deleted file mode 100644
index cb639fdb8..000000000
--- a/app/controllers/breadcrumb_controller.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-class BreadcrumbController < InheritedResources::Base
- include Pundit
- include BreadcrumbHelper
-
- def show
- show! do
- build_breadcrumb :show
- end
- end
-
- def index
- index! do
- build_breadcrumb :index
- end
- end
-
- def edit
- edit! do
- build_breadcrumb :edit
- end
- end
-
- def update
- update! do |success, failure|
- build_breadcrumb :edit
- end
- end
-
- def new
- new! do
- build_breadcrumb :new
- end
- end
-
- def create
- create! do |success, failure|
- build_breadcrumb :new
- end
- end
-
-end
diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb
index 1c342c718..e9ee7579a 100644
--- a/app/controllers/calendars_controller.rb
+++ b/app/controllers/calendars_controller.rb
@@ -1,4 +1,4 @@
-class CalendarsController < BreadcrumbController
+class CalendarsController < InheritedResources::Base
include PolicyChecker
defaults resource_class: Calendar
before_action :ransack_contains_date, only: [:index]
@@ -8,16 +8,12 @@ class CalendarsController < BreadcrumbController
def index
index! do
@calendars = ModelDecorator.decorate(@calendars, with: CalendarDecorator)
-
- build_breadcrumb :index
end
end
def show
show! do
@calendar = @calendar.decorate
-
- build_breadcrumb :show
end
end
diff --git a/app/controllers/chouette_controller.rb b/app/controllers/chouette_controller.rb
index dc9ab4fa5..1313aa7cc 100644
--- a/app/controllers/chouette_controller.rb
+++ b/app/controllers/chouette_controller.rb
@@ -1,6 +1,5 @@
-class ChouetteController < BreadcrumbController
+class ChouetteController < InheritedResources::Base
include ApplicationHelper
- include BreadcrumbHelper
include ReferentialSupport
end
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb
index cf27c39cf..bc5bedd7f 100644
--- a/app/controllers/companies_controller.rb
+++ b/app/controllers/companies_controller.rb
@@ -1,4 +1,4 @@
-class CompaniesController < BreadcrumbController
+class CompaniesController < InheritedResources::Base
include ApplicationHelper
include PolicyChecker
defaults :resource_class => Chouette::Company
@@ -22,8 +22,6 @@ class CompaniesController < BreadcrumbController
format.json {
@companies = decorate_companies(@companies)
}
-
- build_breadcrumb :index
end
end
diff --git a/app/controllers/compliance_check_sets_controller.rb b/app/controllers/compliance_check_sets_controller.rb
index fce8dcc56..95dcfbf05 100644
--- a/app/controllers/compliance_check_sets_controller.rb
+++ b/app/controllers/compliance_check_sets_controller.rb
@@ -1,4 +1,4 @@
-class ComplianceCheckSetsController < BreadcrumbController
+class ComplianceCheckSetsController < InheritedResources::Base
defaults resource_class: ComplianceCheckSet
include RansackDateFilter
before_action only: [:index] { set_date_time_params("created_at", DateTime) }
@@ -18,4 +18,4 @@ class ComplianceCheckSetsController < BreadcrumbController
}
end
end
-end \ No newline at end of file
+end
diff --git a/app/controllers/compliance_control_blocks_controller.rb b/app/controllers/compliance_control_blocks_controller.rb
index 2dd69a865..996f8a464 100644
--- a/app/controllers/compliance_control_blocks_controller.rb
+++ b/app/controllers/compliance_control_blocks_controller.rb
@@ -1,4 +1,4 @@
-class ComplianceControlBlocksController < BreadcrumbController
+class ComplianceControlBlocksController < InheritedResources::Base
defaults resource_class: ComplianceControlBlock
belongs_to :compliance_control_set
actions :all, :except => [:show, :index]
@@ -9,4 +9,4 @@ class ComplianceControlBlocksController < BreadcrumbController
params.require(:compliance_control_block).permit(:transport_mode, :transport_submode)
end
-end \ No newline at end of file
+end
diff --git a/app/controllers/compliance_control_sets_controller.rb b/app/controllers/compliance_control_sets_controller.rb
index e5c2e19dd..570204065 100644
--- a/app/controllers/compliance_control_sets_controller.rb
+++ b/app/controllers/compliance_control_sets_controller.rb
@@ -1,4 +1,4 @@
-class ComplianceControlSetsController < BreadcrumbController
+class ComplianceControlSetsController < InheritedResources::Base
defaults resource_class: ComplianceControlSet
include RansackDateFilter
before_action only: [:index] { set_date_time_params("updated_at", DateTime) }
diff --git a/app/controllers/compliance_controls_controller.rb b/app/controllers/compliance_controls_controller.rb
index 0a9c7d52b..bd4a33ff4 100644
--- a/app/controllers/compliance_controls_controller.rb
+++ b/app/controllers/compliance_controls_controller.rb
@@ -1,4 +1,4 @@
-class ComplianceControlsController < BreadcrumbController
+class ComplianceControlsController < InheritedResources::Base
defaults resource_class: ComplianceControl
belongs_to :compliance_control_set
actions :all, :except => [:show, :index]
diff --git a/app/controllers/concerns/policy_checker.rb b/app/controllers/concerns/policy_checker.rb
index 65a4428e2..d84263f2c 100644
--- a/app/controllers/concerns/policy_checker.rb
+++ b/app/controllers/concerns/policy_checker.rb
@@ -1,4 +1,5 @@
module PolicyChecker
+ include Pundit
extend ActiveSupport::Concern
included do
diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb
index 403f0ed9e..b56450291 100644
--- a/app/controllers/connection_links_controller.rb
+++ b/app/controllers/connection_links_controller.rb
@@ -18,23 +18,19 @@ class ConnectionLinksController < ChouetteController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
}
end
end
def show
@map = ConnectionLinkMap.new(resource).with_helpers(self)
- show! do
- build_breadcrumb :show
- end
+ show!
end
def select_areas
@connection_link = connection_link
@departure = connection_link.departure
@arrival = connection_link.arrival
- build_breadcrumb :show
end
protected
diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb
index 2585dafca..1c7876c58 100644
--- a/app/controllers/dashboards_controller.rb
+++ b/app/controllers/dashboards_controller.rb
@@ -3,7 +3,7 @@
# this controller will use a custom partial like
# custom/dashboards/_dashboard.html.slim for Custom::Dashboard
#
-class DashboardsController < BreadcrumbController
+class DashboardsController < InheritedResources::Base
respond_to :html, only: [:show]
def show
diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb
index 2cfa0b6fa..ad88c6dae 100644
--- a/app/controllers/exports_controller.rb
+++ b/app/controllers/exports_controller.rb
@@ -3,16 +3,14 @@ require 'open-uri'
class ExportsController < ChouetteController
defaults :resource_class => Export
-
+
respond_to :html, :only => [:show, :index, :destroy, :exported_file]
respond_to :js, :only => [:index]
belongs_to :referential
def index
begin
- index! do
- build_breadcrumb :index
- end
+ index!
rescue Ievkit::Error, Faraday::Error => error
logger.error("Iev failure : #{error.message}")
flash[:error] = t(error.locale_for_error)
@@ -22,9 +20,7 @@ class ExportsController < ChouetteController
def show
begin
- show! do
- build_breadcrumb :show
- end
+ show!
rescue Ievkit::Error, Faraday::Error => error
logger.error("Iev failure : #{error.message}")
flash[:error] = t(error.locale_for_error)
@@ -32,7 +28,7 @@ class ExportsController < ChouetteController
end
end
- def destroy
+ def destroy
begin
destroy!
rescue Ievkit::Error, Faraday::Error => error
@@ -57,11 +53,11 @@ class ExportsController < ChouetteController
end
protected
-
+
def export_service
ExportService.new(@referential)
end
-
+
def resource
@export ||= export_service.find( params[:id] )
@line_items = @export.report.line_items
diff --git a/app/controllers/group_of_lines_controller.rb b/app/controllers/group_of_lines_controller.rb
index 5cadd40d3..1a59d39f7 100644
--- a/app/controllers/group_of_lines_controller.rb
+++ b/app/controllers/group_of_lines_controller.rb
@@ -1,4 +1,4 @@
-class GroupOfLinesController < BreadcrumbController
+class GroupOfLinesController < InheritedResources::Base
include ApplicationHelper
include PolicyChecker
defaults :resource_class => Chouette::GroupOfLine
@@ -13,9 +13,7 @@ class GroupOfLinesController < BreadcrumbController
def show
@map = GroupOfLineMap.new(resource).with_helpers(self)
@lines = resource.lines.order(:name)
- show! do
- build_breadcrumb :show
- end
+ show!
end
def index
@@ -24,7 +22,6 @@ class GroupOfLinesController < BreadcrumbController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
}
end
end
diff --git a/app/controllers/import_messages_controller.rb b/app/controllers/import_messages_controller.rb
index 4ad398cbb..c3c6b46b5 100644
--- a/app/controllers/import_messages_controller.rb
+++ b/app/controllers/import_messages_controller.rb
@@ -1,4 +1,4 @@
-class ImportMessagesController < BreadcrumbController
+class ImportMessagesController < InheritedResources::Base
defaults resource_class: ImportMessage, collection_name: 'import_messages', instance_name: 'import_message'
respond_to :csv
belongs_to :import, :parent_class => Import do
diff --git a/app/controllers/import_resources_controller.rb b/app/controllers/import_resources_controller.rb
index ac3dd042e..3e52233f2 100644
--- a/app/controllers/import_resources_controller.rb
+++ b/app/controllers/import_resources_controller.rb
@@ -1,4 +1,4 @@
-class ImportResourcesController < BreadcrumbController
+class ImportResourcesController < InheritedResources::Base
defaults resource_class: ImportResource, collection_name: 'import_resources', instance_name: 'import_resource'
respond_to :html
belongs_to :import
@@ -8,8 +8,6 @@ class ImportResourcesController < BreadcrumbController
format.html {
@import_resources = decorate_import_resources(@import_resources)
}
-
- build_breadcrumb :index
end
end
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 3c52dc935..6c9d81d82 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -1,4 +1,4 @@
-class ImportsController < BreadcrumbController
+class ImportsController < InheritedResources::Base
include PolicyChecker
include RansackDateFilter
before_action only: [:index] { set_date_time_params("started_at", DateTime) }
@@ -13,8 +13,6 @@ class ImportsController < BreadcrumbController
@import = @import.decorate(context: {
workbench: @workbench
})
-
- build_breadcrumb :show
end
end
@@ -24,17 +22,8 @@ class ImportsController < BreadcrumbController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
-
@imports = decorate_imports(@imports)
}
-
- build_breadcrumb :index
- end
- end
-
- def new
- new! do
- build_breadcrumb :new
end
end
diff --git a/app/controllers/journey_patterns_collections_controller.rb b/app/controllers/journey_patterns_collections_controller.rb
index e8924b7ad..546158fa8 100644
--- a/app/controllers/journey_patterns_collections_controller.rb
+++ b/app/controllers/journey_patterns_collections_controller.rb
@@ -45,7 +45,6 @@ class JourneyPatternsCollectionsController < ChouetteController
}
end
@stop_points_list = @stop_points_list.sort_by {|a| a[:position] }
- build_breadcrumb :index
end
def user_permissions
diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb
index f4ae55b4e..a72e7da7f 100644
--- a/app/controllers/journey_patterns_controller.rb
+++ b/app/controllers/journey_patterns_controller.rb
@@ -30,9 +30,7 @@ class JourneyPatternsController < ChouetteController
def show
@map = JourneyPatternMap.new(journey_pattern).with_helpers(self)
@stop_points = journey_pattern.stop_points.paginate(:page => params[:page])
- show! do
- build_breadcrumb :show
- end
+ show!
end
def new_vehicle_journey
diff --git a/app/controllers/line_footnotes_controller.rb b/app/controllers/line_footnotes_controller.rb
index 581c921e8..2d4d10064 100644
--- a/app/controllers/line_footnotes_controller.rb
+++ b/app/controllers/line_footnotes_controller.rb
@@ -5,12 +5,6 @@ class LineFootnotesController < ChouetteController
before_action :authorize_resource, only: [:destroy_footnote, :edit_footnote, :show_footnote, :update_footnote]
before_action :authorize_resource_class, only: [:create_footnote, :index_footnote, :new_footnote]
- def edit
- edit! do
- build_breadcrumb :edit
- end
- end
-
def update
update! do |success, failure|
success.html { redirect_to referential_line_footnotes_path(@referential, @line) , notice: t('notice.footnotes.updated') }
diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb
index fc4ab3cf5..f70ddef41 100644
--- a/app/controllers/line_referentials_controller.rb
+++ b/app/controllers/line_referentials_controller.rb
@@ -1,4 +1,4 @@
-class LineReferentialsController < BreadcrumbController
+class LineReferentialsController < InheritedResources::Base
defaults :resource_class => LineReferential
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index 4b6448ce8..cf2908500 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -1,4 +1,4 @@
-class LinesController < BreadcrumbController
+class LinesController < InheritedResources::Base
include ApplicationHelper
include PolicyChecker
defaults :resource_class => Chouette::Line
@@ -26,7 +26,6 @@ class LinesController < BreadcrumbController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
}
end
end
@@ -38,8 +37,6 @@ class LinesController < BreadcrumbController
line_referential: @line_referential,
current_organisation: current_organisation
})
-
- build_breadcrumb :show
end
end
diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb
index 5dae1ba3f..98c840777 100644
--- a/app/controllers/networks_controller.rb
+++ b/app/controllers/networks_controller.rb
@@ -1,4 +1,4 @@
-class NetworksController < BreadcrumbController
+class NetworksController < InheritedResources::Base
include ApplicationHelper
include PolicyChecker
defaults :resource_class => Chouette::Network
@@ -17,8 +17,6 @@ class NetworksController < BreadcrumbController
@network = @network.decorate(context: {
line_referential: line_referential
})
-
- build_breadcrumb :show
end
end
@@ -43,8 +41,6 @@ class NetworksController < BreadcrumbController
format.js {
@networks = decorate_networks(@networks)
}
-
- build_breadcrumb :index
end
end
diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb
index 51a325586..d80541800 100644
--- a/app/controllers/organisations_controller.rb
+++ b/app/controllers/organisations_controller.rb
@@ -1,4 +1,4 @@
-class OrganisationsController < BreadcrumbController
+class OrganisationsController < InheritedResources::Base
defaults :resource_class => Organisation
respond_to :html, :only => [:edit, :show, :update]
@@ -18,6 +18,6 @@ class OrganisationsController < BreadcrumbController
def organisation_params
params.require(:organisation).permit(:name)
end
-
+
end
diff --git a/app/controllers/referential_companies_controller.rb b/app/controllers/referential_companies_controller.rb
index 482f74ea0..fdbd83dc9 100644
--- a/app/controllers/referential_companies_controller.rb
+++ b/app/controllers/referential_companies_controller.rb
@@ -20,8 +20,6 @@ class ReferentialCompaniesController < ChouetteController
format.js {
@companies = decorate_companies(@companies)
}
-
- build_breadcrumb :index
end
end
diff --git a/app/controllers/referential_group_of_lines_controller.rb b/app/controllers/referential_group_of_lines_controller.rb
index 73520d00a..d88daab84 100644
--- a/app/controllers/referential_group_of_lines_controller.rb
+++ b/app/controllers/referential_group_of_lines_controller.rb
@@ -12,9 +12,7 @@ class ReferentialGroupOfLinesController < ChouetteController
def show
@map = GroupOfLineMap.new(resource).with_helpers(self)
@lines = resource.lines.order(:name)
- show! do
- build_breadcrumb :show
- end
+ show!
end
def index
@@ -23,7 +21,6 @@ class ReferentialGroupOfLinesController < ChouetteController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
}
end
end
diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb
index ec0bbbb18..b9f8c0050 100644
--- a/app/controllers/referential_lines_controller.rb
+++ b/app/controllers/referential_lines_controller.rb
@@ -44,8 +44,6 @@ class ReferentialLinesController < ChouetteController
current_organisation: current_organisation
}
)
-
- build_breadcrumb :show
end
end
diff --git a/app/controllers/referential_networks_controller.rb b/app/controllers/referential_networks_controller.rb
index ee2db8008..2131b8e57 100644
--- a/app/controllers/referential_networks_controller.rb
+++ b/app/controllers/referential_networks_controller.rb
@@ -18,8 +18,6 @@ class ReferentialNetworksController < ChouetteController
referential: referential
}
)
-
- build_breadcrumb :show
end
end
@@ -36,8 +34,6 @@ class ReferentialNetworksController < ChouetteController
format.js {
@networks = decorate_networks(@networks)
}
-
- build_breadcrumb :index
end
end
diff --git a/app/controllers/referential_stop_areas_controller.rb b/app/controllers/referential_stop_areas_controller.rb
index 7519418e7..78dcd6dd9 100644
--- a/app/controllers/referential_stop_areas_controller.rb
+++ b/app/controllers/referential_stop_areas_controller.rb
@@ -14,31 +14,26 @@ class ReferentialStopAreasController < ChouetteController
def select_parent
@stop_area = stop_area
@parent = stop_area.parent
- build_breadcrumb :edit
end
def add_children
@stop_area = stop_area
@children = stop_area.children
- build_breadcrumb :edit
end
def add_routing_lines
@stop_area = stop_area
@lines = stop_area.routing_lines
- build_breadcrumb :edit
end
def add_routing_stops
@stop_area = stop_area
- build_breadcrumb :edit
end
def access_links
@stop_area = stop_area
@generic_access_links = stop_area.generic_access_link_matrix
@detail_access_links = stop_area.detail_access_link_matrix
- build_breadcrumb :edit
end
def index
@@ -49,7 +44,6 @@ class ReferentialStopAreasController < ChouetteController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
}
end
end
@@ -57,9 +51,7 @@ class ReferentialStopAreasController < ChouetteController
def new
@map = StopAreaMap.new( Chouette::StopArea.new).with_helpers(self)
@map.editable = true
- new! do
- build_breadcrumb :show
- end
+ new!
end
def create
@@ -81,8 +73,6 @@ class ReferentialStopAreasController < ChouetteController
end
@stop_area = @stop_area.decorate
-
- build_breadcrumb :show
end
end
@@ -90,7 +80,6 @@ class ReferentialStopAreasController < ChouetteController
edit! do
stop_area.position ||= stop_area.default_position
map.editable = true
- build_breadcrumb :edit
end
end
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index c8984076a..6b479e938 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -1,4 +1,4 @@
-class ReferentialsController < BreadcrumbController
+class ReferentialsController < InheritedResources::Base
defaults :resource_class => Referential
include PolicyChecker
@@ -18,8 +18,6 @@ class ReferentialsController < BreadcrumbController
if !!@referential.created_from_id
format.html { redirect_to workbench_path(@referential.workbench) }
- else
- build_breadcrumb :new
end
end
end
@@ -45,7 +43,6 @@ class ReferentialsController < BreadcrumbController
:time_tables_count => resource.time_tables.count,
:referential_id => resource.id}
}
- format.html { build_breadcrumb :show}
end
end
diff --git a/app/controllers/route_sections_controller.rb b/app/controllers/route_sections_controller.rb
index c1aaf732e..03d6cf176 100644
--- a/app/controllers/route_sections_controller.rb
+++ b/app/controllers/route_sections_controller.rb
@@ -8,14 +8,9 @@ class RouteSectionsController < ChouetteController
belongs_to :referential
before_action :save_return_to_path, only: [:edit, :create_to_edit]
- before_action ->(controller) { build_breadcrumb controller.action_name }
helper_method :search
- def index
- index!
- end
-
def new
@stop_areas = referential.stop_areas.with_geometry.order :name
new!
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index 78daffb30..93f30f4d5 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -19,7 +19,6 @@ class RoutesController < ChouetteController
def edit_boarding_alighting
@route = route
- build_breadcrumb :edit
end
def save_boarding_alighting
@@ -51,8 +50,6 @@ class RoutesController < ChouetteController
@route_sp,
with: StopPointDecorator
)
-
- build_breadcrumb :show
end
end
diff --git a/app/controllers/routing_constraint_zones_controller.rb b/app/controllers/routing_constraint_zones_controller.rb
index 78cd0e209..6c3da5980 100644
--- a/app/controllers/routing_constraint_zones_controller.rb
+++ b/app/controllers/routing_constraint_zones_controller.rb
@@ -20,8 +20,6 @@ class RoutingConstraintZonesController < ChouetteController
line: parent
}
)
-
- build_breadcrumb :index
end
end
@@ -31,8 +29,6 @@ class RoutingConstraintZonesController < ChouetteController
referential: referential,
line: parent
})
-
- build_breadcrumb :show
end
end
diff --git a/app/controllers/rule_parameter_sets_controller.rb b/app/controllers/rule_parameter_sets_controller.rb
index 6a23407d0..de4863a08 100644
--- a/app/controllers/rule_parameter_sets_controller.rb
+++ b/app/controllers/rule_parameter_sets_controller.rb
@@ -1,15 +1,13 @@
-class RuleParameterSetsController < BreadcrumbController
+class RuleParameterSetsController < InheritedResources::Base
defaults :resource_class => RuleParameterSet
respond_to :html
respond_to :js, :only => [ :mode ]
def new
@rule_parameter_set = RuleParameterSet.default( current_organisation)
- new! do
- build_breadcrumb :new
- end
+ new!
end
-
+
def destroy
if current_organisation.rule_parameter_sets.count == 1
flash[:alert] = t('rule_parameter_sets.destroy.last_rps_protected')
diff --git a/app/controllers/stop_area_referentials_controller.rb b/app/controllers/stop_area_referentials_controller.rb
index 5c87be43d..e2815e5fb 100644
--- a/app/controllers/stop_area_referentials_controller.rb
+++ b/app/controllers/stop_area_referentials_controller.rb
@@ -1,4 +1,4 @@
-class StopAreaReferentialsController < BreadcrumbController
+class StopAreaReferentialsController < InheritedResources::Base
defaults :resource_class => StopAreaReferential
def sync
diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb
index cdb7c59ab..0c9f3067a 100644
--- a/app/controllers/stop_areas_controller.rb
+++ b/app/controllers/stop_areas_controller.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-class StopAreasController < BreadcrumbController
+class StopAreasController < InheritedResources::Base
include ApplicationHelper
defaults :resource_class => Chouette::StopArea
@@ -22,32 +22,27 @@ class StopAreasController < BreadcrumbController
def select_parent
@stop_area = stop_area
@parent = stop_area.parent
- build_breadcrumb :edit
end
def add_children
authorize stop_area
@stop_area = stop_area
@children = stop_area.children
- build_breadcrumb :edit
end
def add_routing_lines
@stop_area = stop_area
@lines = stop_area.routing_lines
- build_breadcrumb :edit
end
def add_routing_stops
@stop_area = stop_area
- build_breadcrumb :edit
end
def access_links
@stop_area = stop_area
@generic_access_links = stop_area.generic_access_link_matrix
@detail_access_links = stop_area.detail_access_link_matrix
- build_breadcrumb :edit
end
def index
@@ -64,8 +59,6 @@ class StopAreasController < BreadcrumbController
@stop_areas,
with: StopAreaDecorator
)
-
- build_breadcrumb :index
}
end
end
@@ -74,9 +67,7 @@ class StopAreasController < BreadcrumbController
authorize resource_class
@map = StopAreaMap.new( Chouette::StopArea.new).with_helpers(self)
@map.editable = true
- new! do
- build_breadcrumb :show
- end
+ new!
end
def create
@@ -99,8 +90,6 @@ class StopAreasController < BreadcrumbController
end
@stop_area = @stop_area.decorate
-
- build_breadcrumb :show
end
end
@@ -109,7 +98,6 @@ class StopAreasController < BreadcrumbController
edit! do
stop_area.position ||= stop_area.default_position
map.editable = true
- build_breadcrumb :edit
end
end
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index af74f635f..0c1769ad7 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -19,7 +19,6 @@ class TimeTablesController < ChouetteController
@time_table = @time_table.decorate(context: {
referential: @referential
})
- build_breadcrumb :show
end
end
@@ -30,9 +29,7 @@ class TimeTablesController < ChouetteController
def new
@autocomplete_items = ActsAsTaggableOn::Tag.all
- new! do
- build_breadcrumb :new
- end
+ new!
end
def create
@@ -66,7 +63,6 @@ class TimeTablesController < ChouetteController
def edit
edit! do
- build_breadcrumb :edit
@autocomplete_items = ActsAsTaggableOn::Tag.all
end
end
@@ -89,8 +85,6 @@ class TimeTablesController < ChouetteController
end
@time_tables = decorate_time_tables(@time_tables)
-
- build_breadcrumb :index
}
format.js {
@@ -101,8 +95,6 @@ class TimeTablesController < ChouetteController
def duplicate
@time_table = Chouette::TimeTable.find params[:id]
- # prepare breadcrumb before prepare data for new timetable
- build_breadcrumb :edit
@time_table = @time_table.duplicate
render :new
end
diff --git a/app/controllers/timebands_controller.rb b/app/controllers/timebands_controller.rb
index 446255cac..765557193 100644
--- a/app/controllers/timebands_controller.rb
+++ b/app/controllers/timebands_controller.rb
@@ -6,14 +6,7 @@ class TimebandsController < ChouetteController
belongs_to :referential
- def new
- new! do
- build_breadcrumb :new
- end
- end
-
private
-
def timeband_params
params.require(:timeband).permit( :name, :start_time, :end_time )
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 23ce3ef0a..2452a2796 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,4 +1,4 @@
-class UsersController < BreadcrumbController
+class UsersController < InheritedResources::Base
defaults :resource_class => User
diff --git a/app/controllers/vehicle_journey_imports_controller.rb b/app/controllers/vehicle_journey_imports_controller.rb
index 2e2a3a718..58f8816aa 100644
--- a/app/controllers/vehicle_journey_imports_controller.rb
+++ b/app/controllers/vehicle_journey_imports_controller.rb
@@ -12,9 +12,7 @@ class VehicleJourneyImportsController < ChouetteController
def new
@vehicle_journey_import = VehicleJourneyImport.new(:route => route)
- new! do
- build_breadcrumb :new
- end
+ new!
end
def create
diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb
index 70cca15ed..050f2f219 100644
--- a/app/controllers/vehicle_journeys_controller.rb
+++ b/app/controllers/vehicle_journeys_controller.rb
@@ -76,7 +76,6 @@ class VehicleJourneysController < ChouetteController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
- build_breadcrumb :index
end
end
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index e271007d6..9b4f0d6c4 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -1,4 +1,4 @@
-class WorkbenchesController < BreadcrumbController
+class WorkbenchesController < InheritedResources::Base
before_action :query_params, only: [:show]
include RansackDateFilter
before_action only: [:show] { set_date_time_params("validity_period", Date) }
@@ -25,9 +25,7 @@ class WorkbenchesController < BreadcrumbController
current_workbench_id: params[:id]
}
)
- show! do
- build_breadcrumb :show
- end
+ show!
end
def delete_referentials