NextExpense/templates/event_expenses.html
cclohmar 67f5ed5624 feat: rebrand to ReceiptNext with 'The Terminal Mint' dark palette
- New favicon: Rx symbol in emerald green square (prescription/receipt)
- Dark theme: #0F172A base, #1E293B cards, #F8FAFC text
- Emerald #10B981 primary accent throughout
- Dashboard simplified to list view with event name + Open button
- Event page: receipt list with edit, Add Receipt button, Submit Event form
- Submit form shows total claim amount + email + format selection
- PWA manifest + service worker updated for ReceiptNext branding
- Variables-based theming for easy palette switching
2026-05-30 13:05:58 +00:00

131 lines
6.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#10b981">
<title>{{.Event.Name}} - ReceiptNext</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<link rel="alternate icon" href="/static/icons/icon-192.png">
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" href="/static/css/style.css">
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
</head>
<body>
<div class="app-shell">
<header class="app-header">
<a href="/dashboard" class="btn btn-secondary btn-sm"
hx-get="/dashboard" hx-target="body" hx-push-url="true">&larr; Events</a>
<h1 class="app-title" style="font-size: 1.1rem;">{{.Event.Name}}</h1>
</header>
<main class="main-content">
<!-- Receipt List -->
<div id="expense-list">
<h3 style="margin-bottom: 1rem; font-size: 1rem; font-weight: 600;">
Receipts
{{if .Event.BaseCurrency}}
<span style="font-weight: 400; color: #6b7280;">(claim in {{.Event.BaseCurrency}})</span>
{{end}}
</h3>
{{if .Expenses}}
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
{{range .Expenses}}
<div style="display: flex; align-items: center; background: white; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem;">
<div style="flex: 1; min-width: 0;">
<div style="font-weight: 500;">{{.Merchant}}</div>
<div style="font-size: 0.75rem; color: #6b7280;">{{.Date}} · {{.Category}} {{if .Description}}· {{.Description}}{{end}}</div>
</div>
<div style="text-align: right; margin-right: 0.75rem;">
<div style="font-weight: 600;">{{printf "%.2f" .Amount}} {{.Currency}}</div>
{{if .ConvertedAmount}}
<div style="font-size: 0.75rem; color: #166534;">{{printf "%.2f" .ConvertedAmount}} {{.BaseCurrency}}</div>
{{end}}
</div>
<button class="btn btn-sm" style="background: none; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.25rem 0.5rem; font-size: 0.75rem; cursor: pointer; flex-shrink: 0;"
hx-get="/expenses/{{.ID}}/edit"
hx-target="#receipt-form"
hx-swap="innerHTML"
title="Edit receipt">✏️</button>
</div>
{{end}}
</div>
{{else}}
<div style="text-align: center; padding: 2rem; color: #94a3b8; font-size: 0.875rem;">
<p>No receipts yet.</p>
</div>
{{end}}
</div>
<!-- Receipt Form (edit/add) -->
<div id="receipt-form" style="margin-top: 1.5rem;"></div>
<!-- Add Receipt Button -->
<div style="margin-top: 1.5rem; text-align: center;">
<label for="receipt-upload" class="btn btn-primary btn-block" style="display: block; text-align: center; cursor: pointer;">
+ Add Receipt
</label>
<input type="file" id="receipt-upload" name="receipt" accept="image/*" capture="environment" style="display: none;"
hx-post="/expenses/upload"
hx-encoding="multipart/form-data"
hx-target="#receipt-form"
hx-swap="innerHTML"
hx-indicator="#upload-indicator"
hx-trigger="change">
<div id="upload-indicator" class="htmx-indicator" style="text-align: center; padding: 1rem;">
<div class="spinner"></div>
<p>Analyzing receipt...</p>
</div>
</div>
<!-- Submit Event (only if open and has expenses) -->
{{if and (eq .Event.Status "open") .Expenses}}
<div style="margin-top: 2rem; border-top: 1px solid #e2e8f0; padding-top: 1.5rem;">
<h3 style="font-size: 1rem; font-weight: 600; margin-bottom: 1rem;">Submit Event</h3>
<form hx-post="/events/{{.Event.ID}}/file" hx-target="body" hx-push-url="true">
<div class="form-group">
<label for="file-email">Send claim to</label>
<input type="email" id="file-email" name="email" placeholder="finance@company.com" required>
</div>
<div class="form-row">
<div class="form-group">
<label>Format</label>
<div style="display: flex; gap: 1rem; margin-top: 0.25rem;">
<label style="display: flex; align-items: center; gap: 0.25rem;">
<input type="radio" name="format" value="csv" checked> CSV
</label>
<label style="display: flex; align-items: center; gap: 0.25rem;">
<input type="radio" name="format" value="pdf"> PDF
</label>
</div>
</div>
<div class="form-group">
<label>Total claim</label>
<div style="font-size: 1.25rem; font-weight: 700; color: #166534; margin-top: 0.25rem;">
{{printf "%.2f" .TotalClaim}} {{.Event.BaseCurrency}}
</div>
</div>
</div>
<button type="submit" class="btn btn-primary btn-block" style="margin-top: 0.5rem;">
Submit & Close Event
</button>
</form>
</div>
{{end}}
<!-- Reopen (only if closed) -->
{{if eq .Event.Status "closed"}}
<div style="margin-top: 2rem; text-align: center;">
<button class="btn btn-secondary"
hx-put="/events/{{.Event.ID}}/reopen"
hx-target="body"
hx-push-url="true">
Reopen Event
</button>
</div>
{{end}}
</main>
</div>
</body>
</html>