summaryrefslogtreecommitdiff
path: root/static/website/templates/notifications.html
blob: 35c30a3a7a74b857fe9c0e2bbcac8308f8d99cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% extends 'website/templates/base.html' %}
{% load notify %}
{% block content%}
    <h4 class="pull-left">Notifications</h4>
    <a class="btn btn-xs btn-warning pull-right" href="{% url "website:clear_notifications" %}" style="margin-top: 7px;">
        Clear All
    </a>
    <div class="clearfix"></div> 
    {% for notification in notifications %}
        {% get_notification notification.id %}
    {% endfor %}
{% endblock %}

{% block javascript %}
    <script type="text/javascript">
       $(document).ready(function() {
            $(".remove").click(function() {
                $(this).parent(".notification").slideUp();
                var notification_id = $(this).data("nid");
                $.ajax({
                    url: "/ajax-notification-remove/",
                    type: "POST",
                    data: {
                        notification_id: notification_id
                    },
                    success: function(data) {
                        console.log(data);
                    }
                });
            });
            
            $(".rmc").click(function() {
            	 $(this).parent(".notification").slideUp();
               
                var notification_id = $(this).data("nid");
                $.ajax({
                    url: "/ajax-notification-remove/",
                    type: "POST",
                    data: {
                        notification_id: notification_id
                    },
                    success: function(data) {
                        console.log(data);
                       
                    }
                });
            });
        });
    </script>
{% endblock %}