summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates
diff options
context:
space:
mode:
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r--hyperkitty/templates/thread.html19
-rw-r--r--hyperkitty/templates/threads/add_tag_form.html2
-rw-r--r--hyperkitty/templates/threads/right_col.html3
3 files changed, 21 insertions, 3 deletions
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 %}
+ });
+
+
});
</script>
-
{% 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 %}
-<form action="/addtag/{{list_address}}/{{email_id}}/" method="post">
+<form id="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}" 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 9a1e448..f50bc46 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 action="/addtag/{{list_address}}/{{first_mail.message_id}}/" method="post">
+ <form id="add_tag_form" name="addtag" action="{% url add_tag mlist_fqdn=list_address, email_id=first_mail.message_id %}" method="post">
{% csrf_token %}
{{ addtag_form.as_p }}
<button type="submit">
@@ -58,3 +58,4 @@
</div>
</section>
+