Commit 510f3e215dab4996b8e83cac60c048d0ceb612dd
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
3 changed files
with
9 additions
and
3 deletions
Show diff stats
core/static/js/base/amadeus.js
@@ -134,6 +134,10 @@ This functions get the next 5 notifications from the user given a "step"(an amou | @@ -134,6 +134,10 @@ This functions get the next 5 notifications from the user given a "step"(an amou | ||
134 | function getNotifications(step){ | 134 | function getNotifications(step){ |
135 | $.get('/getNotifications', | 135 | $.get('/getNotifications', |
136 | {'steps':step, 'amount': 5}, function(data){ | 136 | {'steps':step, 'amount': 5}, function(data){ |
137 | - console.log(data); | 137 | + $("#notification-dropdown").append(data); |
138 | + $('#notification-see-more').remove(); | ||
139 | + var seemore = '<li><a onclick="getNotifications('+(step+5)+')"> <div id="notification-see-more" class="list-group-item"> <div class="row-content"><p class="list-group-item-text">See More</p> </div> </a></li>'; | ||
140 | + $("#notification-dropdown").append(seemore); | ||
141 | + $("#notification-count").text(step+5); | ||
138 | }); | 142 | }); |
139 | } | 143 | } |
core/templates/base.html
@@ -58,14 +58,14 @@ | @@ -58,14 +58,14 @@ | ||
58 | <div class="navbar-collapse collapse navbar-responsive-collapse"> | 58 | <div class="navbar-collapse collapse navbar-responsive-collapse"> |
59 | <ul class="nav navbar-nav navbar-right notifications"> | 59 | <ul class="nav navbar-nav navbar-right notifications"> |
60 | <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications"> | 60 | <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications"> |
61 | - <a class="dropdown-toggle" data-toggle="dropdown"> <span class="badge notification-count">{{notifications.count}}</span><i class="fa fa-bell" aria-hidden="true"></i></a> | 61 | + <a class="dropdown-toggle" data-toggle="dropdown"> <span id="notification-count" class="badge notification-count">{{notifications.count}}</span><i class="fa fa-bell" aria-hidden="true"></i></a> |
62 | <ul id="notification-dropdown" class="dropdown-menu"> | 62 | <ul id="notification-dropdown" class="dropdown-menu"> |
63 | <li class="dropdown-header">Notifications</li> | 63 | <li class="dropdown-header">Notifications</li> |
64 | {% include "notifications.html" %} | 64 | {% include "notifications.html" %} |
65 | 65 | ||
66 | <li> | 66 | <li> |
67 | <a onclick="getNotifications(5)"> | 67 | <a onclick="getNotifications(5)"> |
68 | - <div class="list-group-item"> | 68 | + <div id="notification-see-more" class="list-group-item"> |
69 | <div class="row-content"> | 69 | <div class="row-content"> |
70 | <p class="list-group-item-text">See More</p> | 70 | <p class="list-group-item-text">See More</p> |
71 | </div> | 71 | </div> |
core/templates/notifications.html
1 | + | ||
2 | +<!-- This templates is responsible to display the list of notifications at the top of the page. --> | ||
1 | {% for notification in notifications %} | 3 | {% for notification in notifications %} |
2 | {% if notification.actor %} <!-- if the notification has a user--> | 4 | {% if notification.actor %} <!-- if the notification has a user--> |
3 | <li> | 5 | <li> |