This commit is contained in:
count-null 2025-02-27 16:38:19 -05:00
parent a0cb5fb6b0
commit e435d32588
88 changed files with 1781 additions and 1383 deletions

View file

@ -1,27 +1,47 @@
<section class="flex flex-col gap-4">
<h3 class="text-2xl font-semibold">Recently Sent Emails</h3>
<h3 class="text-2xl font-semibold">
Recently Sent Emails
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">To</th>
<th class="py-2">From</th>
<th class="py-2">Subject</th>
<th class="py-2">Created At</th>
<th class="py-2">
To
</th>
<th class="py-2">
From
</th>
<th class="py-2">
Subject
</th>
<th class="py-2">
Created At
</th>
</tr>
</thead>
<tbody>
{% for email in recent_emails %}
<tr>
<td class="border px-4 py-2">{{ email.to_email }}</td>
<td class="border px-4 py-2">{{ email.from_email }}</td>
<td class="border px-4 py-2">{{ email.subject }}</td>
<td class="border px-4 py-2">{{ email.created_at }}</td>
</tr>
<tr>
<td class="border px-4 py-2">
{{ email.to_email }}
</td>
<td class="border px-4 py-2">
{{ email.from_email }}
</td>
<td class="border px-4 py-2">
{{ email.subject }}
</td>
<td class="border px-4 py-2">
{{ email.created_at }}
</td>
</tr>
{% else %}
<tr>
<td class="border px-4 py-2" colspan="4">No recent emails found.</td>
</tr>
<tr>
<td class="border px-4 py-2" colspan="4">
No recent emails found.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
</section>

View file

@ -1,10 +1,22 @@
<section class="flex flex-col gap-4">
<a href="/admin">Dashboard</a>
<a href="/admin/users">Users</a>
<a href="/admin/orders">Orders</a>
<a href="/admin/returns">Returns</a>
<a href="/admin/emails">Emails</a>
<a href="/admin/transactions">Transactions</a>
<a href="/admin">
Dashboard
</a>
<a href="/admin/users">
Users
</a>
<a href="/admin/orders">
Orders
</a>
<a href="/admin/returns">
Returns
</a>
<a href="/admin/emails">
Emails
</a>
<a href="/admin/transactions">
Transactions
</a>
INDEX
</section>
</section>

View file

@ -1,3 +1,3 @@
<section class="flex flex-col gap-4">
ORDERS
</section>
</section>

View file

@ -1,3 +1,3 @@
<section class="flex flex-col gap-4">
RETURNS
</section>
</section>

View file

@ -2,14 +2,16 @@
{% include 'lib/alert.twig' %}
<form action="/admin/transactions/add" method="post" class="flex flex-col gap-4">
{% if session.last_post.confirm %}
Confirm
Confirm
<input type="hidden" name="confirm" id="confirm" value="{{ session.last_post.confirm }}">
{% endif %}
{% if session.last_post.amount is defined %}
{{ session.last_post.amount }} {{ session.last_post.currency }}
<input type="hidden" name="amount" id="amount" value="{{ session.last_post.amount }}">
{% else %}
{% include 'lib/number_input.twig' with {
{% endif %}
{% if session.last_post.amount is defined %}
{{ session.last_post.amount }}
{{ session.last_post.currency }}
<input
type="hidden" name="amount" id="amount" value="{{ session.last_post.amount }}" />
{% else %}
{% include 'lib/inputs/number.twig' with {
id: 'amount',
name: 'amount',
label: 'Amount',
@ -17,11 +19,12 @@
value: session.last_post.amount,
required: true
} %}
{% endif %}
{% if session.last_post.currency is defined %}
<input type="hidden" name="currency" id="currency" value="{{ session.last_post.currency }}">
{% else %}
{% include 'lib/select.twig' with {
{% endif %}
{% if session.last_post.currency %}
<input
type="hidden" name="currency" id="currency" value="{{ session.last_post.currency }}" />
{% else %}
{% include 'lib/inputs/select.twig' with {
id: 'currency',
name: 'currency',
label: 'Currency',
@ -32,30 +35,33 @@
],
required: true
} %}
{% endif %}
{% if session.last_post.user_identifier is defined %}
{% if session.last_post.email is defined %}
{{ session.last_post.id }} {{ session.last_post.email }}
{% endif %}
<input type="hidden" name="user_identifier" id="user_identifier" value="{{ session.last_post.user_identifier }}">
{% else %}
{% include 'lib/input.twig' with {
{% if session.last_post.user_identifier is defined %}
{% if session.last_post.email is defined %}
{{ session.last_post.id }}
{{ session.last_post.email }}
{% endif %}
<input
type="hidden" name="user_identifier" id="user_identifier" value="{{ session.last_post.user_identifier }}" />
{% else %}
{% include 'lib/inputs/text.twig' with {
type: 'text',
name: 'user_identifier',
label: 'User Identifier',
placeholder: 'Enter email or user index',
value: session.last_post.user_identifier
} %}
{% endif %}
{% include 'lib/button.twig' with {
{% endif %}
{% include 'lib/button.twig' with {
label: 'Submit',
onclick: 'this.parentNode.submit()'
} %}
</form>
{% if session.last_post %}
{% include 'lib/button.twig' with {
</form>
{% if session.last_post %}
{% include 'lib/button.twig' with {
label: 'Cancel',
href: '/admin/transactions/reset'
} %}
{% endif %}
</section>
{% endif %}
</section>

View file

@ -1,13 +1,13 @@
<section class="flex flex-col gap-4">
{% include 'lib/alert.twig' %}
<form action="/admin/transactions/add" method="post" class="flex flex-col gap-4">
{% include 'lib/number_input.twig' with {
{% include 'lib/inputs/number.twig' with {
id: 'amount',
name: 'amount',
label: 'Amount',
required: true
} %}
{% include 'lib/select.twig' with {
{% include 'lib/inputs/select.twig' with {
id: 'currency',
name: 'currency',
label: 'Currency',
@ -23,122 +23,192 @@
} %}
</form>
<h3 class="text-2xl font-semibold">Liabilities</h3>
<h3 class="text-2xl font-semibold">
Liabilities
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">Currency</th>
<th class="py-2">Total Liability</th>
<th class="py-2">
Currency
</th>
<th class="py-2">
Total Liability
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="border px-4 py-2">Sats</td>
<td class="border px-4 py-2">{{ sats_liability }}</td>
<td class="border px-4 py-2">
Sats
</td>
<td class="border px-4 py-2">
{{ sats_liability }}
</td>
</tr>
<tr>
<td class="border px-4 py-2">Cents</td>
<td class="border px-4 py-2">{{ cents_liability }}</td>
<td class="border px-4 py-2">
Cents
</td>
<td class="border px-4 py-2">
{{ cents_liability }}
</td>
</tr>
</tbody>
</table>
<h3 class="text-2xl font-semibold">Sats Transactions</h3>
<h3 class="text-2xl font-semibold">
Sats Transactions
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">Type</th>
<th class="py-2">Amount (Sats)</th>
<th class="py-2">Date</th>
<th class="py-2">
Type
</th>
<th class="py-2">
Amount (Sats)
</th>
<th class="py-2">
Date
</th>
</tr>
</thead>
<tbody>
{% if recent_sats is not empty %}
{% for transaction in recent_sats %}
<tr>
<td class="border px-4 py-2">{{ transaction.type }}</td>
<td class="border px-4 py-2">{{ transaction.sats }}</td>
<td class="border px-4 py-2">{{ transaction.date }}</td>
</tr>
<tr>
<td class="border px-4 py-2">
{{ transaction.type }}
</td>
<td class="border px-4 py-2">
{{ transaction.sats }}
</td>
<td class="border px-4 py-2">
{{ transaction.date }}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="border px-4 py-2" colspan="3">No Sats transactions available.</td>
<td class="border px-4 py-2" colspan="3">
No Sats transactions available.
</td>
</tr>
{% endif %}
</tbody>
</table>
<h3 class="text-2xl font-semibold">Cents Transactions</h3>
<h3 class="text-2xl font-semibold">
Cents Transactions
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">Type</th>
<th class="py-2">Amount (Cents)</th>
<th class="py-2">Date</th>
<th class="py-2">
Type
</th>
<th class="py-2">
Amount (Cents)
</th>
<th class="py-2">
Date
</th>
</tr>
</thead>
<tbody>
{% if recent_cents is not empty %}
{% for transaction in recent_cents %}
<tr>
<td class="border px-4 py-2">{{ transaction.type }}</td>
<td class="border px-4 py-2">{{ transaction.cents }}</td>
<td class="border px-4 py-2">{{ transaction.date }}</td>
</tr>
<tr>
<td class="border px-4 py-2">
{{ transaction.type }}
</td>
<td class="border px-4 py-2">
{{ transaction.cents }}
</td>
<td class="border px-4 py-2">
{{ transaction.date }}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="border px-4 py-2" colspan="3">No Cents transactions available.</td>
<td class="border px-4 py-2" colspan="3">
No Cents transactions available.
</td>
</tr>
{% endif %}
</tbody>
</table>
<h3 class="text-2xl font-semibold">Whales Sats</h3>
<h3 class="text-2xl font-semibold">
Whales Sats
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">User ID</th>
<th class="py-2">Total Sats</th>
<th class="py-2">
User ID
</th>
<th class="py-2">
Total Sats
</th>
</tr>
</thead>
<tbody>
{% if whales_sats is not empty %}
{% for whale in whales_sats %}
<tr>
<td class="border px-4 py-2">{{ whale.user_id }}</td>
<td class="border px-4 py-2">{{ whale.total }}</td>
</tr>
<tr>
<td class="border px-4 py-2">
{{ whale.user_id }}
</td>
<td class="border px-4 py-2">
{{ whale.total }}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="border px-4 py-2" colspan="2">No Sats whales available.</td>
<td class="border px-4 py-2" colspan="2">
No Sats whales available.
</td>
</tr>
{% endif %}
</tbody>
</table>
<h3 class="text-2xl font-semibold">Whales Cents</h3>
<h3 class="text-2xl font-semibold">
Whales Cents
</h3>
<table class="min-w-full bg-white">
<thead>
<tr>
<th class="py-2">User ID</th>
<th class="py-2">Total Cents</th>
<th class="py-2">
User ID
</th>
<th class="py-2">
Total Cents
</th>
</tr>
</thead>
<tbody>
{% if whales_cents is not empty %}
{% for whale in whales_cents %}
<tr>
<td class="border px-4 py-2">{{ whale.user_id }}</td>
<td class="border px-4 py-2">{{ whale.total }}</td>
</tr>
<tr>
<td class="border px-4 py-2">
{{ whale.user_id }}
</td>
<td class="border px-4 py-2">
{{ whale.total }}
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td class="border px-4 py-2" colspan="2">No Cents whales available.</td>
<td class="border px-4 py-2" colspan="2">
No Cents whales available.
</td>
</tr>
{% endif %}
</tbody>
</table>
</section>
</section>

View file

@ -1,3 +1,3 @@
<section class="flex flex-col gap-4">
USERS
</section>
</section>