Replace Partials with Direct Component Rendering
In this commit, we have performed a refactoring to enhance code organization. Several partials that were solely responsible for rendering components have been removed. Instead, we are now directly rendering the components within the views where these partials were previously used.
This commit is contained in:
@@ -81,7 +81,7 @@
|
|||||||
<div id="<%= dom_id(comment) %>_reply" class="reply">
|
<div id="<%= dom_id(comment) %>_reply" class="reply">
|
||||||
<% unless valuation %>
|
<% unless valuation %>
|
||||||
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
|
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
|
||||||
<%= render "comments/votes", comment: comment %>
|
<%= render Comments::VotesComponent.new(comment) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<%= render Comments::VotesComponent.new(comment) %>
|
|
||||||
@@ -1 +1 @@
|
|||||||
$("#<%= dom_id(@comment) %>_votes").html("<%= j render("comments/votes", comment: @comment) %>");
|
$("#<%= dom_id(@comment) %>_votes").html("<%= j render Comments::VotesComponent.new(@comment) %>");
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column">
|
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column">
|
||||||
<%= render "debates/votes", debate: debate %>
|
<%= render Debates::VotesComponent.new(debate) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<%= render Debates::VotesComponent.new(debate) %>
|
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<div class="sidebar-divider"></div>
|
<div class="sidebar-divider"></div>
|
||||||
<h2><%= t("votes.supports") %></h2>
|
<h2><%= t("votes.supports") %></h2>
|
||||||
<div id="<%= dom_id(@debate) %>_votes">
|
<div id="<%= dom_id(@debate) %>_votes">
|
||||||
<%= render "debates/votes", debate: @debate %>
|
<%= render Debates::VotesComponent.new(@debate) %>
|
||||||
</div>
|
</div>
|
||||||
<%= render "shared/social_share",
|
<%= render "shared/social_share",
|
||||||
share_title: t("debates.show.share"),
|
share_title: t("debates.show.share"),
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
$("#<%= dom_id(@debate) %>_votes").html("<%= j render("debates/votes", debate: @debate) %>");
|
$("#<%= dom_id(@debate) %>_votes").html("<%= j render Debates::VotesComponent.new(@debate) %>");
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="comment-votes">
|
<div class="comment-votes">
|
||||||
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
|
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
|
||||||
<%= render "comments/votes", comment: comment %>
|
<%= render Comments::VotesComponent.new(comment) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user