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,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 notification_list %}
<div class="notifications">
{% if user|unread_notification_count %} {% if user|unread_notification_count %}
<form class="d-inline" action="{% url 'notifications:notifications-mark-read-all' %}" method="post"> <form action="{% url 'notifications:notifications-mark-read-all' %}" method="post">
{% csrf_token %} <button class="btn mb-3" type="submit"><i class="i-eye"></i> {% trans 'Mark all as read' %}</button>
<button class="btn btn-sm" type="submit">{% trans 'Mark all as read' %}</button>
</form> </form>
{% endif %} {% endif %}
</h1> <div class="box">
{% if notification_list %} <table class="notifications-list">
<tbody>
{% for notification in notification_list %} {% for notification in notification_list %}
<div class="row mb-2 {% if notification.read_at%}text-muted{% endif %}"> <tr class="notifications-item {% if notification.read_at%}is-read{% endif %}">
<div class="col"> <td class="notifications-item-time">
{{ notification.action.timestamp | naturaltime_compact }} {{ notification.action.timestamp | naturaltime_compact }}
</td>
<a href="{% url 'extensions:by-author' user_id=notification.action.actor.pk %}"> <td class="notifications-item-content">
{{ notification.action.actor }} <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>
</a> </td>
<td class="notifications-item-nav">
{{ notification.action.verb }} <div class="dropdown">
<button class="btn btn-link dropdown-toggle js-dropdown-toggle active" data-toggle-menu-id="js-notifications-item-nav-{{ notification.id }}">
<a href="{{ notification.action.target.get_absolute_url }}">{{ notification.action.target }}</a> <i class="i-more-vertical"></i>
</button>
<a href="{{ notification.get_absolute_url }}"><button class="btn btn-sm">{% trans 'View' %}</button></a> <ul class="dropdown-menu dropdown-menu-right js-dropdown-menu" id="js-notifications-item-nav-{{ notification.id }}">
<li class="nav-item-mark-as-read">
{% if not notification.read_at %} <form action="{% url 'notifications:notifications-mark-read' pk=notification.pk %}" method="post">
<form class="d-inline" action="{% url 'notifications:notifications-mark-read' pk=notification.pk %}" method="post">
{% csrf_token %} {% csrf_token %}
<button class="btn btn-sm" type="submit">{% trans 'Mark as read' %}</button> <button class="dropdown-item" title="Mark as read" type="submit"><i class="i-eye"></i> Mark as read </button>
</form> </form>
{% endif %} </li>
{# TODO: add feature 'Mark as unread' (optional) #}
</div> {% 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 %}
{% else %} </tbody>
<p> </table>
</div>
</div>
{% else %}
<p>
{% trans 'You have no notifications' %} {% trans 'You have no notifications' %}
</p> </p>
{% endif %} {% endif %}
{% endblock content %} {% endblock content %}