aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-10-20 11:14:03 +0200
committerXinhui2017-10-20 11:14:03 +0200
commit5b0d0dfb9c4ae6c45a34fcbee224f1483ff4401b (patch)
tree867ed06539d5b7b7b6fa79b7d6190890099144a1
parent5d9793a52fcdf3009e247eeaace4cdd31f33b45a (diff)
downloadchouette-core-5b0d0dfb9c4ae6c45a34fcbee224f1483ff4401b.tar.bz2
Breadcrumb for group_of_lines
-rw-r--r--app/controllers/group_of_lines_controller.rb5
-rw-r--r--app/views/group_of_lines/edit.html.slim3
-rw-r--r--app/views/group_of_lines/index.html.slim1
-rw-r--r--app/views/group_of_lines/new.html.slim3
-rw-r--r--app/views/group_of_lines/show.html.slim2
-rw-r--r--config/breadcrumbs.rb14
6 files changed, 20 insertions, 8 deletions
diff --git a/app/controllers/group_of_lines_controller.rb b/app/controllers/group_of_lines_controller.rb
index 5cadd40d3..0553ba482 100644
--- a/app/controllers/group_of_lines_controller.rb
+++ b/app/controllers/group_of_lines_controller.rb
@@ -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/views/group_of_lines/edit.html.slim b/app/views/group_of_lines/edit.html.slim
index 75d530b08..ef7a405d3 100644
--- a/app/views/group_of_lines/edit.html.slim
+++ b/app/views/group_of_lines/edit.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :group_of_line, @group_of_line
= title_tag t('group_of_lines.edit.title', :group_of_line => @group_of_line.name)
-= render 'form' \ No newline at end of file
+= render 'form'
diff --git a/app/views/group_of_lines/index.html.slim b/app/views/group_of_lines/index.html.slim
index 69b1cd0d6..28f3ab264 100644
--- a/app/views/group_of_lines/index.html.slim
+++ b/app/views/group_of_lines/index.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :group_of_lines, @line_referential
= title_tag t('group_of_lines.index.title')
= search_form_for @q, :url => line_referential_group_of_lines_path(@line_referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f|
diff --git a/app/views/group_of_lines/new.html.slim b/app/views/group_of_lines/new.html.slim
index 36b5d6b4e..395c2b3e7 100644
--- a/app/views/group_of_lines/new.html.slim
+++ b/app/views/group_of_lines/new.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :group_of_lines, @line_referential
= title_tag t('group_of_lines.new.title')
-== render 'form' \ No newline at end of file
+== render 'form'
diff --git a/app/views/group_of_lines/show.html.slim b/app/views/group_of_lines/show.html.slim
index b934cb1ef..de215bfa0 100644
--- a/app/views/group_of_lines/show.html.slim
+++ b/app/views/group_of_lines/show.html.slim
@@ -1,3 +1,5 @@
+- breadcrumb :group_of_line, @group_of_line
+
= title_tag t('group_of_lines.show.title', :group_of_line => @group_of_line.name )
.group_of_line_show
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index 7b7a38058..5e35eb79b 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -68,7 +68,7 @@ crumb :line_referential do |line_referential|
end
crumb :companies do |line_referential|
- link I18n.t('companies.index.title'), line_referential_companies_path
+ link I18n.t('companies.index.title'), line_referential_companies_path(line_referential)
parent :line_referential, line_referential
end
@@ -78,7 +78,7 @@ crumb :company do |company|
end
crumb :networks do |line_referential|
- link I18n.t('networks.index.title'), line_referential_networks_path
+ link I18n.t('networks.index.title'), line_referential_networks_path(line_referential)
parent :line_referential, line_referential
end
@@ -87,6 +87,16 @@ crumb :network do |network|
parent :networks, network.line_referential
end
+crumb :group_of_lines do |line_referential|
+ link I18n.t('group_of_lines.index.title'), line_referential_group_of_lines_path(line_referential)
+ parent :line_referential, line_referential
+end
+
+crumb :group_of_line do |group_of_line|
+ link group_of_line.name, line_referential_group_of_line_path(group_of_line.line_referential, group_of_line)
+ parent :group_of_lines, group_of_line.line_referential
+end
+
crumb :lines do |line_referential|
link I18n.t('lines.index.title'), line_referential_lines_path
parent :line_referential, line_referential