aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2014-09-22 13:44:56 +0200
committerMichel Etienne2014-09-22 13:44:56 +0200
commit50a9cf10902dd32a84e5074b5d392757f120102e (patch)
tree10bb3666331a00a7dec4190af0ef4a8d4ca72ef8
parenta724576b6551e1c00a2c82dd317a87128f137ddf (diff)
downloadchouette-core-50a9cf10902dd32a84e5074b5d392757f120102e.tar.bz2
correct breadcrumbs
-rw-r--r--app/controllers/breadcrumb_controller.rb4
-rw-r--r--app/controllers/chouette_controller.rb36
-rw-r--r--app/controllers/exports_controller.rb2
-rw-r--r--app/controllers/import_tasks_controller.rb2
-rw-r--r--app/controllers/rule_parameter_sets_controller.rb2
-rw-r--r--app/controllers/stop_area_copies_controller.rb4
-rw-r--r--app/controllers/time_tables_controller.rb2
-rw-r--r--app/controllers/vehicle_journey_imports_controller.rb2
-rw-r--r--app/helpers/breadcrumb_helper.rb18
9 files changed, 24 insertions, 48 deletions
diff --git a/app/controllers/breadcrumb_controller.rb b/app/controllers/breadcrumb_controller.rb
index 022636709..143651b52 100644
--- a/app/controllers/breadcrumb_controller.rb
+++ b/app/controllers/breadcrumb_controller.rb
@@ -28,13 +28,13 @@ class BreadcrumbController < InheritedResources::Base
def new
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
def create
create! do |success, failure|
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/chouette_controller.rb b/app/controllers/chouette_controller.rb
index 4aeb2aa09..753fbd2fc 100644
--- a/app/controllers/chouette_controller.rb
+++ b/app/controllers/chouette_controller.rb
@@ -15,40 +15,4 @@ class ChouetteController < BreadcrumbController
@referential ||= current_organisation.referentials.find params[:referential_id]
end
- 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 :show
- end
- end
-
- def create
- create! do |success, failure|
- build_breadcrumb :show
- end
- end
-
end
diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb
index 8de7e4f1f..cb555a3dd 100644
--- a/app/controllers/exports_controller.rb
+++ b/app/controllers/exports_controller.rb
@@ -8,7 +8,7 @@ class ExportsController < ChouetteController
def new
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
available_exports
end
end
diff --git a/app/controllers/import_tasks_controller.rb b/app/controllers/import_tasks_controller.rb
index a0d17d4d7..bee70d196 100644
--- a/app/controllers/import_tasks_controller.rb
+++ b/app/controllers/import_tasks_controller.rb
@@ -6,7 +6,7 @@ class ImportTasksController < ChouetteController
def new
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
available_imports
end
end
diff --git a/app/controllers/rule_parameter_sets_controller.rb b/app/controllers/rule_parameter_sets_controller.rb
index 63265bced..a422bed15 100644
--- a/app/controllers/rule_parameter_sets_controller.rb
+++ b/app/controllers/rule_parameter_sets_controller.rb
@@ -8,7 +8,7 @@ class RuleParameterSetsController < ChouetteController
def new
@rule_parameter_set = RuleParameterSet.default( @referential)
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/stop_area_copies_controller.rb b/app/controllers/stop_area_copies_controller.rb
index 642932acd..7c1fac8d9 100644
--- a/app/controllers/stop_area_copies_controller.rb
+++ b/app/controllers/stop_area_copies_controller.rb
@@ -1,4 +1,5 @@
class StopAreaCopiesController < ChouetteController
+ defaults :resource_class => StopAreaCopy
belongs_to :referential do
belongs_to :stop_area, :parent_class => Chouette::StopArea
end
@@ -9,8 +10,7 @@ class StopAreaCopiesController < ChouetteController
def new
@stop_area_copy = StopAreaCopy.new(:hierarchy => params[:hierarchy], :source => parent)
new! do
- add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential)
- add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area)
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index 2b3b556c8..b80f53b77 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -20,7 +20,7 @@ class TimeTablesController < ChouetteController
def new
@autocomplete_items = ActsAsTaggableOn::Tag.all
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/controllers/vehicle_journey_imports_controller.rb b/app/controllers/vehicle_journey_imports_controller.rb
index ce164c51e..7ce0aca23 100644
--- a/app/controllers/vehicle_journey_imports_controller.rb
+++ b/app/controllers/vehicle_journey_imports_controller.rb
@@ -13,7 +13,7 @@ class VehicleJourneyImportsController < ChouetteController
def new
@vehicle_journey_import = VehicleJourneyImport.new(:route => route)
new! do
- build_breadcrumb :show
+ build_breadcrumb :new
end
end
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 3b1bcca95..23cf6a6f2 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -28,6 +28,8 @@ module BreadcrumbHelper
connection_link_breadcrumb action
when "Chouette::TimeTable"
time_table_breadcrumb action
+ when "StopAreaCopy"
+ stop_area_copy_breadcrumb action
when "ImportTask"
import_breadcrumb action
when "Export"
@@ -38,6 +40,8 @@ module BreadcrumbHelper
rule_parameter_breadcrumb action
when "User"
user_breadcrumb action
+ when "Organisation"
+ organisation_breadcrumb action
else
Rails.logger.info "---------"
Rails.logger.info ">>>>>>> "+resource_class.to_s+" unmapped"
@@ -65,6 +69,10 @@ module BreadcrumbHelper
add_breadcrumb breadcrumb_label(@stop_area), referential_stop_area_path(@referential, @stop_area),:title => breadcrumb_tooltip(@stop_area) if action == :edit
end
+ def stop_area_copy_breadcrumb(action)
+ stop_area_breadcrumb :edit
+ end
+
def access_point_breadcrumb(action)
stop_area_breadcrumb :edit
add_breadcrumb breadcrumb_label(@access_point), referential_stop_area_access_point_path(@referential, @stop_area,@access_point),:title => breadcrumb_tooltip(@access_point) if action == :edit
@@ -144,12 +152,16 @@ module BreadcrumbHelper
end
def referential_breadcrumb (action = :edit)
- add_breadcrumb I18n.t("breadcrumbs.referentials"), referentials_path
- add_breadcrumb breadcrumb_label(@referential), referential_path(@referential),:title => breadcrumb_tooltip(@referential) if action != :index && @referential.present?
+ organisation_breadcrumb
+ add_breadcrumb breadcrumb_label(@referential), referential_path(@referential),:title => breadcrumb_tooltip(@referential) if action == :edit
end
+ def organisation_breadcrumb (action = :edit)
+ add_breadcrumb I18n.t("breadcrumbs.referentials"), referentials_path
+ end
+
def user_breadcrumb (action)
- referential_breadcrumb
+ organisation_breadcrumb
add_breadcrumb I18n.t("breadcrumbs.users"), organisation_path unless action == :index
add_breadcrumb breadcrumb_label(@user), organisation_user_path(@user),:title => breadcrumb_tooltip(@user) unless action == :index
end