Commit da702534a97325afa1f1bf8d27383b1f18a6bbf5
Exists in
ratings_minor_fixes
and in
3 other branches
Merge branch 'scope_plugin_partials' into 'master'
Scope plugin partials This affects RelevantContent and DislayContent plugins for which I've created unscoped partials which can conflict with ohter plugins. See merge request !931
Showing
14 changed files
with
45 additions
and
45 deletions
Show diff stats
plugins/display_content/views/blocks/_document.slim
... | ... | @@ -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 | 0 | \ No newline at end of file |
plugins/display_content/views/blocks/_read_more.slim
plugins/display_content/views/blocks/_section.slim
... | ... | @@ -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
plugins/display_content/views/blocks/display_content.slim
plugins/display_content/views/blocks/display_content/_document.slim
0 → 100644
... | ... | @@ -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 | 5 | \ No newline at end of file | ... | ... |
plugins/display_content/views/blocks/display_content/_read_more.slim
0 → 100644
plugins/display_content/views/blocks/display_content/_section.slim
0 → 100644
... | ... | @@ -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
plugins/relevant_content/views/blocks/_doc.slim
plugins/relevant_content/views/blocks/_subcontent.slim
plugins/relevant_content/views/blocks/relevant_content.slim
1 | 1 | = block_title(block.title, block.subtitle) |
2 | 2 | |
3 | 3 | - if block.show_most_read |
4 | - = render partial: 'blocks/subcontent', locals: {docs: Article.most_accessed(block.owner, block.limit), title: _("Most read articles"), html_class: 'mread'} | |
4 | + = render partial: 'blocks/relevant_content/subcontent', locals: {docs: Article.most_accessed(block.owner, block.limit), title: _("Most read articles"), html_class: 'mread'} | |
5 | 5 | - if block.show_most_commented |
6 | - = render partial: 'blocks/subcontent', locals: {docs: Article.most_commented_relevant_content(block.owner, block.limit), title: _("Most commented articles"), html_class: 'mcommented'} | |
6 | + = render partial: 'blocks/relevant_content/subcontent', locals: {docs: Article.most_commented_relevant_content(block.owner, block.limit), title: _("Most commented articles"), html_class: 'mcommented'} | |
7 | 7 | |
8 | 8 | - if block.env.plugin_enabled?('VotePlugin') |
9 | 9 | - if block.show_most_liked |
10 | - = render partial: 'blocks/subcontent', locals: {docs: Article.more_positive_votes(block.owner, block.limit), title: _("Most liked articles"), html_class: 'mliked'} | |
10 | + = render partial: 'blocks/relevant_content/subcontent', locals: {docs: Article.more_positive_votes(block.owner, block.limit), title: _("Most liked articles"), html_class: 'mliked'} | |
11 | 11 | - if block.show_most_disliked |
12 | - = render partial: 'blocks/subcontent', locals: {docs: Article.more_negative_votes(block.owner, block.limit), title: _("Most disliked articles"), html_class: 'mdisliked'} | |
12 | + = render partial: 'blocks/relevant_content/subcontent', locals: {docs: Article.more_negative_votes(block.owner, block.limit), title: _("Most disliked articles"), html_class: 'mdisliked'} | |
13 | 13 | - if block.show_most_voted |
14 | - = render partial: 'blocks/subcontent', locals: {docs: Article.most_voted(block.owner, block.limit), title: _("Most voted articles"), html_class: 'mvoted'} | |
14 | + = render partial: 'blocks/relevant_content/subcontent', locals: {docs: Article.most_voted(block.owner, block.limit), title: _("Most voted articles"), html_class: 'mvoted'} | ... | ... |
plugins/relevant_content/views/blocks/relevant_content/_doc.slim
0 → 100644
plugins/relevant_content/views/blocks/relevant_content/_subcontent.slim
0 → 100644