forked from consuldemocracy/consuldemocracy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request consuldemocracy#94 from AyuntamientoMadrid/vote_co…
…mments-25 refactors voting
- Loading branch information
Showing
17 changed files
with
263 additions
and
110 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<span class="in_favor"> | ||
<%= link_to "up", vote_comment_path(comment, value: 'yes'), | ||
method: "post", remote: true %> | ||
<%= comment.get_likes.size %> | ||
</span> | ||
|
||
<span class="against"> | ||
<%= link_to "down", vote_comment_path(comment, value: 'no'), | ||
method: "post", remote: true %> | ||
<%= comment.get_dislikes.size %> | ||
</span> |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
$("#<%= dom_id(@comment) %>_votes").html('<%= j render("comments/votes", comment: @comment) %>'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<span id="in_favor"> | ||
<%= link_to vote_debate_path(debate, value: 'yes', partial: 'featured_debate_votes'), | ||
class: "like", title: t('votes.agree'), method: "post", remote: true do %> | ||
<i class="icon-like"></i> | ||
<span><%= percentage('likes', debate) %></span> | ||
<% end %> | ||
</span> | ||
|
||
<span class="divider"></span> | ||
|
||
<span id="against"> | ||
<%= link_to vote_debate_path(debate, value: 'no', partial: 'featured_debate_votes'), | ||
class: "unlike", title: t('votes.disagree'), method: "post", remote: true do %> | ||
<i class="icon-unlike"></i> | ||
<span><%= percentage('dislikes', debate) %></span> | ||
<% end %> | ||
</span> | ||
|
||
<span class="total-votes right"> | ||
<%= pluralize(debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %> | ||
</span> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="text-center votes"> | ||
<span id="in_favor"> | ||
<%= link_to vote_debate_path(debate, value: 'yes', partial: 'votes_min'), | ||
class: "like inline-block", title: t('votes.agree'), method: "post", remote: true do %> | ||
<i class="icon-like"></i> | ||
<span><%= percentage('likes', debate) %></span> | ||
<% end %> | ||
</span> | ||
<span class="divider"></span> | ||
|
||
<span id="against"> | ||
<%= link_to vote_debate_path(debate, value: 'no', partial: 'votes_min'), | ||
class: "unlike inline-block", title: t('votes.disagree'), method: "post", remote: true do %> | ||
<i class="icon-unlike"></i> | ||
<span><%= percentage('dislikes', debate) %></span> | ||
<% end %> | ||
</span> | ||
<br> | ||
<span class="total-votes"> | ||
<%= pluralize(debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %> | ||
</span> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$("#<%= dom_id(@debate) %>_votes").html('<%= j render("debates/#{params[:partial]}", debate: @debate) %>'); |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.