Commit 4ec3d8c28376eb65ec15bc36ef0a448332a4bf57

Authored by Rafael Reggiani Manzo
1 parent b896adbe

Scope DislayContentPlugin partials

By moving them into a folder we avoid possible name clashes with other
plugins.
plugins/display_content/views/blocks/_document.slim
@@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
1 -li  
2 - - unless item.folder? || item.class == RssFeed  
3 - = render partial: 'blocks/section', collection: block.sections, locals: { block: block, item: item }  
4 - = render partial: 'blocks/read_more', locals: { item: item, abstract_section: block.sections.bsearch { |section| section[:value] == 'abstract' }, block: block }  
5 \ No newline at end of file 0 \ No newline at end of file
plugins/display_content/views/blocks/_read_more.slim
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -- if !abstract_section.nil? && block.display_section?(abstract_section)  
2 - div class='read_more'  
3 - = link_to(_('Read more'), item.url)  
plugins/display_content/views/blocks/_section.slim
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -- if block.display_section?(section)  
2 - - case section[:value]  
3 - - when 'publish_date'  
4 - div class='published-at'  
5 - = show_date(item.published_at, false)  
6 - - when 'title'  
7 - div class='title'  
8 - = link_to(h(item.title), item.url)  
9 - - when 'abstract'  
10 - div class='lead'  
11 - = item.abstract  
12 - - when 'body'  
13 - div class='body'  
14 - = item.body  
15 - - when 'image'  
16 - - unless item.image || item.image.public_filename  
17 - div class='image'  
18 - = link_to(image_tag(item.image.public_filename), item.url)  
19 - - when 'tags'  
20 - - unless item.tags.empty?  
21 - div class='tags'  
22 - = render partial: 'blocks/tag', collection: item.tags  
plugins/display_content/views/blocks/_tag.slim
@@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
1 -span  
2 - = tag.name  
3 \ No newline at end of file 0 \ No newline at end of file
plugins/display_content/views/blocks/display_content.slim
1 = block.block_title(block.title, block.subtitle) 1 = block.block_title(block.title, block.subtitle)
2 2
3 ul 3 ul
4 - = render partial: 'blocks/document', collection: block.docs, as: :item, locals: { block: block } 4 + = render partial: 'blocks/display_content/document', collection: block.docs, as: :item, locals: { block: block }
plugins/display_content/views/blocks/display_content/_document.slim 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +li
  2 + - unless item.folder? || item.class == RssFeed
  3 + = render partial: 'blocks/display_content/section', collection: block.sections, locals: { block: block, item: item }
  4 + = render partial: 'blocks/display_content/read_more', locals: { item: item, abstract_section: block.sections.bsearch { |section| section[:value] == 'abstract' }, block: block }
0 \ No newline at end of file 5 \ No newline at end of file
plugins/display_content/views/blocks/display_content/_read_more.slim 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +- if !abstract_section.nil? && block.display_section?(abstract_section)
  2 + div class='read_more'
  3 + = link_to(_('Read more'), item.url)
plugins/display_content/views/blocks/display_content/_section.slim 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +- if block.display_section?(section)
  2 + - case section[:value]
  3 + - when 'publish_date'
  4 + div class='published-at'
  5 + = show_date(item.published_at, false)
  6 + - when 'title'
  7 + div class='title'
  8 + = link_to(h(item.title), item.url)
  9 + - when 'abstract'
  10 + div class='lead'
  11 + = item.abstract
  12 + - when 'body'
  13 + div class='body'
  14 + = item.body
  15 + - when 'image'
  16 + - unless item.image || item.image.public_filename
  17 + div class='image'
  18 + = link_to(image_tag(item.image.public_filename), item.url)
  19 + - when 'tags'
  20 + - unless item.tags.empty?
  21 + div class='tags'
  22 + = render partial: 'blocks/display_content/tag', collection: item.tags
plugins/display_content/views/blocks/display_content/_tag.slim 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +span
  2 + = tag.name
0 \ No newline at end of file 3 \ No newline at end of file