- Add custom border, background, and spacing utilities to base template - Enhance message notification styling and layout - Update delete modal button appearance and behavior - Refine comment card component with Tailwind classes and responsive behavior - Adjust sidebar responsiveness for mobile view
57 lines
4.1 KiB
HTML
57 lines
4.1 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% block title %}Invoice #{{ invoice.id }}{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="max-w-3xl mx-auto">
|
|
<div class="card-surface overflow-hidden mb-6">
|
|
<div class="p-6">
|
|
<div class="flex items-start justify-between mb-6">
|
|
<div>
|
|
<div class="flex items-center gap-2 text-sm text-tertiary mb-1">
|
|
<a href="{% url 'invoice_list' %}" class="hover:text-blue-600">Invoices</a>
|
|
<span>/</span>
|
|
</div>
|
|
<h1 class="text-2xl font-bold text-primary">Invoice #{{ invoice.id }}</h1>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if invoice.status == 'paid' %}bg-green-50 text-green-700 border-green-200{% elif invoice.status == 'overdue' %}bg-red-50 text-red-700 border-red-200{% else %}bg-amber-50 text-amber-700 border-amber-200{% endif %}">
|
|
{{ invoice.get_status_display }}
|
|
</span>
|
|
{% if user.is_admin %}
|
|
<a href="{% url 'invoice_edit' invoice.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">Edit</a>
|
|
<label for="delete-modal-invoice" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-700 hover:bg-red-100 border border-red-200 transition-colors cursor-pointer">Delete</label>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 p-4 bg-hover rounded-xl mb-6">
|
|
<div><p class="text-xs text-muted uppercase font-medium">Project</p><p class="text-sm font-semibold text-primary mt-1">{{ invoice.project.name }}</p></div>
|
|
<div><p class="text-xs text-muted uppercase font-medium">Client</p><p class="text-sm font-semibold text-primary mt-1">{{ invoice.client.username }}</p></div>
|
|
<div><p class="text-xs text-muted uppercase font-medium">Amount</p><p class="text-lg font-bold text-primary mt-1">${{ invoice.amount }}</p></div>
|
|
<div><p class="text-xs text-muted uppercase font-medium">Due Date</p><p class="text-sm font-semibold text-primary mt-1">{{ invoice.due_date }}</p></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-surface overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-subtle flex items-center justify-between">
|
|
<h2 class="font-semibold text-primary">Payments</h2>
|
|
{% if user.is_admin %}
|
|
<a href="{% url 'payment_create' %}?invoice={{ invoice.pk }}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">Record Payment</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="overflow-x-auto p-6">
|
|
<table class="w-full text-sm">
|
|
<thead><tr class="text-xs font-semibold text-muted uppercase bg-hover"><th class="px-4 py-3 text-left">Date</th><th class="px-4 py-3 text-left">Method</th><th class="px-4 py-3 text-left">Amount</th><th class="px-4 py-3 text-left">Reference</th></tr></thead>
|
|
<tbody>
|
|
{% for payment in payments %}
|
|
<tr class="border-t border-subtle"><td class="px-4 py-3 text-secondary">{{ payment.paid_at|date:"M d, Y H:i" }}</td><td class="px-4 py-3 text-secondary">{{ payment.method }}</td><td class="px-4 py-3 text-sm font-semibold text-primary">${{ payment.amount }}</td><td class="px-4 py-3 text-tertiary">{{ payment.reference|default:"-" }}</td></tr>
|
|
{% empty %}
|
|
<tr><td colspan="4" class="text-center py-8 text-muted">No payments recorded yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% url 'invoice_delete' invoice.pk as delete_url %}
|
|
{% include "components/delete_modal.html" with modal_id="delete-modal-invoice" delete_url=delete_url %}
|
|
{% endblock %}
|