Commit b99d4ef49ab1d40f7686b947a059ba7faa7aa16b
1 parent
dd123e22
Exists in
master
and in
5 other branches
modified templates to create a reasuble option on the backend and ajax #158
Showing
2 changed files
with
32 additions
and
31 deletions
Show diff stats
core/templates/base.html
... | ... | @@ -60,37 +60,7 @@ |
60 | 60 | <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 | 61 | <ul id="notification-dropdown" class="dropdown-menu"> |
62 | 62 | <li class="dropdown-header">Notifications</li> |
63 | - {% for notification in notifications %} | |
64 | - {% if notification.actor %} <!-- if the notification has a user--> | |
65 | - <li> | |
66 | - <a href="{% url 'core:notification_read' notification.id %}"><div class="list-group-item"> | |
67 | - <div class="row-picture"> | |
68 | - <img class="circle" src="http://lorempixel.com/56/56/people/1" alt="icon"> | |
69 | - <div class="least-content pull-right">{{ notification.datetime }}</div> | |
70 | - </div> | |
71 | - <div class="row-content"> | |
72 | - <p class="list-group-item-text">{{ notification.message }}</p> | |
73 | - </div> | |
74 | - </div> | |
75 | - </a> | |
76 | - </li> | |
77 | - {% else %} | |
78 | - <li> | |
79 | - <a href="{% url 'core:notification_read' notification.id %}"> | |
80 | - <div class="list-group-item"> | |
81 | - <div class="row-action-primary"> | |
82 | - <i class="material-icons">folder</i> | |
83 | - </div> | |
84 | - <div class="row-content"> | |
85 | - | |
86 | - <div class="least-content pull-right">{{ notification.datetime }}</div> | |
87 | - | |
88 | - <p class="list-group-item-text">{{ notification.message }}</p> | |
89 | - </div> | |
90 | - </a> | |
91 | - </li> | |
92 | - {% endif %} | |
93 | - {% endfor %} | |
63 | + {% include "notifications.html" %} | |
94 | 64 | |
95 | 65 | <li> |
96 | 66 | <a> | ... | ... |
... | ... | @@ -0,0 +1,31 @@ |
1 | +{% for notification in notifications %} | |
2 | + {% if notification.actor %} <!-- if the notification has a user--> | |
3 | + <li> | |
4 | + <a href="{% url 'core:notification_read' notification.id %}"><div class="list-group-item"> | |
5 | + <div class="row-picture"> | |
6 | + <img class="circle" src="http://lorempixel.com/56/56/people/1" alt="icon"> | |
7 | + <div class="least-content pull-right">{{ notification.datetime }}</div> | |
8 | + </div> | |
9 | + <div class="row-content"> | |
10 | + <p class="list-group-item-text">{{ notification.message }}</p> | |
11 | + </div> | |
12 | + </div> | |
13 | + </a> | |
14 | + </li> | |
15 | + {% else %} | |
16 | + <li> | |
17 | + <a href="{% url 'core:notification_read' notification.id %}"> | |
18 | + <div class="list-group-item"> | |
19 | + <div class="row-action-primary"> | |
20 | + <i class="material-icons">folder</i> | |
21 | + </div> | |
22 | + <div class="row-content"> | |
23 | + | |
24 | + <div class="least-content pull-right">{{ notification.datetime }}</div> | |
25 | + | |
26 | + <p class="list-group-item-text">{{ notification.message }}</p> | |
27 | + </div> | |
28 | + </a> | |
29 | + </li> | |
30 | + {% endif %} | |
31 | + {% endfor %} | |
0 | 32 | \ No newline at end of file | ... | ... |