dsffds
This commit is contained in:
parent
fcbfdd7d79
commit
9424d8c2a5
2 changed files with 12 additions and 2 deletions
|
@ -11,6 +11,15 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||||
def slash_post():
|
def slash_post():
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
||||||
|
@app.post("/clear")
|
||||||
|
@auth_required
|
||||||
|
def clear(v):
|
||||||
|
for n in v.notifications.filter_by(read=False).all():
|
||||||
|
n.read = True
|
||||||
|
g.db.add(n)
|
||||||
|
g.db.commit()
|
||||||
|
return {"message": "Notifications cleared!"}
|
||||||
|
|
||||||
@app.get("/notifications")
|
@app.get("/notifications")
|
||||||
@auth_required
|
@auth_required
|
||||||
def notifications(v):
|
def notifications(v):
|
||||||
|
|
|
@ -41,9 +41,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="notifs p-3 p-md-0">
|
|
||||||
|
|
||||||
<h1 class="h3 d-md-none">Inbox</h1>
|
<a class="btn btn-primary mt-3" href="javascript:void(0)" onclick="post_toast('/clear')">Clear all notifications</a>
|
||||||
|
|
||||||
|
<div class="notifs p-3 p-md-0">
|
||||||
|
|
||||||
{% with comments=notifications %}
|
{% with comments=notifications %}
|
||||||
{% include "comments.html" %}
|
{% include "comments.html" %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue