diff options
| author | Xinhui | 2017-10-18 16:53:39 +0200 | 
|---|---|---|
| committer | Xinhui | 2017-10-18 16:53:39 +0200 | 
| commit | be1a8ec720ba10145630d6aaec1ebde5bcb52117 (patch) | |
| tree | ddb0f507a65b036ccf84823919c317f10bd52c13 | |
| parent | 1875caf7b065a05afc30bfc888cd642464580b27 (diff) | |
| download | chouette-core-be1a8ec720ba10145630d6aaec1ebde5bcb52117.tar.bz2 | |
Replace breadcrumb rendering in views
| -rw-r--r-- | app/views/layouts/application.html.slim | 5 | ||||
| -rw-r--r-- | app/views/layouts/navigation/_breadcrumb.html.slim | 3 | ||||
| -rw-r--r-- | config/breadcrumbs.rb | 43 | 
3 files changed, 44 insertions, 7 deletions
| diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 1bc9de136..8c731007d 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -13,15 +13,10 @@ html lang=I18n.locale      = javascript_pack_tag 'application'      = javascript_include_tag 'application' -     -    body      = render 'layouts/navigation/main_nav' -          = render 'layouts/flash_messages', flash: flash -          = yield -      #sidebar        = yield :sidebar diff --git a/app/views/layouts/navigation/_breadcrumb.html.slim b/app/views/layouts/navigation/_breadcrumb.html.slim index a101098fe..403ed6702 100644 --- a/app/views/layouts/navigation/_breadcrumb.html.slim +++ b/app/views/layouts/navigation/_breadcrumb.html.slim @@ -1,2 +1 @@ -- if @breadcrumbs.present? -  = render_breadcrumbs builder: BootstrapBreadcrumbsBuilder, tag: :li, separator: '' +== breadcrumbs diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb new file mode 100644 index 000000000..992e5d977 --- /dev/null +++ b/config/breadcrumbs.rb @@ -0,0 +1,43 @@ +crumb :root do +  link "Accueil", dashboard_path +end + +crumb :workbench do |workbench| +  link workbench.name, workbench_path(workbench) +end + +crumb :referential do |referential| +  link referential.name, referential_path(referential) +  parent :workbench, referential.workbench +end + +crumb :time_tables do |referential| +  link :time_tables, referential_time_tables_path(referential) +  parent :referential, referential +end + +crumb :time_table do |referential, time_table| +  link time_table.comment, referential_time_table_path(referential, time_table) +  parent :time_tables, referential +end + +# crumb :project do |project| +#   link project.name, project_path(project) +#   parent :projects +# end + +# crumb :project_issues do |project| +#   link "Issues", project_issues_path(project) +#   parent :project, project +# end + +# crumb :issue do |issue| +#   link issue.title, issue_path(issue) +#   parent :project_issues, issue.project +# end + +# If you want to split your breadcrumbs configuration over multiple files, you +# can create a folder named `config/breadcrumbs` and put your configuration +# files there. All *.rb files (e.g. `frontend.rb` or `products.rb`) in that +# folder are loaded and reloaded automatically when you change them, just like +# this file (`config/breadcrumbs.rb`). | 
