mirror of
https://github.com/Lyxminxx/jast.git
synced 2026-10-11 12:51:51 +02:00
62 lines
2.6 KiB
HTML
62 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>DIME Tracker</title>
|
|
<style>
|
|
body { font-family: system-ui, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; }
|
|
.card { background: #f4f4f5; padding: 20px; border-radius: 8px; margin-bottom: 30px; }
|
|
table { width: 100%; border-collapse: collapse; }
|
|
th, td { padding: 12px; border-bottom: 1px solid #e4e4e7; text-align: left; }
|
|
.income { color: #16a34a; font-weight: bold; }
|
|
.expense { color: #dc2626; }
|
|
button { background: #18181b; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; }
|
|
.btn-edit { background: #3b82f6; color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 14px; margin-right: 5px; }
|
|
.btn-delete { background: #ef4444; color: white; padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Just another spending tracker</h1>
|
|
<div style="margin-bottom: 20px;">
|
|
<h2>Total Balance: {{ total_balance|floatformat:2 }} kr</h2>
|
|
<a href="{% url 'stats' %}" style="background: #e4e4e7; color: black; text-decoration: none; padding: 8px 16px; border-radius: 4px; font-weight: bold;">View Statistics 📊</a>
|
|
</div>
|
|
<div class="card">
|
|
<h3>Add Transaction</h3>
|
|
<form method="POST">
|
|
{% csrf_token %}
|
|
{{ form.as_p }}
|
|
<button type="submit">Save Transaction</button>
|
|
</form>
|
|
</div>
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Title</th>
|
|
<th>Category</th>
|
|
<th>Amount</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
{% for t in transactions %}
|
|
<tr>
|
|
<td>{{ t.date }}</td>
|
|
<td>{{ t.title }}</td>
|
|
<td>{{ t.category.name|default:"-" }}</td>
|
|
<td class="{% if t.is_income %}income{% else %}expense{% endif %}">
|
|
{{ t.amount }} kr
|
|
</td>
|
|
<td>
|
|
<a href="{% url 'edit_transaction' t.pk %}" class="btn-edit">Edit</a>
|
|
<form action="{% url 'delete_transaction' t.pk %}" method="POST" style="display:inline;" onsubmit="return confirm('Are you sure you want to delete this transaction?');">
|
|
{% csrf_token %}
|
|
<button type="submit" class="btn-delete">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="5">No transactions yet. Start spending!</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
</body>
|
|
</html>
|