diff options
| author | Xinhui | 2017-10-26 14:43:51 +0200 |
|---|---|---|
| committer | Xinhui | 2017-10-26 14:43:51 +0200 |
| commit | 0c8208345a1dd5413f589dbf8b34871481c3800c (patch) | |
| tree | 0a25b2eada8248e5fc53643281c59e0ee426783c | |
| parent | b0654a6e9242e19008540d1ac5fcba5c578227a7 (diff) | |
| download | chouette-core-0c8208345a1dd5413f589dbf8b34871481c3800c.tar.bz2 | |
Remove bootstrap breadcrumbs lib
| -rw-r--r-- | lib/bootstrap_breadcrumbs_builder.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/bootstrap_breadcrumbs_builder.rb b/lib/bootstrap_breadcrumbs_builder.rb deleted file mode 100644 index daa154bdf..000000000 --- a/lib/bootstrap_breadcrumbs_builder.rb +++ /dev/null @@ -1,31 +0,0 @@ -# bootstrap builder for breadcrumbs_on_rails gem -class BootstrapBreadcrumbsBuilder < BreadcrumbsOnRails::Breadcrumbs::Builder - def render - @context.content_tag(:ul, class: 'breadcrumb') do - @elements.collect do |element| - render_element(element) - end.join.html_safe - end - end - - def render_element(element) - active = element.path.nil? || @context.current_page?(compute_path(element)) - # Bootstrap use '/' divider by default but you can customize it: - # divider = @context.content_tag(:span, '/'.html_safe, class: 'divider') unless active - - @context.content_tag(:li, :class => ('active' if active)) do - content = if element.path.nil? - compute_name(element) - else - @context.link_to_unless_current(compute_name(element), compute_path(element), element.options) - end - - # content + (divider || '') - content - end - end -end - - -# Usage: -# = render_breadcrumbs(builder: BootstrapBreadcrumbsBuilder)
\ No newline at end of file |
