Add notifications

Fixes #28
This commit is contained in:
rubenwardy
2018-05-13 17:55:28 +01:00
parent f3c433de06
commit 4fdafefcd5
8 changed files with 99 additions and 5 deletions

View File

@@ -40,6 +40,7 @@
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('notifications_page') }}">({{ current_user.notifications | length }})</a></li>
<li><a href="{{ url_for('user_profile_page', username=current_user.username) }}">{{ current_user.display_name }}</a></li>
<li><a href="{{ url_for('user.logout') }}">Sign out</a></li>
{% else %}

View File

@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}
Notifications
{% endblock %}
{% block content %}
<ul>
{% for n in current_user.notifications %}
<li><a href="{{ n.url }}">
{{ n.title}} [{{ n.causer.display_name }}]
</a></li>
{% else %}
<li><i>No notifications</i></ul>
{% endfor %}
</ul>
{% endblock %}