diff options
author | ashwinishinde | 2015-05-08 16:26:10 +0530 |
---|---|---|
committer | ashwinishinde | 2015-05-08 16:26:10 +0530 |
commit | b0351d0df6ae7fef2a461706542410a7e7ecea35 (patch) | |
tree | 39d94076b3156eca40fbf49560b90130005ba08f /static | |
parent | fd3d3d3c33d078cf497ca69937dc1a5402b4326c (diff) | |
download | FOSSEE-Forum-b0351d0df6ae7fef2a461706542410a7e7ecea35.tar.gz FOSSEE-Forum-b0351d0df6ae7fef2a461706542410a7e7ecea35.tar.bz2 FOSSEE-Forum-b0351d0df6ae7fef2a461706542410a7e7ecea35.zip |
Subject:Update notification count
Description:
1) update notification count after visit.
2) remove notification item from list after visted.
Diffstat (limited to 'static')
-rw-r--r-- | static/website/templates/notifications.html | 17 | ||||
-rw-r--r-- | static/website/templates/notify.html | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/static/website/templates/notifications.html b/static/website/templates/notifications.html index aa3adce..35c30a3 100644 --- a/static/website/templates/notifications.html +++ b/static/website/templates/notifications.html @@ -28,6 +28,23 @@ } }); }); + + $(".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 %} diff --git a/static/website/templates/notify.html b/static/website/templates/notify.html index 2ea55c5..9e048be 100644 --- a/static/website/templates/notify.html +++ b/static/website/templates/notify.html @@ -2,12 +2,12 @@ {% if notification.cid != 0 and notification.aid != 0 %} <small> - <a href="{% url 'website:get_question' answer.question.id %}#answer{{ answer.id }}">New <strong>Comment</strong> on "{{ question.title }}"</a> + <a class="rmc" data-nid="{{ notification.id }}" href="{% url 'website:get_question' answer.question.id %}#comment{{ answer.id }}">New <strong>Comment</strong> on <strong>"{{ question.title }}"</strong></a> </small> {% elif notification.cid == 0 %} - <a href="{% url 'website:get_question' answer.question.id %}#answer{{ answer.id }}"+ >New <strong>Answer</strong> on <strong>"{{ question.title }}"</strong></a> + <a class="rmc" data-nid="{{ notification.id }}" href="{% url 'website:get_question' answer.question.id %}#answer{{ answer.id }}"+ >New <strong>Answer</strong> on <strong>"{{ question.title }}"</strong></a> {% endif %} |