Refactors shared/_tags view to always take a param called taggable
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<%= link_to debate.description, debate %>
|
<%= link_to debate.description, debate %>
|
||||||
<div class="truncate"></div>
|
<div class="truncate"></div>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/tags", debate: debate, limit: 5 %>
|
<%= render "shared/tags", taggable: debate, limit: 5 %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
<%= safe_html_with_links @debate.description %>
|
<%= safe_html_with_links @debate.description %>
|
||||||
|
|
||||||
<%= render 'shared/tags', debate: @debate %>
|
<%= render 'shared/tags', taggable: @debate %>
|
||||||
|
|
||||||
<div class='js-moderator-debate-actions'>
|
<div class='js-moderator-debate-actions'>
|
||||||
<%= render 'actions', debate: @debate %>
|
<%= render 'actions', debate: @debate %>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<%= link_to proposal.summary, proposal %>
|
<%= link_to proposal.summary, proposal %>
|
||||||
<div class="truncate"></div>
|
<div class="truncate"></div>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/tags", proposal: proposal, limit: 5 %>
|
<%= render "shared/tags", taggable: proposal, limit: 5 %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
<h4><%= @proposal.question %></h4>
|
<h4><%= @proposal.question %></h4>
|
||||||
|
|
||||||
<%= render 'shared/tags', proposal: @proposal %>
|
<%= render 'shared/tags', taggable: @proposal %>
|
||||||
|
|
||||||
<div class='js-moderator-proposal-actions'>
|
<div class='js-moderator-proposal-actions'>
|
||||||
<%= render 'actions', proposal: @proposal %>
|
<%= render 'actions', proposal: @proposal %>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<%- limit ||= nil %>
|
<%- limit ||= nil %>
|
||||||
<%- taggable = defined?(debate) ? debate : proposal %>
|
|
||||||
|
|
||||||
<% if taggable.tags.any? %>
|
<% if taggable.tags.any? %>
|
||||||
<span class='tags'>
|
<span class='tags'>
|
||||||
|
|||||||
Reference in New Issue
Block a user