From d2b181777dc47f935f9449b1e5a887aaf87e76c5 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 27 Jun 2023 14:59:21 +0200 Subject: [PATCH] Call Legislation::Proposals::VotesComponent directly --- app/views/legislation/proposals/_proposal.html.erb | 2 +- app/views/legislation/proposals/_votes.html.erb | 1 - app/views/legislation/proposals/show.html.erb | 2 +- app/views/legislation/proposals/vote.js.erb | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 app/views/legislation/proposals/_votes.html.erb diff --git a/app/views/legislation/proposals/_proposal.html.erb b/app/views/legislation/proposals/_proposal.html.erb index c89742c2e12..b784e3ff837 100644 --- a/app/views/legislation/proposals/_proposal.html.erb +++ b/app/views/legislation/proposals/_proposal.html.erb @@ -64,7 +64,7 @@
- <%= render "legislation/proposals/votes", proposal: proposal %> + <%= render Legislation::Proposals::VotesComponent.new(proposal) %>
diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb deleted file mode 100644 index 1755272339c..00000000000 --- a/app/views/legislation/proposals/_votes.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render Legislation::Proposals::VotesComponent.new(proposal) %> diff --git a/app/views/legislation/proposals/show.html.erb b/app/views/legislation/proposals/show.html.erb index 8ace8381caa..0dc8654d028 100644 --- a/app/views/legislation/proposals/show.html.erb +++ b/app/views/legislation/proposals/show.html.erb @@ -105,7 +105,7 @@

<%= t("votes.supports") %>

- <%= render "votes", proposal: @proposal %> + <%= render Legislation::Proposals::VotesComponent.new(@proposal) %>
<%= render "shared/social_share", share_title: t("proposals.show.share"), diff --git a/app/views/legislation/proposals/vote.js.erb b/app/views/legislation/proposals/vote.js.erb index eccb9ea61cf..1845c6d8040 100644 --- a/app/views/legislation/proposals/vote.js.erb +++ b/app/views/legislation/proposals/vote.js.erb @@ -1 +1,2 @@ -$("#<%= dom_id(@proposal) %>_votes").html("<%= j render("legislation/proposals/votes", proposal: @proposal) %>"); +$("#<%= dom_id(@proposal) %>_votes") + .html("<%= j render Legislation::Proposals::VotesComponent.new(@proposal) %>");