summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/messages/like_form.html
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-04-30 10:42:08 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-04-30 10:42:08 +0200
commit120a4affe1881dbb7383c65175851dba3bb1e87b (patch)
tree6481a33bdca67a7694192890be0d95af603a9f33 /hyperkitty/templates/messages/like_form.html
parent3ac9cab8bd7b44c0cdf4f0a39ea378542061184e (diff)
downloadhyperkitty-120a4affe1881dbb7383c65175851dba3bb1e87b.tar.gz
hyperkitty-120a4affe1881dbb7383c65175851dba3bb1e87b.tar.xz
hyperkitty-120a4affe1881dbb7383c65175851dba3bb1e87b.zip
Refactor voting JS for better separation of concerns
Diffstat (limited to 'hyperkitty/templates/messages/like_form.html')
-rw-r--r--hyperkitty/templates/messages/like_form.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/hyperkitty/templates/messages/like_form.html b/hyperkitty/templates/messages/like_form.html
index 14b8f88..bf7a5ba 100644
--- a/hyperkitty/templates/messages/like_form.html
+++ b/hyperkitty/templates/messages/like_form.html
@@ -6,15 +6,15 @@
<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>
+ (<a href="#cancelvote" class="vote" data-vote="0">cancel</a>)</span>
{% elif object.myvote == -1 %}
<span class="youdislike">You dislike it
- (<a href="#cancelvote" onclick="vote(this, 0)">cancel</a>)</span>
+ (<a href="#cancelvote" class="vote" data-vote="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>
+ <a class="youlike vote{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}"
+ href="#like" data-vote="1">Like</a>
+ <a class="youdislike vote{% if not user.is_authenticated %} disabled" title="You must be logged-in to vote.{% endif %}"
+ href="#dislike" data-vote="-1">Dislike</a>
{% endif %}
</form>