DispelEvilBot/admin/templates/users/card.html

107 lines
4.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}{{ user.nick or user.id_user }}{% endblock %}
{% block content %}
<p class="text-sm text-slate-500"><a href="/users" class="hover:underline">← Пользователи</a></p>
<div class="mt-2 flex flex-wrap items-start justify-between gap-4">
<div>
<h1 class="text-2xl font-semibold">{{ user.nick or "Без ника" }}</h1>
<p class="mt-1 text-slate-600">
{% if user.username %}<span class="font-mono">@{{ user.username }}</span> · {% endif %}
<span class="font-mono">{{ user.id_user }}</span>
{% if user.first_name or user.last_name %}
· {{ user.first_name or "" }} {{ user.last_name or "" }}
{% endif %}
</p>
</div>
<div class="flex items-center gap-2">
{% if user.title %}
<span class="rounded bg-indigo-100 px-3 py-1 text-sm text-indigo-800">{{ user.title }}</span>
{% endif %}
{% if user.subscribed %}
<span class="rounded bg-emerald-100 px-3 py-1 text-sm text-emerald-800">подписан на рассылки</span>
{% else %}
<span class="rounded bg-slate-100 px-3 py-1 text-sm text-slate-500">без рассылок</span>
{% endif %}
</div>
</div>
<div class="mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Уровень</div>
<div class="mt-1 text-xl font-semibold">{{ user.lvl }}</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Опыт</div>
<div class="mt-1 text-xl font-semibold">{{ user.expr }}</div>
<div class="text-xs text-slate-500">серия: {{ user.expr_streak }}</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Баланс DE</div>
<div class="mt-1 text-xl font-semibold">{{ user.balance }}</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Яички</div>
<div class="mt-1 text-xl font-semibold">{{ user.eggs }}</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Сообщения</div>
<div class="mt-1 text-xl font-semibold">{{ user.msg_count }}</div>
<div class="text-xs text-slate-500">
последнее: {{ user.last_message_at.strftime("%d.%m.%Y %H:%M") if user.last_message_at else "—" }}
</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Очищения</div>
<div class="mt-1 text-xl font-semibold">{{ user.purification_count }}</div>
<div class="text-xs text-slate-500">
последнее: {{ user.last_purification_at.strftime("%d.%m.%Y %H:%M") if user.last_purification_at else "—" }}
</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">В клане с</div>
<div class="mt-1 text-xl font-semibold">
{{ user.dt_create.strftime("%d.%m.%Y") if user.dt_create else "—" }}
</div>
</div>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="text-xs uppercase tracking-wide text-slate-500">Telegram-ID</div>
<div class="mt-1 font-mono text-sm">{{ user.id_user }}</div>
</div>
</div>
<div class="mt-8">
<h2 class="text-lg font-medium">Последние операции по балансу</h2>
{% if money %}
<div class="mt-3 overflow-x-auto rounded-lg border border-slate-200 bg-white">
<table class="min-w-full divide-y divide-slate-200 text-sm">
<thead class="bg-slate-50 text-left text-slate-600">
<tr>
<th class="px-4 py-3 font-medium">Когда</th>
<th class="px-4 py-3 font-medium">Сумма</th>
<th class="px-4 py-3 font-medium">Действие</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
{% for item in money %}
<tr>
<td class="px-4 py-3 text-slate-600">
{{ item.dt_action.strftime("%d.%m.%Y %H:%M") if item.dt_action else "—" }}
</td>
<td class="px-4 py-3 font-medium {% if item.amount < 0 %}text-red-600{% else %}text-emerald-700{% endif %}">
{{ "%+d" | format(item.amount) }}
</td>
<td class="px-4 py-3 text-slate-700">{{ item.action or "—" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="mt-2 text-sm text-slate-500">Операций по балансу не было.</p>
{% endif %}
</div>
{% endblock %}