From d830b1ab3d95f8598de98b2a97cfed7ed19c4175 Mon Sep 17 00:00:00 2001 From: Aamir Khan Date: Mon, 25 Jun 2012 16:17:10 -0400 Subject: Code Formatting --- templates/thread.html | 131 ++++++++++++++++++++++++++------------------------ 1 file changed, 69 insertions(+), 62 deletions(-) (limited to 'templates/thread.html') diff --git a/templates/thread.html b/templates/thread.html index 8ffd5ea..508b03a 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -3,84 +3,91 @@ {% load gravatar %} {% block additional_stylesheets %} - + {% endblock %} {% block content %} -
- - {% include 'threads/right_col.html' %} +
- -
+ {% include 'threads/right_col.html' %} - - {% include 'messages/first_email.html' %} - + +
- {% for email in threads %} - -
+ + {% include 'messages/first_email.html' %} + + + {% for email in threads %} + +
{% include 'messages/message.html' %}
- + - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} -
+
-
+
+ {% endblock %} - - {% block additionaljs %} - - - - - + + + + $(".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'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : 1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + $(".votedown").click(function() { + message_id = this.parentElement.getAttribute('messageid'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : -1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + }); + {% endblock %} -- cgit