summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/messages
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-13 18:13:46 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-13 18:30:04 +0100
commit02d09d5304823de3439bc0eb701cddbdb66c0d42 (patch)
tree4ee675714d4d2babbef65e4621f278f7a725f3dc /hyperkitty/templates/messages
parent0e96a34e0d54b06c79750afafc503a3444bcddfd (diff)
downloadhyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.tar.gz
hyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.tar.xz
hyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.zip
Allow cancelling a vote
Diffstat (limited to 'hyperkitty/templates/messages')
-rw-r--r--hyperkitty/templates/messages/like_form.html18
1 files changed, 13 insertions, 5 deletions
diff --git a/hyperkitty/templates/messages/like_form.html b/hyperkitty/templates/messages/like_form.html
index 7896fed..867a8a4 100644
--- a/hyperkitty/templates/messages/like_form.html
+++ b/hyperkitty/templates/messages/like_form.html
@@ -1,11 +1,19 @@
<form method="post" class="likeform"
action="{% url message_vote mlist_fqdn=mlist.name, message_id_hash=message_id_hash %}">
{% csrf_token %}
- <span class="likestatus {{ object.likestatus }}">
- +<span class="likecount">{{ object.likes }}</span>/-<span class="dislikecount">{{ object.dislikes }}</span>
- </span>
- <a class="youlike{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}" href="#like">Like</a>
- <a class="youdislike{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}" href="#dislike">Dislike</a>
+ <span class="likestatus {{ object.likestatus }}">+{{ object.likes }}/-{{ object.dislikes }}</span>
+ {% if object.myvote == 1 %}
+ <span class="youlike">You like it
+ (<a href="#cancelvote" onclick="vote(this, 0)">cancel</a>)</span>
+ {% elif object.myvote == -1 %}
+ <span class="youdislike">You dislike it
+ (<a href="#cancelvote" onclick="vote(this, 0)">cancel</a>)</span>
+ {% else %}
+ <a class="youlike{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}"
+ href="#like" onclick="vote(this, 1)">Like</a>
+ <a class="youdislike{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}"
+ href="#dislike" onclick="vote(this, -1)">Dislike</a>
+ {% endif %}
</form>
{# vim: set noet: #}