Move votes partials to components

We're going to change the code quite a bit, and with components we can
easily extract methods when necessary.
This commit is contained in:
Javi Martín
2021-09-28 19:10:27 +02:00
parent 0bacd5baf3
commit 78f372fd0b
16 changed files with 394 additions and 338 deletions

View File

@@ -0,0 +1,9 @@
class Legislation::Proposals::VotesComponent < ApplicationComponent
attr_reader :proposal, :legislation_proposal_votes
delegate :css_classes_for_vote, :current_user, :link_to_verify_account, :user_signed_in?, :voted_for?, :votes_percentage, to: :helpers
def initialize(proposal, legislation_proposal_votes:)
@proposal = proposal
@legislation_proposal_votes = legislation_proposal_votes
end
end