Files
Spendr/app/templates/transactions.html
T
2026-11-17 21:48:36 +01:00

50 lines
4.1 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 %}Transactions{% endblock %}
{% block content %}
<div class="page-head"><div><h1>Transactions</h1><div class="sub">{{ total }} transactions · net <strong>{{ total_amount|eur }}</strong></div></div>
<div class="actions"><a class="btn secondary" href="/transactions?category=none">{{ icon('filter', 'sm') }} Uncategorised</a><a class="btn" href="/import">{{ icon('upload', 'sm') }} Import</a></div></div>
<form class="card mb form-grid" method="get">
<label>Search<input name="q" value="{{ f.q }}" placeholder="name, description, note"></label>
<label>Account<select name="account"><option value="">All</option>
{% for a in accounts %}<option value="{{ a.id }}" {{ 'selected' if f.account == a.id|string }}>{{ a.name }}</option>{% endfor %}</select></label>
<label>Category<select name="category"><option value="">All</option><option value="none" {{ 'selected' if f.category == 'none' }}>— Uncategorised —</option>
{% for c in categories %}<option value="{{ c.id }}" {{ 'selected' if f.category == c.id|string }}>{{ c.name }}</option>{% endfor %}</select></label>
<label>Month<input type="month" name="month" value="{{ f.month }}"></label>
<div class="row"><button>{{ icon('search', 'sm') }} Filter</button><a class="btn ghost" href="/transactions">Reset</a></div>
</form>
<div class="card">
<div class="card-head"><h2>{{ icon('receipt') }} Activity</h2><span class="small muted">{{ icon('lock', 'sm') }} Changing a category locks it so rules won't overwrite it.</span></div>
<div class="table-wrap">
<table>
<thead><tr><th>Date</th><th>Counterparty</th><th>Account</th><th>Category</th><th class="num">Amount</th><th>Note</th><th></th></tr></thead>
<tbody>
{% for t in txs %}
<tr>
<td class="small" style="white-space:nowrap">{{ t.date.strftime('%d-%m-%Y') }}</td>
<td><div class="cell-main"><span class="tx-ico {{ 'tint-good' if t.amount > 0 else 'tint-accent' }}">{{ icon('arrow-down-right' if t.amount > 0 else 'arrow-up-right', 'sm') }}</span>
<div><strong>{{ t.counterparty or '—' }}</strong>{% if t.recurring_id %} <span class="badge accent" title="Recurring">{{ icon('repeat', 'sm') }}</span>{% endif %}{% if t.debt_id %} <a class="badge warn" href="/debts/{{ t.debt_id }}" title="Debt payment">{{ icon('handshake', 'sm') }}</a>{% endif %}
<div class="desc" title="{{ t.description }}">{{ t.counter_iban or '' }} {{ t.description }}</div></div></div></td>
<td class="small">{{ t.account.name }}</td>
<td style="white-space:nowrap"><span class="dot" style="background:{{ t.category.color if t.category else 'transparent' }}; outline:1px solid var(--line)"></span><select data-tx="{{ t.id }}"><option value="">—</option>
{% for c in categories %}<option value="{{ c.id }}" data-color="{{ c.color }}" {{ 'selected' if t.category_id == c.id }}>{{ c.name }}</option>{% endfor %}</select>
{% if t.category_locked %}<span class="muted" title="Set manually">{{ icon('lock', 'sm') }}</span>{% endif %}</td>
<td class="num {{ 'good' if t.amount > 0 else '' }}" style="font-weight:600">{{ t.amount|eur }}{% if t.currency != 'EUR' %} <span class="muted small">{{ t.currency }}</span>{% endif %}</td>
<td><input data-notes="{{ t.id }}" value="{{ t.notes }}" placeholder="…" style="width:120px"></td>
<td><a class="btn ghost sm" title="Create a rule from this" href="/settings?rule={{ (t.counterparty or '')|urlencode }}#rules">{{ icon('plus', 'sm') }} Rule</a></td>
</tr>
{% else %}<tr><td colspan="7" class="muted">No transactions match.</td></tr>{% endfor %}
</tbody>
</table>
</div>
{% if pages > 1 %}
<div class="pager">
{% set qs = 'q=%s&account=%s&category=%s&month=%s'|format(f.q|urlencode, f.account, f.category, f.month) %}
{% if page > 1 %}<a class="btn secondary sm" href="?{{ qs }}&page={{ page-1 }}">‹ Prev</a>{% endif %}
<span class="muted">Page {{ page }} / {{ pages }}</span>
{% if page < pages %}<a class="btn secondary sm" href="?{{ qs }}&page={{ page+1 }}">Next ›</a>{% endif %}
</div>
{% endif %}
</div>
{% endblock %}