From e5dc1c48ea48177e21cff6670a2dbf0c4c4cf262 Mon Sep 17 00:00:00 2001 From: Aamir Khan Date: Fri, 10 Aug 2012 06:21:15 +0530 Subject: Feature : Add tag to email threads --- hyperkitty/templates/thread.html | 19 ++++++++++++++++++- hyperkitty/templates/threads/add_tag_form.html | 2 +- hyperkitty/templates/threads/right_col.html | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'hyperkitty/templates') diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html index a1bc38c..20248f1 100644 --- a/hyperkitty/templates/thread.html +++ b/hyperkitty/templates/thread.html @@ -93,7 +93,24 @@ }); + $("#add_tag_form").submit( function () { + + {% if user.is_authenticated %} + $.ajax({ + type: "POST", + data : $(this).serialize(), + url: "{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}", + success: function(data){ + console.log('Tag is added successfully'); + } + }); + return false; + {% else %} + alert('You need to login in order to add tag'); + {% endif %} + }); + + }); - {% endblock %} diff --git a/hyperkitty/templates/threads/add_tag_form.html b/hyperkitty/templates/threads/add_tag_form.html index 65f6577..9df2196 100644 --- a/hyperkitty/templates/threads/add_tag_form.html +++ b/hyperkitty/templates/threads/add_tag_form.html @@ -3,7 +3,7 @@ {% block header %} {% endblock %} {% block content %} -
+ {% csrf_token %} {{ addtag_form }}