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 content %}
|
||||
<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">
|
||||
<h1>{% trans 'Notifications' %}</h1>
|
||||
|
||||
{{ notification.action.timestamp | naturaltime_compact }}
|
||||
|
||||
<a href="{% url 'extensions:by-author' user_id=notification.action.actor.pk %}">
|
||||
{{ notification.action.actor }}
|
||||
</a>
|
||||
|
||||
{{ notification.action.verb }}
|
||||
|
||||
<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>
|
||||
{% if notification_list %}
|
||||
<div class="notifications">
|
||||
{% if user|unread_notification_count %}
|
||||
<form action="{% url 'notifications:notifications-mark-read-all' %}" method="post">
|
||||
<button class="btn mb-3" type="submit"><i class="i-eye"></i> {% trans 'Mark all as read' %}</button>
|
||||
</form>
|
||||
{% 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>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>
|
||||
{% trans 'You have no notifications' %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>
|
||||
{% trans 'You have no notifications' %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
|
Loading…
Reference in New Issue
Block a user