notifications.html
HTML document, ASCII text
1{% extends "default.html" %} 2{% block title %} 3{% trans %}Notifications{% endtrans %} 4{% endblock %} 5{% block breadcrumbs %} 6<li><a href="/notifications">{% trans %}Notifications{% endtrans %}</a></li> 7{% endblock %} 8{% block content %} 9<x-vbox> 10<x-frame style="--width: 896px;" class="flexible-space"> 11<x-vbox> 12{% if notifications %} 13<form method="post" action="/notifications/mark-all-read"> 14<button type="submit">{% trans %}Mark all as read{% endtrans %}</button> 15</form> 16{% for notification in notifications %} 17<article class="card card-horizontal"> 18<section class="card-main flexible-space"> 19{{ notification.notification.timestamp | strftime("%A, %e %B %Y, %H:%M:%S") }} 20{% if notification.notification.data["type"] == "welcome" %} 21<h2>{% trans %}Welcome{% endtrans %}</h2> 22{% elif notification.notification.data["type"] == "commit" %} 23{% set commit = db.session.get(Commit, notification.notification.data["repo"] + "/" + notification.notification.data["commit"]) %} 24<h2><a href="{{ notification.notification.data['repo'] + '/commit/' + notification.notification.data['commit'] }}">{{ commit.message | split("\n\n", 1) | first }}</a></h2> 25<p> 26{% trans %}Commited by{% endtrans %} <a href="/{{ commit.owner.username }}">{{ commit.owner.username }}</a> 27{% trans %}in{% endtrans %} <a href="{{ commit.repo.route }}">{{ commit.repo.owner.username }}/{{ commit.repo.name }}</a> 28</p> 29{% endif %} 30</section> 31<section> 32{% if notification.attention_level %} 33<button hx-post="/notifications/{{ notification.id }}/read" hx-swap="outerHTML"> 34{% trans %}Mark as read{% endtrans %} 35</button> 36{% else %} 37<button hx-post="/notifications/{{ notification.id }}/unread" hx-swap="outerHTML"> 38{% trans %}Mark as unread{% endtrans %} 39</button> 40{% endif %} 41</section> 42</article> 43{% endfor %} 44{% else %} 45<p>{% trans %}When you get notifications, they'll be shown here.{% endtrans %}</p> 46{% endif %} 47</x-vbox> 48</x-frame> 49</x-vbox> 50{% endblock %} 51