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:
taitus
2023-09-20 11:52:52 +02:00
parent 5009bf6c37
commit c96e3b027f
8 changed files with 6 additions and 8 deletions

View File

@@ -81,7 +81,7 @@
<div id="<%= dom_id(comment) %>_reply" class="reply">
<% unless valuation %>
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
<%= render "comments/votes", comment: comment %>
<%= render Comments::VotesComponent.new(comment) %>
</div>
<% end %>

View File

@@ -1 +0,0 @@
<%= render Comments::VotesComponent.new(comment) %>

View File

@@ -1 +1 @@
$("#<%= dom_id(@comment) %>_votes").html("<%= j render("comments/votes", comment: @comment) %>");
$("#<%= dom_id(@comment) %>_votes").html("<%= j render Comments::VotesComponent.new(@comment) %>");

View File

@@ -49,7 +49,7 @@
</div>
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column">
<%= render "debates/votes", debate: debate %>
<%= render Debates::VotesComponent.new(debate) %>
</div>
</div>

View File

@@ -1 +0,0 @@
<%= render Debates::VotesComponent.new(debate) %>

View File

@@ -57,7 +57,7 @@
<div class="sidebar-divider"></div>
<h2><%= t("votes.supports") %></h2>
<div id="<%= dom_id(@debate) %>_votes">
<%= render "debates/votes", debate: @debate %>
<%= render Debates::VotesComponent.new(@debate) %>
</div>
<%= render "shared/social_share",
share_title: t("debates.show.share"),

View File

@@ -1 +1 @@
$("#<%= dom_id(@debate) %>_votes").html("<%= j render("debates/votes", debate: @debate) %>");
$("#<%= dom_id(@debate) %>_votes").html("<%= j render Debates::VotesComponent.new(@debate) %>");

View File

@@ -24,7 +24,7 @@
</div>
<div class="comment-votes">
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
<%= render "comments/votes", comment: comment %>
<%= render Comments::VotesComponent.new(comment) %>
</div>
</div>
</div>