aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/breadcrumb_helper.rb
diff options
context:
space:
mode:
authorBruno Perles2015-12-16 10:02:29 +0100
committerBruno Perles2015-12-16 10:02:29 +0100
commit013f4fa8fe9bb08f3ed1d15f905ca2a8437d6aa7 (patch)
tree426b9c17167c10547da2222517cbd4433ae554fe /app/helpers/breadcrumb_helper.rb
parent2590606c5912a85b8cb1aaa40c57dab67d75e7f7 (diff)
downloadchouette-core-013f4fa8fe9bb08f3ed1d15f905ca2a8437d6aa7.tar.bz2
Add route_sections for traces
Diffstat (limited to 'app/helpers/breadcrumb_helper.rb')
-rw-r--r--app/helpers/breadcrumb_helper.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 52da8b887..69494321b 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -1,6 +1,7 @@
module BreadcrumbHelper
- def build_breadcrumb(action)
+ def build_breadcrumb(action)
+ action = action.to_sym
case resource_class.to_s
when "Chouette::Network"
network_breadcrumb action
@@ -30,6 +31,8 @@ module BreadcrumbHelper
connection_link_breadcrumb action
when "Chouette::TimeTable"
time_table_breadcrumb action
+ when "Chouette::RouteSection"
+ route_section_breadcrumb action
when "Chouette::Timeband"
timeband_breadcrumb action
when "StopAreaCopy"
@@ -106,6 +109,12 @@ module BreadcrumbHelper
add_breadcrumb breadcrumb_label(@time_table), referential_time_table_path(@referential, @time_table),:title => breadcrumb_tooltip(@time_table) if action == :edit
end
+ def route_section_breadcrumb(action)
+ referential_breadcrumb
+ add_breadcrumb Chouette::RouteSection.model_name.human.pluralize, referential_route_sections_path(@referential)
+ add_breadcrumb breadcrumb_label(resource), referential_route_section_path(@referential, resource),:title => breadcrumb_tooltip(resource) if action.in?([:show, :edit])
+ end
+
def timeband_breadcrumb(action)
referential_breadcrumb
add_breadcrumb Chouette::Timeband.model_name.human(:count => 2), referential_timebands_path(@referential) unless action == :index