Commit 4b4dfd49 authored by HERBERT Ryan's avatar HERBERT Ryan

added creation date to notifications

parent a00e77fe
# coding: utf8
from datetime import date
from datetime import datetime
import gluon.contrib.simplejson
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
......@@ -88,7 +90,8 @@ def add_form():
message_type=request.vars["message_type"],
priority=request.vars["priority"],
expiration=request.vars["expiration"],
creator=auth.user_id)
creator=auth.user_id,
creation_datetime=datetime.now())
res = {"redirect": "notification/index",
"args" : { "id" : id },
......
......@@ -181,7 +181,8 @@ db.define_table('notification',
Field('message_content', 'text'),
Field('message_type', 'string'),
Field('priority', 'string'),
Field('expiration', 'date'))
Field('expiration', 'date'),
Field('creation_datetime', 'datetime'))
db.define_table('user_preference',
Field('user_id', 'reference auth_user'),
......
......@@ -19,7 +19,8 @@
<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>
<td class="column_100"> Expiration Date </td>
<td class="column_100"> Creation Date </td>
{{if auth.is_admin():}}
<td class="column5"> </td>
<td class="column5"> </td>
......@@ -48,6 +49,9 @@
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.expiration}}
</td>
<td class="pointer" onclick="db.call('notification/info', {'id' : '{{=row.id}}'})">
{{=row.creation_datetime}}
</td>
{{if auth.is_admin():}}
<td class="pointer" onclick="db.call('notification/edit', {'id' : '{{=row.id}}'})">
e
......
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