summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/message.html
diff options
context:
space:
mode:
authorAamir Khan <syst3m.w0rm@gmail.com>2012-07-24 17:00:25 -0400
committerAamir Khan <syst3m.w0rm@gmail.com>2012-07-24 17:00:25 -0400
commit9f18a590819a01017c15169d82763680a72848fb (patch)
tree9c781cd677eeae9b1e50e986647e1929e99bdac7 /hyperkitty/templates/message.html
parentae77d9901e2a466622818f95d784fb85b5296727 (diff)
downloadhyperkitty-9f18a590819a01017c15169d82763680a72848fb.tar.gz
hyperkitty-9f18a590819a01017c15169d82763680a72848fb.tar.xz
hyperkitty-9f18a590819a01017c15169d82763680a72848fb.zip
Packaging hyperkitty
Diffstat (limited to 'hyperkitty/templates/message.html')
-rw-r--r--hyperkitty/templates/message.html71
1 files changed, 71 insertions, 0 deletions
diff --git a/hyperkitty/templates/message.html b/hyperkitty/templates/message.html
new file mode 100644
index 0000000..592e85d
--- /dev/null
+++ b/hyperkitty/templates/message.html
@@ -0,0 +1,71 @@
+{% extends "base.html" %}
+{% load gravatar %}
+
+{% block additional_stylesheets %}
+<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" />
+{% endblock %}
+
+{% block content %}
+
+<section id="thread_content">
+ {% include 'messages/first_email.html' with first_mail=message %}
+</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 : '/vote/{{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 : '/vote/{{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 %}