Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ <h3 style="margin: 0; color: #666; font-size: 14px;">Total Tax {{ "%.4g"|format(

<!-- Invoices for this quarter -->
{% for invoice in invoices_by_year[year][quarter] %}
<tr>
<tr class="clickable-row" data-href="{{ url_for('view_invoice', id=invoice.id) }}">
<td>{{ invoice.invoice_number }}</td>
<td>
<a href="{{ url_for('generate_pdf', id=invoice.id) }}" class="btn btn-success" style="padding: 4px 8px; font-size: 12px;">
Expand Down Expand Up @@ -395,6 +395,14 @@ <h3 style="margin: 0; color: #666; font-size: 14px;">Total Tax {{ "%.4g"|format(
background: #f8f9fa;
}

.invoiceTable tr.clickable-row {
cursor: pointer;
}

.invoiceTable tr.clickable-row:hover {
background: #e8f4fd;
}

/* Compact columns */
.invoiceTable th:nth-child(1),
.invoiceTable td:nth-child(1) {
Expand Down Expand Up @@ -518,6 +526,15 @@ <h3 style="margin: 0; color: #666; font-size: 14px;">Total Tax {{ "%.4g"|format(
// Initialize converter on page load
document.addEventListener('DOMContentLoaded', function() {
convertCurrency();

// Clickable invoice rows
document.querySelectorAll('.clickable-row').forEach(function(row) {
row.addEventListener('click', function(e) {
// Don't navigate if clicking a link or button inside the row
if (e.target.closest('a, button, .btn')) return;
window.location.href = row.dataset.href;
});
});
});
</script>

Expand Down
17 changes: 16 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h1>Invoice Management</h1>
</thead>
<tbody>
{% for invoice in invoices %}
<tr>
<tr class="clickable-row" data-href="{{ url_for('view_invoice', id=invoice.id) }}">
<td>{{ invoice.invoice_number }}</td>
<td>{{ invoice.client_name }}</td>
<td>{{ invoice.invoice_date.strftime('%d/%m/%Y') if invoice.invoice_date else 'N/A' }}</td>
Expand Down Expand Up @@ -168,6 +168,14 @@ <h1>Invoice Management</h1>
background: #f8f9fa;
}

.invoiceTable tr.clickable-row {
cursor: pointer;
}

.invoiceTable tr.clickable-row:hover {
background: #e8f4fd;
}

/* Column widths */
.invoiceTable th:nth-child(1),
.invoiceTable td:nth-child(1) {
Expand Down Expand Up @@ -271,5 +279,12 @@ <h1>Invoice Management</h1>
document.querySelectorAll('.inv-menu').forEach(function(m) { m.style.display = 'none'; });
}
});
// Clickable invoice rows
document.querySelectorAll('.clickable-row').forEach(function(row) {
row.addEventListener('click', function(e) {
if (e.target.closest('a, button, .btn, .inv-menu')) return;
window.location.href = row.dataset.href;
});
});
</script>
{% endblock %}
Loading