summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/message.html
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
committerAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
commit1efaf31a907aa42fc0b01029d332f539b2067a75 (patch)
treeb2e9cc01610f75a3dd01fdbaab02879a24821a39 /hyperkitty/templates/message.html
parente255c7223ffc9f00f3c85bb573381cf20fcd40a6 (diff)
downloadhyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.gz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.xz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.zip
Factorize the add_tag and like JS functions
Diffstat (limited to 'hyperkitty/templates/message.html')
-rw-r--r--hyperkitty/templates/message.html57
1 files changed, 0 insertions, 57 deletions
diff --git a/hyperkitty/templates/message.html b/hyperkitty/templates/message.html
index 5ae2fb1..25983ec 100644
--- a/hyperkitty/templates/message.html
+++ b/hyperkitty/templates/message.html
@@ -17,60 +17,3 @@
</section>
{% endblock %}
-
-{% block additionaljs %}
-<script type="text/javascript">
- $(document).ready(function() {
- $(".voteup").click(function() {
- // @TODO: Extract the message id from the HTML DOM element instead of hard coding it in Javascript.
- message_id = this.parentElement.getAttribute('messageid');
- {% if user.is_authenticated %}
- $.ajax({
- type : "POST",
- url : "{% url message_vote mlist_fqdn=list_address %}",
- data : {
- vote : 1,
- messageid : message_id,
- list : "{{list_address}}",
- csrfmiddlewaretoken : '{{ csrf_token }}'
- },
- success : function(response) {
- console.log(response);
- location.reload();
- }
- });
- return false;
- {% else %}
- alert('You need to login in order to vote');
- {% endif %}
- });
-
- $(".votedown").click(function() {
- message_id = this.parentElement.getAttribute('messageid');
- {% if user.is_authenticated %}
- $.ajax({
- type : "POST",
- url : '{% url message_vote mlist_fqdn=list_address %}',
- data : {
- vote : -1,
- messageid : message_id,
- list : "{{list_address}}",
- csrfmiddlewaretoken : '{{ csrf_token }}'
- },
- success : function(response) {
- console.log(response);
- // @TODO : Remove this reload and update count using AJAX
- location.reload();
- }
- });
- return false;
- {% else %}
- alert('You need to login in order to vote');
- {% endif %}
-
- });
-
- });
-</script>
-
-{% endblock %}