Commit a87154230eed1b1094f708d7b407ef62ccfb327d

Authored by Rafael Reggiani Manzo
1 parent c09474f6

Rewrite content_breadcrumbs_block view into slim

This provides a cleaner view than html.erb.
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
... ... @@ -45,6 +45,6 @@ class ContentBreadcrumbsBlockViewTest < ActionView::TestCase
45 45  
46 46 should 'render nothing if there is no links to show' do
47 47 @page = nil
48   - assert_equal "\n", render_block_content(@block)
  48 + assert_equal '', render_block_content(@block)
49 49 end
50 50 end
... ...
plugins/breadcrumbs/views/blocks/_link.html.erb
... ... @@ -1 +0,0 @@
1   -<%= link_to link[:name], link[:url], :class => 'item' %>
plugins/breadcrumbs/views/blocks/_link.html.slim 0 → 100644
... ... @@ -0,0 +1 @@
  1 +== link_to link[:name], link[:url], :class => 'item'
... ...
plugins/breadcrumbs/views/blocks/_separator.html.erb
... ... @@ -1 +0,0 @@
1   -<%= content_tag('span', ' > ', :class => 'separator') %>
plugins/breadcrumbs/views/blocks/_separator.slim 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +span class='separator'
  2 + |>
... ...
plugins/breadcrumbs/views/blocks/content_breadcrumbs.html.erb
... ... @@ -1,9 +0,0 @@
1   -<% extend BreadcrumbsPluginHelper %>
2   -
3   -<% links = trail(block, @page, @profile, params).flatten %>
4   -<% unless links.empty? %>
5   - <%= render :partial => 'blocks/link', :collection => links, :as => 'link', :spacer_template => 'blocks/separator' %>
6   - <% if block.show_section_name %>
7   - <%= content_tag('div', (block.show_profile ? links.second[:name] : links.first[:name]), :class => 'section-name') %>
8   - <% end %>
9   -<% end %>
plugins/breadcrumbs/views/blocks/content_breadcrumbs.slim 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +- extend BreadcrumbsPluginHelper
  2 +
  3 +- links = trail(block, @page, @profile, params).flatten
  4 +- unless links.empty?
  5 + == render :partial => 'blocks/link', :collection => links, :as => 'link', :spacer_template => 'blocks/separator'
  6 + - if block.show_section_name
  7 + div class='section-name'
  8 + - if block.show_profile
  9 + = links.second[:name]
  10 + - else
  11 + = links.first[:name]
... ...