summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hyperkitty/templates/thread.html2
-rw-r--r--hyperkitty/templates/threads/add_tag_form.html2
-rw-r--r--hyperkitty/templates/threads/right_col.html2
-rw-r--r--hyperkitty/views/thread.py7
4 files changed, 10 insertions, 3 deletions
diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html
index 20248f1..f3b521e 100644
--- a/hyperkitty/templates/thread.html
+++ b/hyperkitty/templates/thread.html
@@ -99,7 +99,7 @@
$.ajax({
type: "POST",
data : $(this).serialize(),
- url: "{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}",
+ url: "{% url add_tag mlist_fqdn=list_address, email_id=threadid %}",
success: function(data){
console.log('Tag is added successfully');
}
diff --git a/hyperkitty/templates/threads/add_tag_form.html b/hyperkitty/templates/threads/add_tag_form.html
index 9df2196..f719152 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 %}
-<form id="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}" method="post">
+<form id="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=threadid %}" method="post">
{% csrf_token %}
{{ addtag_form }}
<button type="submit">
diff --git a/hyperkitty/templates/threads/right_col.html b/hyperkitty/templates/threads/right_col.html
index f50bc46..71ec1b6 100644
--- a/hyperkitty/templates/threads/right_col.html
+++ b/hyperkitty/templates/threads/right_col.html
@@ -37,7 +37,7 @@
</ul>
</div>
<div id="add_tag">
- <form id="add_tag_form" name="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}" method="post">
+ <form id="add_tag_form" name="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=threadid %}" method="post">
{% csrf_token %}
{{ addtag_form.as_p }}
<button type="submit">
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py
index c352297..4cafa37 100644
--- a/hyperkitty/views/thread.py
+++ b/hyperkitty/views/thread.py
@@ -69,9 +69,16 @@ def thread_index (request, mlist_fqdn, threadid):
archives_length = STORE.get_archives_length(list_name)
from_url = '/thread/%s/%s/' % (mlist_fqdn, threadid)
tag_form = AddTagForm(initial={'from_url' : from_url})
+
+ try:
+ tags = Tag.objects.filter(threadid=threadid)
+ except Tag.DoesNotExist:
+ tags = {}
c = RequestContext(request, {
'list_name' : list_name,
+ 'threadid' : threadid,
+ 'tags' : tags,
'list_address': mlist_fqdn,
'search_form': search_form,
'addtag_form': tag_form,