Implement Web Assets' theme system and selection, and add 'light' theme #118
@ -4,45 +4,59 @@
|
|||||||
{% block page_title %}{% blocktranslate %}Notifications{% endblocktranslate %}{% endblock page_title %}
|
{% block page_title %}{% blocktranslate %}Notifications{% endblocktranslate %}{% endblock page_title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>{% trans 'Notifications' %}</h1>
|
||||||
{% trans 'Notifications' %}
|
|
||||||
{% if user|unread_notification_count %}
|
|
||||||
<form class="d-inline" action="{% url 'notifications:notifications-mark-read-all' %}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<button class="btn btn-sm" type="submit">{% trans 'Mark all as read' %}</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</h1>
|
|
||||||
{% if notification_list %}
|
|
||||||
{% for notification in notification_list %}
|
|
||||||
<div class="row mb-2 {% if notification.read_at%}text-muted{% endif %}">
|
|
||||||
<div class="col">
|
|
||||||
|
|
||||||
{{ notification.action.timestamp | naturaltime_compact }}
|
|
||||||
|
|
||||||
<a href="{% url 'extensions:by-author' user_id=notification.action.actor.pk %}">
|
{% if notification_list %}
|
||||||
{{ notification.action.actor }}
|
<div class="notifications">
|
||||||
</a>
|
{% if user|unread_notification_count %}
|
||||||
|
<form action="{% url 'notifications:notifications-mark-read-all' %}" method="post">
|
||||||
{{ notification.action.verb }}
|
<button class="btn mb-3" type="submit"><i class="i-eye"></i> {% trans 'Mark all as read' %}</button>
|
||||||
|
</form>
|
||||||
<a href="{{ notification.action.target.get_absolute_url }}">{{ notification.action.target }}</a>
|
|
||||||
|
|
||||||
<a href="{{ notification.get_absolute_url }}"><button class="btn btn-sm">{% trans 'View' %}</button></a>
|
|
||||||
|
|
||||||
{% if not notification.read_at %}
|
|
||||||
<form class="d-inline" action="{% url 'notifications:notifications-mark-read' pk=notification.pk %}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<button class="btn btn-sm" type="submit">{% trans 'Mark as read' %}</button>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="box">
|
||||||
|
<table class="notifications-list">
|
||||||
|
<tbody>
|
||||||
|
{% for notification in notification_list %}
|
||||||
|
<tr class="notifications-item {% if notification.read_at%}is-read{% endif %}">
|
||||||
|
<td class="notifications-item-time">
|
||||||
|
{{ notification.action.timestamp | naturaltime_compact }}
|
||||||
|
</td>
|
||||||
|
<td class="notifications-item-content">
|
||||||
|
<a href="{{ notification.get_absolute_url }}"><span class="me-2">{{ notification.action.actor }} {{ notification.action.verb }} {{ notification.action.target }}</span><span class="notifications-item-dot"></span></a>
|
||||||
|
</td>
|
||||||
|
<td class="notifications-item-nav">
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-link dropdown-toggle js-dropdown-toggle active" data-toggle-menu-id="js-notifications-item-nav-{{ notification.id }}">
|
||||||
|
<i class="i-more-vertical"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-notifications-item-nav-{{ notification.id }}">
|
||||||
|
<li class="nav-item-mark-as-read">
|
||||||
|
<form action="{% url 'notifications:notifications-mark-read' pk=notification.pk %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="dropdown-item" title="Mark as read" type="submit"><i class="i-eye"></i> Mark as read </button>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{# TODO: add feature 'Mark as unread' (optional) #}
|
||||||
|
{% comment %}
|
||||||
|
<li class="nav-item-mark-as-unread">
|
||||||
|
<form>
|
||||||
|
<button class="dropdown-item" title="Mark as read" type="submit"><i class="i-eye-off"></i> Mark as unread </button>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endcomment %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% else %}
|
||||||
{% else %}
|
<p>
|
||||||
<p>
|
{% trans 'You have no notifications' %}
|
||||||
{% trans 'You have no notifications' %}
|
</p>
|
||||||
</p>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
Loading…
Reference in New Issue
Block a user