Implement Web Assets' theme system and selection, and add 'light' theme #118

Merged
Márton Lente merged 97 commits from martonlente/extensions-website:ui/theme-light into main 2024-05-08 14:20:07 +02:00
Showing only changes of commit 6a80284386 - Show all commits

View File

@ -4,42 +4,56 @@
{% 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 %} {% if notification_list %}
{% for notification in notification_list %} <div class="notifications">
<div class="row mb-2 {% if notification.read_at%}text-muted{% endif %}"> {% if user|unread_notification_count %}
<div class="col"> <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>
{{ 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> </form>
{% endif %} {% endif %}
<div class="box">
</div> <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> </div>
</td>
</tr>
{% endfor %} {% endfor %}
</tbody>
</table>
</div>
</div>
{% else %} {% else %}
<p> <p>
{% trans 'You have no notifications' %} {% trans 'You have no notifications' %}