CurseTechnique/templates/inbox.html

45 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block title %}Inbox{% endblock %}
{% block content %}
<section class="rounded-3xl border border-slate-200/80 bg-white/80 p-6 shadow-sm backdrop-blur">
<h1 class="text-3xl font-bold tracking-tight">Inbox</h1>
<p class="mt-3 text-sm text-slate-600">Daily subscription notifications.</p>
<p class="mt-1 text-xs text-slate-500">Unread: {{ page.unread_count }}</p>
</section>
<section class="mt-4 rounded-3xl border border-slate-200/80 bg-white/90 p-6 shadow-sm">
{% if page.items.is_empty() %}
<p class="text-sm text-slate-600">No notifications yet. Subscribe to someone first.</p>
{% else %}
<div class="grid gap-3">
{% for item in page.items %}
<article class="rounded-2xl border p-4 {% if item.is_viewed %}border-slate-200 bg-slate-50{% else %}border-teal-200 bg-teal-50{% endif %}">
<div class="flex flex-wrap items-center justify-between gap-2">
<p class="text-sm font-semibold {% if item.is_viewed %}text-slate-700{% else %}text-slate-900{% endif %}">
{% if item.is_loud %}Loud alert:{% else %}Update:{% endif %} @{{ item.target_username }}
</p>
<p class="text-xs text-slate-500">{{ item.created_at }}</p>
</div>
<p class="mt-2 text-sm {% if item.is_loud %}font-semibold text-rose-700{% else %}text-slate-700{% endif %}">
{{ item.message }}
</p>
<p class="mt-1 text-xs text-slate-500">For day: {{ item.previous_day }}</p>
<div class="mt-3 flex flex-wrap items-center gap-2">
<a href="/u/{{ item.target_username }}" class="rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-xs font-semibold text-slate-800 hover:bg-slate-100">Open profile</a>
{% if !item.is_viewed %}
<form method="post" action="/inbox/{{ item.id }}/view">
<button type="submit" class="rounded-lg bg-slate-900 px-3 py-1.5 text-xs font-semibold text-white hover:bg-slate-700">Mark viewed</button>
</form>
{% else %}
<span class="rounded-lg border border-slate-300 bg-white px-3 py-1.5 text-xs font-semibold text-slate-500">Viewed</span>
{% endif %}
</div>
</article>
{% endfor %}
</div>
{% endif %}
</section>
{% endblock %}