aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/breadcrumb_helper.rb
diff options
context:
space:
mode:
authorAlban Peignier2016-09-09 11:45:52 +0200
committerAlban Peignier2016-09-09 11:45:52 +0200
commit0c57a641272bcf483ebaca7e8b492f23e9579bb1 (patch)
treef19e8787646a884fd894caa877cde876d3c3a564 /app/helpers/breadcrumb_helper.rb
parent9ae84db05b384e2426a16d15004570eb6cf2e7fe (diff)
downloadchouette-core-0c57a641272bcf483ebaca7e8b492f23e9579bb1.tar.bz2
Update breadcrumb to manage Companies under LineReferential. Refs #905
Diffstat (limited to 'app/helpers/breadcrumb_helper.rb')
-rw-r--r--app/helpers/breadcrumb_helper.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 5eda227c8..6cbeee4c9 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -52,6 +52,8 @@ module BreadcrumbHelper
user_breadcrumb action
when "Referential"
referential_breadcrumb action
+ when "LineReferential"
+ line_referential_breadcrumb action
when "Organisation"
organisation_breadcrumb action
when "Api::V1::ApiKey"
@@ -160,10 +162,23 @@ module BreadcrumbHelper
route_breadcrumb :edit
end
+ def line_referential_breadcrumb(action = :edit)
+ organisation_breadcrumb
+ if @line_referential
+ add_breadcrumb breadcrumb_label(@line_referential), line_referential_path(@line_referential), :title => breadcrumb_tooltip(@line_referential) if action == :edit || action == :show || action == :update
+ end
+ end
+
def company_breadcrumb (action)
- referential_breadcrumb
- add_breadcrumb Chouette::Company.model_name.human(:count => 2), line_referential_companies_path(@line_referential) unless action == :index
- add_breadcrumb breadcrumb_label(@company), line_referential_company_path(@line_referential, @company),:title => breadcrumb_tooltip(@company) if action == :edit
+ if @line_referential
+ line_referential_breadcrumb
+ add_breadcrumb Chouette::Company.model_name.human(:count => 2), line_referential_companies_path(@line_referential) unless action == :index
+ add_breadcrumb breadcrumb_label(@company), referential_company_path(@line_referential, @company),:title => breadcrumb_tooltip(@company) if action == :edit
+ else
+ referential_breadcrumb
+ add_breadcrumb Chouette::Company.model_name.human(:count => 2), referential_companies_path(@referential) unless action == :index
+ add_breadcrumb breadcrumb_label(@company), referential_company_path(@referential, @company),:title => breadcrumb_tooltip(@company) if action == :edit
+ end
end
def import_breadcrumb (action)