Commit 4e8b255a authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

controllers/ views/notification/info.html deprecated index in...

controllers/ views/notification/info.html deprecated index in favour of more flexible info page
parent 66b4b0bd
......@@ -10,6 +10,7 @@ if request.env.http_origin:
ACCESS_DENIED = "access denied"
# Deprecated
def index():
if not auth.is_admin() :
res = {"message": ACCESS_DENIED}
......@@ -23,7 +24,10 @@ def index():
def info():
user_id = if auth.user else None
query = db.notification[request.vars['id']]
query = None
if request.vars['id']:
query = db.notification[request.vars['id']]
if auth.user:
rows = db((
......@@ -38,7 +42,8 @@ def info():
cache.ram.clear(regex=NOTIFICATION_CACHE_PREFIX + str(user_id))
notifications = db(db.notification).select(
return dict(query=query,
return dict(message="Notifications",
# serve for to add a notification
{{from gluon.contrib.markdown.markdown2 import markdown}}
{{extend 'db_layout.html'}}
<h3>{{=query.title if query is not None else message}}</h3>
<div class="db_block info_block">
{{if query is not None:}}
<div class="db_block info_block">
<div id="db_table_container" class="info_table">
<div id="db_table_container" {{if query is not None:}}class="info_table"{{pass}}>
<table class="db_table" id="table">
......@@ -60,3 +62,7 @@
<table class="db_table" id="db_fixed_header"></table>
{{if auth.is_admin():}}
<span class="button2" onclick="'notification/add')"> + new notification </span>
Supports Markdown
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