summaryrefslogtreecommitdiff
path: root/static/website/templates/notifications.html
blob: aa3adce36d9330b4a1a71263e750b4f955931576 (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
{% 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);
                    }
                });
            });
        });
    </script>
{% endblock %}