Commit a87154230eed1b1094f708d7b407ef62ccfb327d
1 parent
c09474f6
Exists in
ratings_minor_fixes
and in
4 other branches
Rewrite content_breadcrumbs_block view into slim
This provides a cleaner view than html.erb.
Showing
7 changed files
with
15 additions
and
12 deletions
Show diff stats
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
@@ -45,6 +45,6 @@ class ContentBreadcrumbsBlockViewTest < ActionView::TestCase | @@ -45,6 +45,6 @@ class ContentBreadcrumbsBlockViewTest < ActionView::TestCase | ||
45 | 45 | ||
46 | should 'render nothing if there is no links to show' do | 46 | should 'render nothing if there is no links to show' do |
47 | @page = nil | 47 | @page = nil |
48 | - assert_equal "\n", render_block_content(@block) | 48 | + assert_equal '', render_block_content(@block) |
49 | end | 49 | end |
50 | end | 50 | end |
plugins/breadcrumbs/views/blocks/_link.html.erb
@@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
1 | -<%= link_to link[:name], link[:url], :class => 'item' %> |
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +== link_to link[:name], link[:url], :class => 'item' |
plugins/breadcrumbs/views/blocks/_separator.html.erb
@@ -1 +0,0 @@ | @@ -1 +0,0 @@ | ||
1 | -<%= content_tag('span', ' > ', :class => 'separator') %> |
plugins/breadcrumbs/views/blocks/content_breadcrumbs.html.erb
@@ -1,9 +0,0 @@ | @@ -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 @@ | @@ -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] |