add: notifications ui
This commit is contained in:
parent
9dc75d7095
commit
f5b75382e5
14 changed files with 179 additions and 14 deletions
|
@ -146,4 +146,52 @@ show_community=true) -%}
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endmacro %} {% macro notification(notification) -%}
|
||||
<div class="w-full card-nest">
|
||||
<div class="card small notif_title flex items-center">
|
||||
{% if not notification.read %}
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
style="fill: var(--color-link)"
|
||||
>
|
||||
<circle cx="12" cy="12" r="6"></circle>
|
||||
</svg>
|
||||
{% endif %}
|
||||
<b>{{ notification.title|markdown|safe }}</b>
|
||||
</div>
|
||||
|
||||
<div class="card notif_content flex flex-col gap-2">
|
||||
<span>{{ notification.content|markdown|safe }}</span>
|
||||
|
||||
<div class="card secondary w-full flex flex-wrap gap-2">
|
||||
{% if notification.read %}
|
||||
<button
|
||||
class="tertiary"
|
||||
onclick="trigger('me::update_notification_read_statsu', ['{{ notification.id }}', false])"
|
||||
>
|
||||
{{ icon "undo" }}
|
||||
<span>{{ text "notifs:action.mark_as_unread" }}</span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button
|
||||
class="green tertiary"
|
||||
onclick="trigger('me::update_notification_read_statsu', ['{{ notification.id }}', true])"
|
||||
>
|
||||
{{ icon "check" }}
|
||||
<span>{{ text "notifs:action.mark_as_read" }}</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
<button
|
||||
class="red tertiary"
|
||||
onclick="trigger('me::remove_notification', ['{{ notification.id }}'])"
|
||||
>
|
||||
{{ icon "trash" }}
|
||||
<span>{{ text "general:action.delete" }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue