Commit 8a7c84fe authored by HERBERT Ryan's avatar HERBERT Ryan

controllers/notification.py views/notification/info.html added list of notifications to info page

parent 152bc2db
......@@ -33,7 +33,10 @@ def info():
preference='mail',
val=request.vars['id'])
return dict(query=query)
notifications = db(db.notification).select(orderby=~db.notification.id)
return dict(query=query,
notifications=notifications)
# serve for to add a notification
def add():
......
......@@ -3,6 +3,60 @@
<h3>{{=query.title}}</h3>
<div class="db_block">
<div class="db_block info_block">
{{=XML(markdown(query.message_content))}}
</div>
\ No newline at end of file
</div>
<div id="db_table_container" class="info_table">
<table class="db_table" id="table">
<thead>
<tr>
<td class="column_100"> Creator </td>
<td class="column_100"> Type </td>
<td class="column_100"> Priority </td>
<td class="column_100"> Title </td>
<td class="column_100"> Message </td>
<td class="column_100"> Expiration Date </td>
{{if auth.is_admin():}}
<td class="column5"> </td>
<td class="column5"> </td>
{{pass}}
</tr>
</thead>
<tbody>
{{for row in notifications:}}
<tr>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.creator}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.message_type}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.priority}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.title}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.message_content}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.expiration}}
</td>
{{if auth.is_admin():}}
<td class="pointer" onclick="db.call('notification/edit', {'id' : '{{=row.id}}'})">
e
</td>
<td class="pointer" onclick="db.call('notification/delete', {'id' : '{{=row.id}}'})">
X
</td>
{{pass}}
</tr>
{{pass}}
</tbody>
</table>
<table class="db_table" id="db_fixed_header"></table>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment