-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor fixes and improvements for frontend voting (#19)
* change basic copies * namespace css * add link "change my vote" * change opacity method * add tests * add check settings for abstain * fix cell test --------- Co-authored-by: Anna Topalidi <[email protected]>
- Loading branch information
1 parent
fd679a0
commit ef5770a
Showing
8 changed files
with
135 additions
and
22 deletions.
There are no files selected for viewing
30 changes: 22 additions & 8 deletions
30
app/cells/decidim/decidim_awesome/voting/three_flags_proposal/show.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
<h4 class="heading4 vote-title"><%= t("decidim.decidim_awesome.proposal_m.modal.title") %></h4> | ||
<% if voted_for_any? %> | ||
<p class="text-center"> | ||
<%= action_authorized_link_to :unvote, | ||
"👉 #{t('decidim.decidim_awesome.proposal_m.change_vote')}", | ||
proposal_vote_path(current_vote&.weight), | ||
resource: proposal, | ||
remote: true, | ||
method: :delete, | ||
id: "change-vote", | ||
class: "change-vote-button" %> | ||
<% end %> | ||
</p> | ||
|
||
<div class="flex--sbc"> | ||
<%= vote_block_for(proposal, 3, "green") %> | ||
<%= vote_block_for(proposal, 2, "yellow") %> | ||
<%= vote_block_for(proposal, 1, "red") %> | ||
</div> | ||
|
||
<%= action_authorized_link_to :vote, | ||
t("decidim.decidim_awesome.proposal_m.abstain"), | ||
proposal_vote_path(0), | ||
resource: proposal, | ||
remote: true, | ||
method: voted_for?(0) ? :delete : :post, | ||
class: "button expanded abstain-button small #{opacity_class_for(0)}" %> | ||
<% if current_component.settings.proposal_vote_abstain %> | ||
<%= action_authorized_link_to :vote, | ||
t("decidim.decidim_awesome.proposal_m.abstain"), | ||
proposal_vote_path(0), | ||
resource: proposal, | ||
remote: true, | ||
method: :post, | ||
class: "button expanded abstain-button small #{opacity_class_for(0)}" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
app/views/decidim/decidim_awesome/voting/three_flags/_show_vote_button.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<%= cell("decidim/decidim_awesome/voting/three_flags_proposal", proposal, from_proposals_list: true) %> | ||
<div class="voting-three-flags"> | ||
<%= cell("decidim/decidim_awesome/voting/three_flags_proposal", proposal, from_proposals_list: true) %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters