aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-10-25 12:02:09 +0200
committerXinhui2017-10-25 12:02:09 +0200
commitb7a4ff1063832600fd207a42fbe9eaaef761e7b4 (patch)
tree40e2551c8e08f04114479c0ba208b4f83679e77e
parent6ecea55476e5a96124081e3e56493feb7e6ebd37 (diff)
downloadchouette-core-b7a4ff1063832600fd207a42fbe9eaaef761e7b4.tar.bz2
Breadcrumb for referential_group_of_lines
-rw-r--r--app/controllers/referential_group_of_lines_controller.rb5
-rw-r--r--app/views/referential_group_of_lines/index.html.slim1
-rw-r--r--app/views/referential_group_of_lines/new.html.slim3
-rw-r--r--app/views/referential_group_of_lines/show.html.slim9
-rw-r--r--config/breadcrumbs.rb9
5 files changed, 18 insertions, 9 deletions
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/views/referential_group_of_lines/index.html.slim b/app/views/referential_group_of_lines/index.html.slim
index 9fa3eb381..e782db090 100644
--- a/app/views/referential_group_of_lines/index.html.slim
+++ b/app/views/referential_group_of_lines/index.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :referential_group_of_lines, @referential
= title_tag t('group_of_lines.index.title')
= search_form_for @q, :url => referential_group_of_lines_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f|
diff --git a/app/views/referential_group_of_lines/new.html.slim b/app/views/referential_group_of_lines/new.html.slim
index 36b5d6b4e..8807bc402 100644
--- a/app/views/referential_group_of_lines/new.html.slim
+++ b/app/views/referential_group_of_lines/new.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :referential_group_of_lines, @referential
= title_tag t('group_of_lines.new.title')
-== render 'form' \ No newline at end of file
+== render 'form'
diff --git a/app/views/referential_group_of_lines/show.html.slim b/app/views/referential_group_of_lines/show.html.slim
index a0635f158..504af0187 100644
--- a/app/views/referential_group_of_lines/show.html.slim
+++ b/app/views/referential_group_of_lines/show.html.slim
@@ -1,8 +1,9 @@
+- breadcrumb :referential_group_of_line, @referential, @group_of_line
= title_tag t('group_of_lines.show.title', :group_of_line => @group_of_line.name )
.group_of_line_show
= @map.to_html
-
+
.summary
p
label = "#{@group_of_line.human_attribute_name('registration_number')} : "
@@ -13,10 +14,10 @@
= @group_of_line.comment
p.after_map
-
+
h3.group_of_line_lines = t('.lines')
.lines_detail
- == render partial: "lines_detail"
+ == render partial: "lines_detail"
- content_for :sidebar do
ul.actions
@@ -28,4 +29,4 @@
= link_to t('group_of_lines.actions.destroy'), referential_group_of_line_path(@referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove'
br
- = creation_tag(@group_of_line) \ No newline at end of file
+ = creation_tag(@group_of_line)
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index 2fc586c28..e47c61e10 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -31,6 +31,15 @@ crumb :referential_network do |referential, network|
parent :referential_networks, referential
end
+crumb :referential_group_of_lines do |referential|
+ link I18n.t('group_of_lines.index.title'), referential_networks_path(referential)
+ parent :referential, referential
+end
+
+crumb :referential_group_of_line do |referential, group_of_line|
+ link group_of_line.name, referential_group_of_line_path(referential, group_of_line)
+ parent :referential_group_of_lines, referential
+end
crumb :time_tables do |referential|
link I18n.t('time_tables.index.title'), referential_time_tables_path(referential)