summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/thread.html
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
committerAurélien Bompard <aurelien@bompard.org>2012-12-07 12:05:04 +0100
commit1efaf31a907aa42fc0b01029d332f539b2067a75 (patch)
treeb2e9cc01610f75a3dd01fdbaab02879a24821a39 /hyperkitty/templates/thread.html
parente255c7223ffc9f00f3c85bb573381cf20fcd40a6 (diff)
downloadhyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.gz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.tar.xz
hyperkitty-1efaf31a907aa42fc0b01029d332f539b2067a75.zip
Factorize the add_tag and like JS functions
Diffstat (limited to 'hyperkitty/templates/thread.html')
-rw-r--r--hyperkitty/templates/thread.html76
1 files changed, 0 insertions, 76 deletions
diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html
index 9e1333f..e2a0524 100644
--- a/hyperkitty/templates/thread.html
+++ b/hyperkitty/templates/thread.html
@@ -51,80 +51,4 @@
});
</script>
-<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 : '{% url message_vote mlist_fqdn=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 : '{% url message_vote mlist_fqdn=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 %}
-
- });
-
- $("#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=threadid %}",
- success: function(data){
- console.log('Tag is added successfully');
- location.reload();
- }
- });
- return false;
- {% else %}
- alert('You need to login in order to add tag');
- {% endif %}
- });
-
- $("ul.email_info li.attachments ul.attachments-list").hide();
- $("ul.email_info li.attachments > a").click(function() {
- $(this).next("ul").fadeToggle('fast');
- });
-
- });
-</script>
{% endblock %}