Class: Decidim::DecidimAwesome::Voting::VotingCardsBaseCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::DecidimAwesome::Voting::VotingCardsBaseCell
show all
- Includes:
- ComponentPathHelper, IconHelper, Proposals::ProposalVotesHelper
- Defined in:
- app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb
Instance Method Summary
collapse
Instance Method Details
#component_settings ⇒ Object
26
27
28
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 26
def component_settings
current_component.settings
end
|
#current_component ⇒ Object
22
23
24
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 22
def current_component
proposal.component
end
|
#current_vote ⇒ Object
30
31
32
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 30
def current_vote
@current_vote ||= Decidim::Proposals::ProposalVote.find_by(author: current_user, proposal: model)
end
|
#proposal ⇒ Object
14
15
16
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 14
def proposal
model
end
|
#sanitized_title ⇒ Object
18
19
20
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 18
def sanitized_title
strip_tags(translated_attribute(proposal.title))
end
|
#user_voted_weight ⇒ Object
34
35
36
|
# File 'app/cells/decidim/decidim_awesome/voting/voting_cards_base_cell.rb', line 34
def user_voted_weight
current_vote&.weight
end
|