diff options
| author | Xinhui | 2017-11-07 16:59:57 +0100 |
|---|---|---|
| committer | Xinhui | 2017-11-07 16:59:57 +0100 |
| commit | 732bb0a566bcfe388f5d849d12921808c4b63b09 (patch) | |
| tree | 345075ebb8e277088dbed37a709e446953fe39ea /app | |
| parent | 43033eef0f6582f4bc4e64199310cc624e18f1be (diff) | |
| parent | 1f68a5401ff63d568ba8fbecd3c3ab06335f91e7 (diff) | |
| download | chouette-core-732bb0a566bcfe388f5d849d12921808c4b63b09.tar.bz2 | |
Merge branch '4820_refactoring_breadcrumb'
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/breadcrumb_helper.rb | 5 | ||||
| -rw-r--r-- | app/views/companies/edit.html.slim | 4 | ||||
| -rw-r--r-- | app/views/compliance_controls/edit.html.slim | 2 | ||||
| -rw-r--r-- | app/views/dashboards/show.html.slim | 1 | ||||
| -rw-r--r-- | app/views/layouts/navigation/_breadcrumb.html.slim | 2 | ||||
| -rw-r--r-- | app/views/lines/edit.html.slim | 4 | ||||
| -rw-r--r-- | app/views/referential_companies/edit.html.slim | 4 | ||||
| -rw-r--r-- | app/views/referential_group_of_lines/edit.html.slim | 4 | ||||
| -rw-r--r-- | app/views/route_sections/edit.html.slim | 4 | ||||
| -rw-r--r-- | app/views/shared/_breadcrumb.html.slim | 2 |
10 files changed, 25 insertions, 7 deletions
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb new file mode 100644 index 000000000..3da119247 --- /dev/null +++ b/app/helpers/breadcrumb_helper.rb @@ -0,0 +1,5 @@ +module BreadcrumbHelper + def breadcrumb_name(object, prop='name') + "#{object.class.model_name.human} #{object.public_send(prop)}".truncate(50) + end +end diff --git a/app/views/companies/edit.html.slim b/app/views/companies/edit.html.slim index 6c415edfb..2f4c559b9 100644 --- a/app/views/companies/edit.html.slim +++ b/app/views/companies/edit.html.slim @@ -1,2 +1,4 @@ +- breadcrumb :company, @company + = title_tag t('companies.edit.title', company: @company.name) -= render 'form'
\ No newline at end of file += render 'form' diff --git a/app/views/compliance_controls/edit.html.slim b/app/views/compliance_controls/edit.html.slim index 1d478e845..192e3521f 100644 --- a/app/views/compliance_controls/edit.html.slim +++ b/app/views/compliance_controls/edit.html.slim @@ -1,3 +1,5 @@ +- breadcrumb :compliance_control, @compliance_control + = pageheader 'jeux-de-controle', t('compliance_controls.edit.title') diff --git a/app/views/dashboards/show.html.slim b/app/views/dashboards/show.html.slim index 66154712d..e86af55a6 100644 --- a/app/views/dashboards/show.html.slim +++ b/app/views/dashboards/show.html.slim @@ -1,3 +1,4 @@ +- breadcrumb :root / PageHeader = pageheader 'tableau-de-bord', t('.title', organisation: current_organisation.name) diff --git a/app/views/layouts/navigation/_breadcrumb.html.slim b/app/views/layouts/navigation/_breadcrumb.html.slim index 403ed6702..5cb6fe5c9 100644 --- a/app/views/layouts/navigation/_breadcrumb.html.slim +++ b/app/views/layouts/navigation/_breadcrumb.html.slim @@ -1 +1 @@ -== breadcrumbs +== breadcrumbs display_single_fragment: true diff --git a/app/views/lines/edit.html.slim b/app/views/lines/edit.html.slim index 0036d023b..3c2eee03f 100644 --- a/app/views/lines/edit.html.slim +++ b/app/views/lines/edit.html.slim @@ -1,3 +1,5 @@ +- breadcrumb :line, @line + = title_tag t('lines.edit.title', line: @line.name) -= render 'form'
\ No newline at end of file += render 'form' diff --git a/app/views/referential_companies/edit.html.slim b/app/views/referential_companies/edit.html.slim index 6c415edfb..d191d2a37 100644 --- a/app/views/referential_companies/edit.html.slim +++ b/app/views/referential_companies/edit.html.slim @@ -1,2 +1,4 @@ +- breadcrumb :referential_company, @referential, @company + = title_tag t('companies.edit.title', company: @company.name) -= render 'form'
\ No newline at end of file += render 'form' diff --git a/app/views/referential_group_of_lines/edit.html.slim b/app/views/referential_group_of_lines/edit.html.slim index 75d530b08..34383de39 100644 --- a/app/views/referential_group_of_lines/edit.html.slim +++ b/app/views/referential_group_of_lines/edit.html.slim @@ -1,3 +1,5 @@ +- breadcrumb :referential_group_of_line, @referential, @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/route_sections/edit.html.slim b/app/views/route_sections/edit.html.slim index 15944fd75..7c95def73 100644 --- a/app/views/route_sections/edit.html.slim +++ b/app/views/route_sections/edit.html.slim @@ -1,4 +1,6 @@ +- breadcrumb :referential_route_section, @referential, @route_section + = title_tag t('route_sections.edit.title') = @map.to_html if @map -== render 'form'
\ No newline at end of file +== render 'form' diff --git a/app/views/shared/_breadcrumb.html.slim b/app/views/shared/_breadcrumb.html.slim index 403ed6702..5cb6fe5c9 100644 --- a/app/views/shared/_breadcrumb.html.slim +++ b/app/views/shared/_breadcrumb.html.slim @@ -1 +1 @@ -== breadcrumbs +== breadcrumbs display_single_fragment: true |
