Skip to content

Simplify bill and invoice detail card templates#327

Open
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
billkhiz-bit:cleanup/lighten-bill-invoice-cards-250
Open

Simplify bill and invoice detail card templates#327
billkhiz-bit wants to merge 1 commit intoarrobalytics:masterfrom
billkhiz-bit:cleanup/lighten-bill-invoice-cards-250

Conversation

@billkhiz-bit
Copy link
Copy Markdown

Summary

Addresses #250 — lightens the bill and invoice card templates by collapsing duplicated status blocks into a single unified structure.

Problem

Both card_bill.html and card_invoice.html contained 4 near-identical blocks for each status state (draft, review, approved, paid). Each block repeated the same amount, due date, and accrual markup with only minor differences (CSS colour classes and which fields to show).

Changes

  • card_bill.html: 219 → 155 lines (-29%). Four status blocks collapsed into one with conditional CSS classes.
  • card_invoice.html: 203 → 155 lines (-24%). Same treatment.
  • New components/accrual_icon.html: Extracted the accrual status icon (check/block) into a reusable include, used by both cards.

Additional fixes found during cleanup

  • Unclosed <p> tags in the dashboard accrual section (both bill and invoice)
  • Several user-facing strings missing {% trans %} tags ("You Still Owe", "Amount Paid", "Progressed", "Is Accrued")
  • Duplicate id attributes on footer action buttons (copy-paste artefact)

What's preserved

  • All visual behaviour and layout remains identical
  • All action buttons and modals work the same way
  • Dashboard card style is unchanged
  • All existing {% trans %} tags are kept

Collapse 4 near-identical status blocks (draft, review, approved, paid)
into a single unified block with conditional CSS classes. This removes
~90 lines of duplicated markup while preserving all visual behaviour.

Changes:
- card_bill.html: 219 → 155 lines (-29%)
- card_invoice.html: 203 → 155 lines (-24%)
- New: components/accrual_icon.html (shared accrual status icon)

Also fixes:
- Unclosed <p> tags in dashboard accrual section
- Missing {% trans %} tags on several user-facing strings
- Duplicate id attributes on footer action buttons

Addresses arrobalytics#250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant