diff --git a/docs/design/README.md b/docs/design/README.md index c95a87d..00cd038 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -15,7 +15,7 @@ privé; de link staat in `huismus-intern/werkwijze.md`. Een kopie van 1, gemaakt met `scripts/design_system_export.py`, om in Claude nieuwe designs mee te maken. Het noemt zelf uit welke commit het gebouwd is (README daar, en - `lastChange`). Laatst bijgewerkt: 2026-11-05, uit commit `1f149f9`. + `lastChange`). Laatst bijgewerkt: 2026-11-15, uit commit `ccb4f94` (tak `huisstijl`, petrol). Bekijken: start vanuit de root van de repo `python3 -m http.server 8000` en open http://localhost:8000/docs/design/componenten.html (de pagina laadt @@ -70,7 +70,7 @@ ronde 3 (met een eigen schets-CSS, `hm.css`). Beide zijn naslag, geen bron. precies aan wat afwijkt. 8. **Meldingen op het overzicht** zijn rustige kaarten (`.hint-banner`): kleur alleen in de streep, het icoon en de link. Rood (`.is-bad`) boven de - KOR-grens of als iets mislukt, amber (`.is-warn`) om op te letten, violet + KOR-grens of als iets mislukt, amber (`.is-warn`) om op te letten, petrol (`.is-info`) voor informatie, snavelgeel (geen klasse) voor een herinnering. 9. **KOR**: de hint `.kor-note` in de editor; de tekst zelf, die de gebruiker in Instellingen zet, onder elke factuur. diff --git a/docs/design/componenten.html b/docs/design/componenten.html index d59564a..019a850 100644 --- a/docs/design/componenten.html +++ b/docs/design/componenten.html @@ -20,9 +20,9 @@

Principes

  1. Kleur alleen waar je iets moet doen; de rest is rustig. Te laat, over de KOR-grens: een gekleurd vlak. Betaald, definitief, afgerond: alleen een vinkje of slotje in gedempte tekst. Onbetaald en concept: gewone tekst of een gestippeld randje. Zo valt het ene belangrijke op.
  2. -
  3. Vandaag. Violet voor acties, snavelgeel voor highlights en herinneringen, neutralen met een zweem violet voor de rest. Geen nieuwe kleuren of lettertypes zonder besluit (huismus-intern/besluiten.md).
  4. -
  5. Rust van papier. Witte vlakken met een dunne rand op een bijna witte achtergrond. Knoppen met licht ronde hoeken, geen pillen. De ronde letter alleen voor koppen en grote bedragen. Bedragen in de tekstkleur, ook Openstaand: het menu is al violet.
  6. -
  7. Snavelgeel is nooit een knop. Een knop is violet (primair), wit (secundair), kaal (ghost) of rood (verwijderen).
  8. +
  9. Petrol. Petrol voor acties, snavelgeel voor highlights en herinneringen, warme neutralen voor de rest. Geen nieuwe kleuren of lettertypes zonder besluit (huismus-intern/besluiten.md).
  10. +
  11. Rust van papier. Witte vlakken met een dunne rand op een bijna witte achtergrond. Knoppen met licht ronde hoeken, geen pillen. De ronde letter alleen voor koppen en grote bedragen. Bedragen in de tekstkleur, ook Openstaand: het menu is al petrol.
  12. +
  13. Snavelgeel is nooit een knop. Een knop is petrol (primair), wit (secundair), kaal (ghost) of rood (verwijderen).
  14. Uitgegeven is definitief. Een uitgegeven document heeft geen invoervelden en een slotje. Concepten hebben geen nummer.
  15. Licht en donker, telefoon en laptop. Alles werkt op 360 px en in beide thema's, en haalt WCAG AA. Wissel het thema bovenaan om deze pagina in het donker te zien.
@@ -43,7 +43,7 @@

Kleuren

--text-muted
bijtekst (AA)
--paper
het vel papier
-

Primair: ochtendlucht

+

Primair: petrol

--primary
knoppen, actieve navigatie
--primary-hover
hover van de knop
@@ -129,19 +129,21 @@

Statuslabels

GecrediteerdCreditnota's dekken het hele factuurbedrag.Rand, geen kleur. DefinitiefUitgegeven: staat vast.Rustig: slotje en gedempte tekst, geen vlak. BetaaldHelemaal betaald.Rustig: een vinkje, gedempte tekst. -GeaccepteerdOfferte geaccepteerd.Rustig: een vinkje. +GeaccepteerdOfferte geaccepteerd.Petrol vlak met een vinkje: goed nieuws krijgt de huiskleur. AanEen instelling die aan staat of compleet is.Snavelgeel: in één oogopslag zie je wat aan staat. -AfgewezenOfferte afgewezen.Rustig: rode stip, geen vlak. +AfgewezenOfferte afgewezen.Rood vlak. +VerzondenOfferte verstuurd, wacht op antwoord.Wit met een randje: wacht nog. Elke status van een offerte is een pill. +VerlopenOfferte verlopen.Grijs vlak. VerlopenOfferte verlopen. Ook: niet gekoppeld, niet beschikbaar.Rustig: open stip. NakijkenUitgave die een AI-assistent invulde; weg na "Klopt" of Opslaan.Amber vlak, zoals Onbetaald: er moet nog iets gebeuren. overgeslagenVariant zonder stip (.no-dot), bijv. in het importrapport.Zoals de basis, zonder stip.
-
Te laat 12 dagenTe laat sinds 9 jun 202635 dagen te laatOnbetaaldDeels betaaldVerzondenConceptGeïmporteerdCreditnotaGecrediteerdDefinitiefBetaaldGeaccepteerdAanAfgewezenVerlopenovergeslagenNakijken
+
Te laat 12 dagenTe laat sinds 9 jun 202635 dagen te laatOnbetaaldDeels betaaldVerzondenConceptGeïmporteerdCreditnotaGecrediteerdDefinitiefBetaaldGeaccepteerdGekoppeldAanAfgewezenMisluktVerzondenVerlopenVerlopenovergeslagenNakijken

Meldingen

-

Op het overzicht: een rustige kaart met een gekleurde streep en een gekleurd icoon. Rood boven de KOR-grens of als iets mislukt, amber om op te letten, violet voor informatie, snavelgeel (zonder klasse) voor een herinnering zoals een concept.

+

Op het overzicht: een rustige kaart met een gekleurde streep en een gekleurd icoon. Rood boven de KOR-grens of als iets mislukt, amber om op te letten, petrol voor informatie, snavelgeel (zonder klasse) voor een herinnering zoals een concept.

Je omzet in 2026 (€ 21.400,00) is hoger dan je KOR-grens van € 20.000,00.Naar het jaaroverzicht → De laatste back-up is 9 dagen oud.Back-ups → Er is een nieuwe versie: Huismus 1.5.0.Bekijken → diff --git a/docs/design/icons/mus.svg b/docs/design/icons/mus.svg new file mode 100644 index 0000000..6940377 --- /dev/null +++ b/docs/design/icons/mus.svg @@ -0,0 +1 @@ + diff --git a/huismus/contacts/views.py b/huismus/contacts/views.py index 2d58bcb..b56de56 100644 --- a/huismus/contacts/views.py +++ b/huismus/contacts/views.py @@ -1,18 +1,29 @@ # SPDX-FileCopyrightText: 2026 Huismus contributors # SPDX-License-Identifier: AGPL-3.0-or-later +from urllib.parse import urlencode + from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q +from django.db.models.functions import Lower from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.utils.translation import gettext_lazy as _ from huismus.business.models import Settings +from huismus.core.sorting import chosen_sort, sort_headers from huismus.documents.models import Document from .forms import ContactForm, ContactPersonFormSet from .models import Contact +# What a column of the customer list sorts on; a name is the company or the person. +CONTACT_SORT_FIELDS = { + "naam": ["company_name", "last_name", "first_name"], + "klantnummer": ["customer_number"], + "plaats": ["city"], +} + @login_required def contact_list(request): @@ -34,10 +45,21 @@ def contact_list(request): | Q(email__icontains=query) | Q(city__icontains=query) ) + sort = chosen_sort(request, CONTACT_SORT_FIELDS) + if sort: + fields = [Lower(field) for field in CONTACT_SORT_FIELDS[sort.removeprefix("-")]] + contacts = contacts.order_by(*(f.desc() if sort.startswith("-") else f for f in fields)) + + def list_url(value): + params = {"archived": "1" if show_archived else "", "q": query, "sorteer": value} + return "?" + urlencode({k: v for k, v in params.items() if v}) + return render( request, "contacts/list.html", { + "sort": sort_headers(sort, CONTACT_SORT_FIELDS, list_url), + "sorted_by": sort, "contacts": contacts, "query": query, "show_archived": show_archived, diff --git a/huismus/core/demo_history.py b/huismus/core/demo_history.py index f5a907a..f251933 100644 --- a/huismus/core/demo_history.py +++ b/huismus/core/demo_history.py @@ -118,6 +118,7 @@ def _contacts() -> list[Contact]: return [ Contact.objects.create( company_name=name, + customer_number=f"K{i + 1:03d}", address_line1=f"Voorbeeldstraat {i + 1}", postal_code="1012 NX", city="Amsterdam", diff --git a/huismus/core/pwa.py b/huismus/core/pwa.py index b097cf5..b4c268d 100644 --- a/huismus/core/pwa.py +++ b/huismus/core/pwa.py @@ -23,7 +23,7 @@ # --bg and --surface in huismus.css (light): the splash screen behind the # icon while the app starts, and the title bar, which on a phone sits # above the white top bar. base.html has the dark ones for theme-color. -BACKGROUND_COLOR = "#F1ECFD" +BACKGROUND_COLOR = "#FBF8F3" THEME_COLOR = "#FFFFFF" diff --git a/huismus/core/sorting.py b/huismus/core/sorting.py new file mode 100644 index 0000000..884581e --- /dev/null +++ b/huismus/core/sorting.py @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: 2026 Huismus contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +"""Sorting a list by a column heading (the owner, 2026-11-16). + +The choice travels in the query string as ?sorteer=, with a minus +in front for descending. A heading links to the next step: ascending, +descending, then back to the list's own order. +""" + +SORT_PARAM = "sorteer" + + +def chosen_sort(request, columns): + """The ?sorteer= value if it names one of `columns`, else "" (the list's + own order). Anything else in the address is ignored, never an error.""" + value = request.GET.get(SORT_PARAM, "") + return value if value.removeprefix("-") in columns else "" + + +def sort_headers(current, columns, url_for): + """Per column what its heading needs: the address of the next step and + the aria-sort state now. `url_for(value)` builds the list's address with + that ?sorteer= value ("" leaves it out).""" + headers = {} + for column in columns: + if current == column: + headers[column] = {"url": url_for(f"-{column}"), "state": "ascending"} + elif current == f"-{column}": + headers[column] = {"url": url_for(""), "state": "descending"} + else: + headers[column] = {"url": url_for(column), "state": ""} + return headers + + +def sorted_rows(rows, current, keys): + """`rows` (a list) sorted by the chosen column; `keys` maps a column to + its key function. Stable, so equal rows keep the list's own order.""" + if not current: + return rows + return sorted(rows, key=keys[current.removeprefix("-")], reverse=current.startswith("-")) diff --git a/huismus/core/static/core/favicon.svg b/huismus/core/static/core/favicon.svg index b9ba8c4..c634c4f 100644 --- a/huismus/core/static/core/favicon.svg +++ b/huismus/core/static/core/favicon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/huismus/core/static/core/huismus.css b/huismus/core/static/core/huismus.css index f4072fc..4b3d7a0 100644 --- a/huismus/core/static/core/huismus.css +++ b/huismus/core/static/core/huismus.css @@ -1,7 +1,7 @@ /* SPDX-FileCopyrightText: 2026 Huismus contributors SPDX-License-Identifier: AGPL-3.0-or-later */ /* ========================================================================== - Huismus design system: richting "Vandaag" (violet + snavelgeel) + Huismus design system: richting "Verfijnd" (petrol + snavelgeel) Plain CSS, geen build-stap. Licht/donker via light-dark() + color-scheme. Forceer een thema met . ========================================================================== */ @@ -35,39 +35,39 @@ /* Radius */ --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px; - /* Neutralen: bijna wit met een zweem violet; witte vlakken met een dunne rand - (ontwerp "Verfijnd", de eigenaar, 2026-11-15) */ - --bg: light-dark(#F8F7FB, #121019); - --surface: light-dark(#FFFFFF, #1A1726); - --surface-2: light-dark(#F2F0F7, #221E31); - --surface-3: light-dark(#E7E4EF, #2C283D); - --border: light-dark(#E7E4EF, #2C283D); - --border-strong: light-dark(#D3CEE0, #423C5A); + /* Neutralen: warm wit; witte vlakken met een dunne rand + (ontwerp "Verfijnd" in petrol, de eigenaar, 2026-11-15) */ + --bg: light-dark(#FBF8F3, #191613); + --surface: light-dark(#FFFFFF, #231F1B); + --surface-2: light-dark(#F4EFE7, #2C2722); + --surface-3: light-dark(#EBE4D9, #362F29); + --border: light-dark(#E6DED2, #3A342D); + --border-strong: light-dark(#CEC3B3, #564C42); /* De rand van een invoerveld haalt 3 : 1 tegen vlak en achtergrond (huismus-intern/besluiten.md, 2026-11-15). */ - --field-border: light-dark(#8A859C, #746D90); - --text: light-dark(#1B1730, #EFEDF6); - --text-muted: light-dark(#615C72, #A8A2BC); - --paper: light-dark(#FFFFFF, #1F1838); - - /* Primair: ochtendlucht */ - --primary: light-dark(#6B3FD9, #A98BF5); - --primary-hover: light-dark(#5B30C8, #B9A0F8); - --on-primary: light-dark(#FFFFFF, #160A38); - --primary-soft: light-dark(#EFEAFD, #2A2448); - --primary-ink: light-dark(#5229BF, #BBA3F8); - --ring: light-dark(rgb(107 63 217 / .32), rgb(169 139 245 / .42)); + --field-border: light-dark(#8A8073, #837769); + --text: light-dark(#2A2520, #F2ECE4); + --text-muted: light-dark(#6B6258, #B3A99C); + --paper: light-dark(#FFFFFF, #26221E); + + /* Primair: petrol */ + --primary: light-dark(#0D6B6E, #5FC9C4); + --primary-hover: light-dark(#0A5659, #8ADBD6); + --on-primary: light-dark(#FFFFFF, #0A1F1F); + --primary-soft: light-dark(#DDF0EF, #15302F); + --primary-ink: light-dark(#0A5A5D, #8ADBD6); + --ring: light-dark(rgb(13 107 110 / .32), rgb(95 201 196 / .42)); /* Accent: snavelgeel (highlights, hints, de KOR-balk; nooit voor knoppen) */ --accent: light-dark(#F5A623, #F5A623); --accent-soft: light-dark(#FDF0D5, #33270F); --accent-ink: light-dark(#855000, #FFC766); - --mark-wing: light-dark(#A98BF5, #CBB8FA); /* vleugel van de mus: lichter dan het lijf */ + --mark-wing: light-dark(#5FC9C4, #8ADBD6); /* vleugel van de mus: lichter dan het lijf */ - /* Het diepviolette menu op een breed scherm */ - --panel: light-dark(#3B2694, #2F1D80); /* een tint lichter dan het ontwerp: rustiger (de eigenaar, 2026-11-15) */ + /* Het diep-petrol menu op een breed scherm */ + --panel: light-dark(#0B4F51, #0A3E40); --panel-text: light-dark(#FFFFFF, #FFFFFF); - --panel-muted: light-dark(#CFC4F2, #CFC4F2); - --panel-wing: light-dark(#CBB8FA, #CBB8FA); + --panel-muted: light-dark(#BFE3E1, #BFE3E1); + --panel-wing: light-dark(#8ADBD6, #8ADBD6); --panel-hover: rgb(255 255 255 / .10); --panel-current: rgb(255 255 255 / .16); --panel-line: rgb(255 255 255 / .18); @@ -76,7 +76,7 @@ --ok: light-dark(#1E7A45, #7AD6A0); --ok-bg: light-dark(#E2F3E8, #1D3326); --warn: light-dark(#855000, #FFC766); --warn-bg: light-dark(#FDF0D5, #33270F); --bad: light-dark(#B4184F, #FF8FB1); --bad-bg: light-dark(#FCE6EE, #3D1326); - --draft: light-dark(#615C72, #A8A2BC); --draft-bg: light-dark(#F2F0F7, #221E31); + --draft: light-dark(#5E574F, #C9BFB2); --draft-bg: light-dark(#EFEAE3, #2F2A24); --danger: light-dark(#B4184F, #FF8FB1); --danger-hover: light-dark(#96113F, #FFB0C8); --on-danger: light-dark(#FFFFFF, #33061D); @@ -85,9 +85,9 @@ /* Schaduwen */ --sh-1: 0 1px 2px rgb(42 37 32 / .05); --sh-2: 0 1px 2px rgb(42 37 32 / .05), 0 6px 18px rgb(42 37 32 / .07); - --sh-paper: 0 1px 2px rgb(26 21 48 / .06), 0 14px 44px rgb(26 21 48 / .10); - --sh-pop: 0 2px 6px rgb(15 11 30 / .08), 0 18px 48px rgb(15 11 30 / .20); - --overlay: rgb(15 11 30 / .42); + --sh-paper: 0 1px 2px rgb(42 37 32 / .06), 0 14px 44px rgb(42 37 32 / .10); + --sh-pop: 0 2px 6px rgb(25 22 19 / .08), 0 18px 48px rgb(25 22 19 / .20); + --overlay: rgb(25 22 19 / .42); /* Maten */ --sidebar-w: 240px; @@ -114,7 +114,7 @@ p { margin: 0; text-wrap: pretty; } a { color: var(--primary-ink); text-underline-offset: 3px; } a:hover { color: var(--primary-hover); } :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; } -::selection { background: rgb(107 63 217 / .2); } +::selection { background: rgb(13 107 110 / .2); } .muted { color: var(--text-muted); } .small { font-size: var(--fs-sm); } .num, .amount { font-variant-numeric: tabular-nums; } @@ -128,7 +128,7 @@ a:hover { color: var(--primary-hover); } .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; } /* Overzicht: Laatste facturen is een tabel met lange klantnamen, dus breder (ontwerp "Verfijnd"). */ -.split.split-wide { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); } +.split.split-wide { grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr); } /* the side card keeps room for a name and an amount */ .split-rev { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-6); align-items: start; } .split-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s-6); align-items: start; } @media (max-width: 980px) { .split-rev > .aside-first { order: -1; } } @@ -211,7 +211,7 @@ a:hover { color: var(--primary-hover); } /* Paginakop */ .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); } -.page-head .titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; } +.page-head .titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 280px; } /* de tekst loopt om, de knoppen blijven rechts staan */ .page-head .actions { display: flex; gap: var(--s-2); flex-wrap: wrap; } .back { display: inline-flex; align-items: center; gap: 4px; padding-block: 6px; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--text-muted); text-decoration: none; font-weight: var(--fw-medium); } .back:hover { color: var(--text); } @@ -244,7 +244,7 @@ a:hover { color: var(--primary-hover); } } .tabbar a[aria-current="page"], .tabbar button[aria-current="page"] { color: var(--primary-ink); } .tabbar .fab { justify-self: center; align-self: center; width: 52px; height: 52px; min-height: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-2); } - /* Alleen violet waar een factuur maken de hoofdactie is; anders wit met een omlijning */ + /* Alleen petrol waar een factuur maken de hoofdactie is; anders wit met een omlijning */ .tabbar .fab-quiet { background: var(--surface); color: var(--primary-ink); box-shadow: inset 0 0 0 1px var(--border-strong); } .page-head { align-items: flex-start; } .page-head .actions { width: 100%; } @@ -483,6 +483,12 @@ a:hover { color: var(--primary-hover); } .list .title { font-weight: var(--fw-semibold); color: var(--text); text-decoration: none; } .list .title::after { content: ""; position: absolute; inset: 0; } .list > li:hover { background: var(--surface-2); } +/* Documenten in een smalle kaart (Overzicht), als een gestapelde tabelrij: naam en bedrag op één lijn, nummer en status eronder; bedrag en status rechts uitgelijnd */ +.list-docs > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; } +.list-docs .title { overflow-wrap: break-word; } +.list-docs .meta { font-size: var(--fs-sm); color: var(--text-muted); } +.list-docs .amount { justify-self: end; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; } +.list-docs .status { justify-self: end; align-self: center; } /* Filtertabs. Too many for the width: they break onto a next line, never scroll out of sight (Offertes at 1024px, 2026-10-31). So the active tab's @@ -775,10 +781,10 @@ a:hover { color: var(--primary-hover); } .kpi-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-medium); display: flex; align-items: center; gap: 8px; } .kpi-value { white-space: nowrap; font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.15; } .kpi-sub { font-size: var(--fs-sm); color: var(--text-muted); } -.kpi-hero { color: var(--text); } /* het bedrag in gewone tekstkleur: het menu is al violet (de eigenaar, 2026-11-15, ontwerp "Verfijnd") */ +.kpi-hero { color: var(--text); } /* het bedrag in gewone tekstkleur: het menu is al petrol (de eigenaar, 2026-11-15, ontwerp "Verfijnd") */ a.kpi-hero:hover { color: var(--text); background: var(--surface-2); } /* A notice is a quiet block like the other cards: no border, no stripe. Its kind - shows only in the round icon; the link is violet, and red only for a real + shows only in the round icon; the link is petrol, and red only for a real problem (huismus-intern/besluiten.md, 2026-10-30; the owner, 2026-11-15). */ .hint-banner { --hb-ink: var(--accent-ink); --hb-chip: var(--accent-soft); --hb-link: var(--primary-ink); @@ -1184,3 +1190,66 @@ form > div > .settings-section .card-head { border-bottom: 0; padding-bottom: 0; .overdue { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; } .overdue .pill-overdue { min-width: 72px; justify-content: center; } .overdue-since { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; } +/* A quote's status with its deadline beside it, like "Te laat" above: every row one line high. */ +.status-hint { display: inline-flex; align-items: center; gap: var(--s-3); white-space: nowrap; } +/* An action on every row of a list stays quiet until you point at it. */ +.table td[data-cell="action"] .btn-ghost { color: var(--text-muted); font-weight: var(--fw-medium); } +.table tr:hover td[data-cell="action"] .btn-ghost, .table td[data-cell="action"] .btn-ghost:focus-visible { color: var(--text); } +/* A short list in a card (Overzicht): every row one line, a long name ends in "…". Only while it is a table: stacked, the name wraps. */ +@container (min-width: 521px) { + .table-oneline td[data-cell="primary"] { width: 100%; max-width: 0; } + .table-oneline .row-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +} +/* Stacked (phone): the deadline says enough, the status beside it would push the name aside. */ +@container (max-width: 720px) { + .table.stackable .status-hint:has(.due-hint) .pill { display: none; } +} +/* Every status of a quote is a pill, each with its own colour, so a list reads at a glance + (the owner, 2026-11-16; before that only "te laat" had colour): an outline while it waits, + petrol for yes (the house colour is the good news), red for no, grey once it lapsed. */ +.pill-quote-sent { --pill-bg: var(--surface); --pill-fg: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); } +.pill-quote-sent::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; } +.pill-quote-accepted { --pill-bg: var(--primary-soft); --pill-fg: var(--primary-ink); } +.pill-quote-accepted::before { width: 9px; height: 5px; border-radius: 0; background: transparent; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-1px) rotate(-45deg); } +.pill-quote-declined { --pill-bg: var(--bad-bg); --pill-fg: var(--bad); } +.pill-quote-expired { --pill-bg: var(--draft-bg); --pill-fg: var(--draft); } +.pill-quote-expired::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; } +/* An invoice's payment status is a pill too, like a quote's (the owner, 2026-11-16): + petrol once paid, an outline while it waits, amber when part is in. "Te laat" stays red. */ +.pill-paid { --pill-bg: var(--primary-soft); --pill-fg: var(--primary-ink); padding-inline: 10px; font-weight: var(--fw-semibold); } +.pill-paid::before { width: 9px; height: 5px; } +.pill-unpaid { --pill-bg: var(--surface); --pill-fg: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); padding-inline: 10px; font-weight: var(--fw-semibold); } +.pill-partial { --pill-bg: var(--warn-bg); --pill-fg: var(--warn); padding-inline: 10px; font-weight: var(--fw-semibold); } +/* The notices on Overzicht (design review, 2026-11-16). A warning is a slim tinted strip, not a + white card like the figures below it; news is a quiet line of text. */ +.notices { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); } +.notices:not(:has(.hint-banner)) { display: none; } +.notices > div:not(.hint-banner) { display: contents; } +.notices .hint-banner { margin: 0 !important; } +.notices .hint-banner.is-warn, .notices .hint-banner.is-bad { padding: 8px var(--s-4) 8px var(--s-2); border-radius: var(--r-md); background: var(--hb-chip); border-color: color-mix(in oklab, var(--hb-ink) 22%, transparent); } +.notices .hint-banner.is-warn > .i, .notices .hint-banner.is-bad > .i { background: none; padding: 4px; } +.notices a.hint-banner.is-warn:hover, .notices a.hint-banner.is-bad:hover { background: color-mix(in oklab, var(--hb-chip) 86%, var(--hb-ink)); } +.notices .hint-banner.is-warn .spacer + span { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } +.notices .hint-banner.is-bad { font-weight: var(--fw-semibold); } +.notices .hint-banner.is-info { padding: 2px var(--s-2); gap: var(--s-2); border: 0; background: none; font-size: var(--fs-sm); color: var(--text-muted); } +.notices .hint-banner.is-info > .i { background: none; padding: 0; width: 16px; height: 16px; } +.notices .hint-banner.is-info .spacer { display: none; } +.notices a.hint-banner.is-info:hover, .notices div.hint-banner.is-info:has(> a):hover { background: none; color: var(--text); } +@media (min-width: 761px) { .hint-banner .spacer + span, .hint-banner .spacer ~ a { white-space: nowrap; } } +/* A column heading that sorts the list: the arrow shows the direction, a faint one on hover says it can. */ +.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; border-radius: 4px; } +.th-sort::after { content: "↕"; font-size: 11px; opacity: 0; transition: opacity .12s; } +.th-sort:hover { color: var(--text); } +.th-sort:hover::after, .th-sort:focus-visible::after { opacity: .6; } +th[aria-sort] .th-sort { color: var(--text); } +th[aria-sort="ascending"] .th-sort::after { content: "↑"; opacity: 1; } +th[aria-sort="descending"] .th-sort::after { content: "↓"; opacity: 1; } +th.r .th-sort { flex-direction: row-reverse; } +/* Stacked, a list has no headings: "Sorteren" in the toolbar opens the same links. The card is the + container, as wide as its table, so the button shows exactly when the headings are gone. */ +.list-card { container: list / inline-size; } +@container list (min-width: 721px) { .sort-menu-btn { display: none; } } +#sorteer-menu { inset: auto 12px calc(84px + env(safe-area-inset-bottom)) 12px; } +#sorteer-menu a[data-sort]::after { margin-left: auto; font-size: 12px; color: var(--text-muted); } +#sorteer-menu a[data-sort="ascending"]::after { content: "↑"; } +#sorteer-menu a[data-sort="descending"]::after { content: "↓"; } diff --git a/huismus/core/static/core/icons/apple-touch-icon.png b/huismus/core/static/core/icons/apple-touch-icon.png index 7207c68..9dd839b 100644 Binary files a/huismus/core/static/core/icons/apple-touch-icon.png and b/huismus/core/static/core/icons/apple-touch-icon.png differ diff --git a/huismus/core/static/core/icons/icon-192.png b/huismus/core/static/core/icons/icon-192.png index 2eded18..61a71f6 100644 Binary files a/huismus/core/static/core/icons/icon-192.png and b/huismus/core/static/core/icons/icon-192.png differ diff --git a/huismus/core/static/core/icons/icon-512.png b/huismus/core/static/core/icons/icon-512.png index ce51379..996447f 100644 Binary files a/huismus/core/static/core/icons/icon-512.png and b/huismus/core/static/core/icons/icon-512.png differ diff --git a/huismus/core/static/core/icons/icon-maskable-512.png b/huismus/core/static/core/icons/icon-maskable-512.png index 91955b2..5291dc8 100644 Binary files a/huismus/core/static/core/icons/icon-maskable-512.png and b/huismus/core/static/core/icons/icon-maskable-512.png differ diff --git a/huismus/documents/listing.py b/huismus/documents/listing.py index e242f2c..30181b5 100644 --- a/huismus/documents/listing.py +++ b/huismus/documents/listing.py @@ -141,3 +141,22 @@ def expiry_hint(quote, *, today): if days_left <= EXPIRY_HINT_DAYS: return ("soon", days_left) return None + + +# What a column of the invoice list sorts on. A credit note's amount counts +# as money going back, as the list shows it. +INVOICE_SORT_KEYS = { + "klant": lambda d: contact_name(d).casefold(), + "nummer": lambda d: d.number or "", + "datum": lambda d: (d.issue_date is not None, d.issue_date), + "status": lambda d: list(INVOICE_GROUPS).index(d.group), + "bedrag": lambda d: -d.total_cents if d.kind == "credit_note" else d.total_cents, +} + +QUOTE_SORT_KEYS = { + "klant": lambda q: contact_name(q).casefold(), + "nummer": lambda q: q.number or "", + "geldig": lambda q: (q.expiry_date is not None, q.expiry_date), + "status": lambda q: q.status, + "totaal": lambda q: q.total_cents, +} diff --git a/huismus/documents/templatetags/documents_tags.py b/huismus/documents/templatetags/documents_tags.py index 3204bc8..9db36ff 100644 --- a/huismus/documents/templatetags/documents_tags.py +++ b/huismus/documents/templatetags/documents_tags.py @@ -30,10 +30,10 @@ def contact_name(document): # Quote status -> pill class in huismus.css (§7). QUOTE_PILLS = { "draft": "concept", - "sent": "sent", - "accepted": "accepted", - "declined": "rejected", - "expired": "expired", + "sent": "quote-sent", + "accepted": "quote-accepted", + "declined": "quote-declined", + "expired": "quote-expired", } diff --git a/huismus/documents/views.py b/huismus/documents/views.py index cb91155..d929d00 100644 --- a/huismus/documents/views.py +++ b/huismus/documents/views.py @@ -16,6 +16,7 @@ from huismus.business.kor_limit import kor_limit_crossed_by from huismus.business.models import Settings from huismus.contacts.models import Contact +from huismus.core.sorting import chosen_sort, sort_headers, sorted_rows from huismus.core.templatetags.money import euros from .detail import contact_changed_since_issue, timeline_events @@ -37,7 +38,9 @@ from .issuing import IssueError, issue from .listing import ( INVOICE_GROUPS, + INVOICE_SORT_KEYS, INVOICE_TABS, + QUOTE_SORT_KEYS, QUOTE_TABS, expiry_hint, grouped, @@ -109,9 +112,14 @@ def document_list(request): found = [d for d in invoices if matches_search(d, query)] rows = grouped([d for d in found if in_tab(d, tab)]) + # Sorted by a column, the list is one table: the groups would cut it up. + sort = chosen_sort(request, INVOICE_SORT_KEYS) + rows = sorted_rows(rows, sort, INVOICE_SORT_KEYS) + for document in rows: + document.list_group = "" if sort else document.group def list_url(**changes): - params = {"tab": tab, "q": query, "jaar": year or "alle", **changes} + params = {"tab": tab, "q": query, "jaar": year or "alle", "sorteer": sort, **changes} return "?" + urlencode({k: v for k, v in params.items() if v}) tabs = [ @@ -137,6 +145,8 @@ def list_url(**changes): "years": years, "has_any": Document.objects.filter(kind__in=["invoice", "credit_note"]).exists(), "group_titles": INVOICE_GROUPS, + "sort": sort_headers(sort, INVOICE_SORT_KEYS, lambda value: list_url(sorteer=value)), + "sorted_by": sort, }, ) @@ -774,10 +784,12 @@ def quote_list(request): quotes = quotes.order_by(Case(When(status="draft", then=0), default=1), "-issue_date", "-pk") found = [q for q in quotes if matches_search(q, query)] today = timezone.localdate() - rows = [(q, expiry_hint(q, today=today)) for q in found if in_quote_tab(q, tab)] + sort = chosen_sort(request, QUOTE_SORT_KEYS) + in_tab_now = sorted_rows([q for q in found if in_quote_tab(q, tab)], sort, QUOTE_SORT_KEYS) + rows = [(q, expiry_hint(q, today=today)) for q in in_tab_now] def list_url(**changes): - params = {"tab": tab, "q": query, **changes} + params = {"tab": tab, "q": query, "sorteer": sort, **changes} return "?" + urlencode({k: v for k, v in params.items() if v}) tabs = [ @@ -798,6 +810,8 @@ def list_url(**changes): "tab": tab, "query": query, "has_any": Document.objects.filter(kind="quote").exists(), + "sort": sort_headers(sort, QUOTE_SORT_KEYS, lambda value: list_url(sorteer=value)), + "sorted_by": sort, }, ) diff --git a/huismus/expenses/views.py b/huismus/expenses/views.py index 1317690..df23e03 100644 --- a/huismus/expenses/views.py +++ b/huismus/expenses/views.py @@ -6,12 +6,14 @@ from django.contrib.auth.decorators import login_required from django.db import transaction from django.db.models import Count, Exists, F, OuterRef, ProtectedError, Q, Subquery, Sum +from django.db.models.functions import Lower from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _ from huismus.core.models import Attachment +from huismus.core.sorting import chosen_sort, sort_headers from . import batch, inbox, reading from .forms import ( @@ -88,18 +90,24 @@ def expense_list(request): or 0 ) + sort = chosen_sort(request, EXPENSE_SORT_FIELDS) rows = ( expenses.prefetch_related("lines__category") .annotate(has_receipt=Exists(Attachment.objects.filter(expense=OuterRef("pk")))) .annotate(shown_cents=_shown_cents(category_pk)) - .order_by("-date", "-pk")[:shown] + .order_by(*_expense_order(sort))[:shown] ) params = { "q": query, "jaar": year or "alle", "categorie": category_pk or "", "nakijken": "1" if to_check else "", + "sorteer": sort, } + + def sort_url(value): + return "?" + urlencode({k: v for k, v in {**params, "sorteer": value}.items() if v}) + more_url = None if total > shown: more_url = "?" + urlencode( @@ -113,6 +121,8 @@ def expense_list(request): "total": total, "total_cents": total_cents, "more_url": more_url, + "sort": sort_headers(sort, EXPENSE_SORT_FIELDS, sort_url), + "sorted_by": sort, "query": query, "year": year, "years": years, @@ -250,6 +260,24 @@ def _next_in_stack(current, stack, done: int = 1) -> str: return following.url(done) if following else reverse("expenses:process") +# What a column of the expense list sorts on. Not the category: an expense +# can have lines in several. +EXPENSE_SORT_FIELDS = { + "datum": F("date"), + "leverancier": Lower("supplier"), + "bedrag": F("shown_cents"), +} + + +def _expense_order(sort): + """The list's own order (newest first), or the chosen column first.""" + own = ["-date", "-pk"] + if not sort: + return own + field = EXPENSE_SORT_FIELDS[sort.removeprefix("-")] + return [field.desc() if sort.startswith("-") else field.asc(), *own] + + def _shown_cents(category_pk): """The amount a row of the list shows: the whole expense, or with a category filter only its lines in that category, so the rows add up to diff --git a/huismus/locale/en/LC_MESSAGES/django.po b/huismus/locale/en/LC_MESSAGES/django.po index dae01a8..1ac5fa0 100644 --- a/huismus/locale/en/LC_MESSAGES/django.po +++ b/huismus/locale/en/LC_MESSAGES/django.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: huismus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 19:01+0100\n" +"POT-Creation-Date: 2026-11-16 20:47+0100\n" "PO-Revision-Date: 2026-09-25 08:36+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -3050,8 +3050,8 @@ msgstr "" msgid "Weer leegmaken" msgstr "Clear sample data" -msgid "Facturen en uitgaven voor zzp'ers, met of zonder KOR" -msgstr "Invoices and expenses for Dutch freelancers, with or without the KOR" +msgid "Lokale boekhouding voor zzp'ers" +msgstr "Local bookkeeping for Dutch freelancers" msgid "Sneltoetsen:" msgstr "Shortcuts:" @@ -3870,8 +3870,8 @@ msgstr "Search customers" msgid "Zoek op naam, klantnummer of plaats" msgstr "Search by name, number or city" -msgid "Zoeken" -msgstr "Search" +msgid "Sorteren" +msgstr "Sort" msgid "Naam" msgstr "Name" @@ -3879,6 +3879,9 @@ msgstr "Name" msgid "Plaats" msgstr "City" +msgid "Zoeken" +msgstr "Search" + msgid "Actie" msgstr "Action" @@ -3930,6 +3933,12 @@ msgstr "Set up backups" msgid "Naar Back-ups" msgstr "To Backups" +msgid "Verder werken" +msgstr "Continue" + +msgid "zonder klant" +msgstr "without customer" + msgid "Hoe gebruik je Huismus?" msgstr "How do you use Huismus?" @@ -3985,6 +3994,32 @@ msgstr "search" msgid "Sluiten" msgstr "Close" +msgid "verloopt vandaag" +msgstr "expires today" + +#, python-format +msgid "verloopt over %(days)s dag" +msgid_plural "verloopt over %(days)s dagen" +msgstr[0] "expires in %(days)s day" +msgstr[1] "expires in %(days)s days" + +msgid "Verlopen" +msgstr "Expired" + +#, python-format +msgid "geldig tot %(date)s" +msgstr "valid until %(date)s" + +msgid "" +"Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als " +"verlopen markeren." +msgstr "" +"Sent quotes without a reply. After the expiry date you can mark them as " +"expired." + +msgid "Geen offertes die op antwoord wachten." +msgstr "No quotes waiting for a reply." + msgid "Uitleg bij de versie van Huismus die je nu gebruikt." msgstr "Explanations for the version of Huismus you're using now." @@ -4080,18 +4115,6 @@ msgstr "Found Huismus %(version)s. It's being downloaded." msgid "Bekijken" msgstr "View" -#, python-format -msgid "Je hebt nog %(count)s concept:" -msgid_plural "Je hebt nog %(count)s concepten, waaronder:" -msgstr[0] "You still have %(count)s draft:" -msgstr[1] "You still have %(count)s drafts, including:" - -msgid "zonder klant" -msgstr "without customer" - -msgid "Verder werken" -msgstr "Continue" - #, python-format msgid "waarvan %(count)s te laat" msgid_plural "waarvan %(count)s te laat" @@ -4127,41 +4150,15 @@ msgstr "All invoices" msgid "Nummer" msgstr "Number" -msgid "Bedrag" -msgstr "Amount" - msgid "Status" msgstr "Status" +msgid "Bedrag" +msgstr "Amount" + msgid "Je hebt nog geen facturen uitgegeven." msgstr "You haven't issued any invoices yet." -msgid "verloopt vandaag" -msgstr "expires today" - -#, python-format -msgid "verloopt over %(days)s dag" -msgid_plural "verloopt over %(days)s dagen" -msgstr[0] "expires in %(days)s day" -msgstr[1] "expires in %(days)s days" - -msgid "geldigheid voorbij" -msgstr "no longer valid" - -#, python-format -msgid "geldig tot %(date)s" -msgstr "valid until %(date)s" - -msgid "" -"Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als " -"verlopen markeren." -msgstr "" -"Sent quotes without a reply. After the expiry date you can mark them as " -"expired." - -msgid "Geen offertes die op antwoord wachten." -msgstr "No quotes waiting for a reply." - msgid "Nog geen facturen" msgstr "No invoices yet" @@ -4432,9 +4429,6 @@ msgstr "Sent" msgid "Afgewezen" msgstr "Declined" -msgid "Verlopen" -msgstr "Expired" - msgid "Geaccepteerd, afgewezen of verlopen" msgstr "Accepted, declined or expired" @@ -5210,15 +5204,15 @@ msgstr "Category" msgid "Alle categorieën" msgstr "All categories" +msgid "Leverancier" +msgstr "Supplier" + msgid "Alleen uitgaven om na te kijken." msgstr "Only expenses to check." msgid "Alle uitgaven" msgstr "All expenses" -msgid "Leverancier" -msgstr "Supplier" - msgid "Met bonnetje" msgstr "With receipt" @@ -6802,6 +6796,15 @@ msgstr "" "If you have a Raspberry Pi, a NAS, your own server or a VPS, you can also " "run Huismus in Docker. That is for people who are handy with that." +#, python-format +#~ msgid "Je hebt nog %(count)s concept:" +#~ msgid_plural "Je hebt nog %(count)s concepten, waaronder:" +#~ msgstr[0] "You still have %(count)s draft:" +#~ msgstr[1] "You still have %(count)s drafts, including:" + +#~ msgid "geldigheid voorbij" +#~ msgstr "no longer valid" + #, python-format #~ msgid "%(count)s dag te laat" #~ msgid_plural "%(count)s dagen te laat" diff --git a/huismus/locale/nl/LC_MESSAGES/django.po b/huismus/locale/nl/LC_MESSAGES/django.po index a3d8495..100df9f 100644 --- a/huismus/locale/nl/LC_MESSAGES/django.po +++ b/huismus/locale/nl/LC_MESSAGES/django.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: huismus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 19:01+0100\n" +"POT-Creation-Date: 2026-11-16 20:47+0100\n" "PO-Revision-Date: 2026-09-25 08:36+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -2871,7 +2871,7 @@ msgstr "" msgid "Weer leegmaken" msgstr "" -msgid "Facturen en uitgaven voor zzp'ers, met of zonder KOR" +msgid "Lokale boekhouding voor zzp'ers" msgstr "" msgid "Sneltoetsen:" @@ -3619,7 +3619,7 @@ msgstr "" msgid "Zoek op naam, klantnummer of plaats" msgstr "" -msgid "Zoeken" +msgid "Sorteren" msgstr "" msgid "Naam" @@ -3628,6 +3628,9 @@ msgstr "" msgid "Plaats" msgstr "" +msgid "Zoeken" +msgstr "" + msgid "Actie" msgstr "" @@ -3676,6 +3679,12 @@ msgstr "" msgid "Naar Back-ups" msgstr "" +msgid "Verder werken" +msgstr "" + +msgid "zonder klant" +msgstr "" + msgid "Hoe gebruik je Huismus?" msgstr "" @@ -3728,6 +3737,30 @@ msgstr "" msgid "Sluiten" msgstr "" +msgid "verloopt vandaag" +msgstr "" + +#, python-format +msgid "verloopt over %(days)s dag" +msgid_plural "verloopt over %(days)s dagen" +msgstr[0] "" +msgstr[1] "" + +msgid "Verlopen" +msgstr "" + +#, python-format +msgid "geldig tot %(date)s" +msgstr "" + +msgid "" +"Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als " +"verlopen markeren." +msgstr "" + +msgid "Geen offertes die op antwoord wachten." +msgstr "" + msgid "Uitleg bij de versie van Huismus die je nu gebruikt." msgstr "" @@ -3809,18 +3842,6 @@ msgstr "" msgid "Bekijken" msgstr "" -#, python-format -msgid "Je hebt nog %(count)s concept:" -msgid_plural "Je hebt nog %(count)s concepten, waaronder:" -msgstr[0] "" -msgstr[1] "" - -msgid "zonder klant" -msgstr "" - -msgid "Verder werken" -msgstr "" - #, python-format msgid "waarvan %(count)s te laat" msgid_plural "waarvan %(count)s te laat" @@ -3856,37 +3877,13 @@ msgstr "" msgid "Nummer" msgstr "" -msgid "Bedrag" -msgstr "" - msgid "Status" msgstr "" -msgid "Je hebt nog geen facturen uitgegeven." -msgstr "" - -msgid "verloopt vandaag" -msgstr "" - -#, python-format -msgid "verloopt over %(days)s dag" -msgid_plural "verloopt over %(days)s dagen" -msgstr[0] "" -msgstr[1] "" - -msgid "geldigheid voorbij" -msgstr "" - -#, python-format -msgid "geldig tot %(date)s" -msgstr "" - -msgid "" -"Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als " -"verlopen markeren." +msgid "Bedrag" msgstr "" -msgid "Geen offertes die op antwoord wachten." +msgid "Je hebt nog geen facturen uitgegeven." msgstr "" msgid "Nog geen facturen" @@ -4140,9 +4137,6 @@ msgstr "" msgid "Afgewezen" msgstr "" -msgid "Verlopen" -msgstr "" - msgid "Geaccepteerd, afgewezen of verlopen" msgstr "" @@ -4867,13 +4861,13 @@ msgstr "" msgid "Alle categorieën" msgstr "" -msgid "Alleen uitgaven om na te kijken." +msgid "Leverancier" msgstr "" -msgid "Alle uitgaven" +msgid "Alleen uitgaven om na te kijken." msgstr "" -msgid "Leverancier" +msgid "Alle uitgaven" msgstr "" msgid "Met bonnetje" diff --git a/huismus/templates/base.html b/huismus/templates/base.html index 1343330..072722c 100644 --- a/huismus/templates/base.html +++ b/huismus/templates/base.html @@ -11,9 +11,9 @@ {% if theme == "light" %} - {% elif theme == "dark" %} + {% elif theme == "dark" %} {% else %} - + {% endif %} @@ -31,7 +31,7 @@
{% if user.is_authenticated and not desktop %} diff --git a/huismus/templates/contacts/list.html b/huismus/templates/contacts/list.html index 75a7881..75ea5eb 100644 --- a/huismus/templates/contacts/list.html +++ b/huismus/templates/contacts/list.html @@ -30,13 +30,14 @@

{% translate "Nog geen klanten" %}

{% else %} -
+
@@ -53,9 +57,9 @@

{% translate "Nog geen klanten" %}

- - - + {% include "core/_sort_th.html" with col=sort.naam label=_("Naam") %} + {% include "core/_sort_th.html" with col=sort.klantnummer label=_("Klantnummer") %} + {% include "core/_sort_th.html" with col=sort.plaats label=_("Plaats") %} diff --git a/huismus/templates/core/_drafts_card.html b/huismus/templates/core/_drafts_card.html new file mode 100644 index 0000000..7dec044 --- /dev/null +++ b/huismus/templates/core/_drafts_card.html @@ -0,0 +1,14 @@ +{% load i18n money documents_tags %}{% comment %}Wants `drafts`: the draft invoices. Work to go on with, so it sits beside the lists and not among the warnings above the figures (design review, 2026-11-16). At most five; the rest is in Facturen.{% endcomment %} +
+

{% translate "Verder werken" %}

{% translate "Concepten" %}
+ +
diff --git a/huismus/templates/core/_sort_item.html b/huismus/templates/core/_sort_item.html new file mode 100644 index 0000000..67f23b7 --- /dev/null +++ b/huismus/templates/core/_sort_item.html @@ -0,0 +1 @@ +{% comment %}One column in the phone's "Sorteren" menu: the same link as the column heading (core/_sort_th.html), which a stacked list doesn't show.{% endcomment %}{{ label }} diff --git a/huismus/templates/core/_sort_th.html b/huismus/templates/core/_sort_th.html new file mode 100644 index 0000000..0469403 --- /dev/null +++ b/huismus/templates/core/_sort_th.html @@ -0,0 +1 @@ +{% comment %}A column heading that sorts the list (huismus/core/sorting.py). Wants `col` (the column's entry in `sort`) and `label`; `cls` for the th's classes. A plain link: it works without JS.{% endcomment %}{{ label }} diff --git a/huismus/templates/core/_waiting_quotes.html b/huismus/templates/core/_waiting_quotes.html new file mode 100644 index 0000000..6232039 --- /dev/null +++ b/huismus/templates/core/_waiting_quotes.html @@ -0,0 +1,19 @@ +{% load i18n money documents_tags %}{% comment %}Wants `waiting_quotes`: (quote, hint) pairs of sent quotes without an answer. One row per quote, like a stacked table row: who and how much on the first line, number and status below, amounts and status right-aligned.{% endcomment %} +
+

{% translate "Wachten op antwoord" %}

{% translate "Offertes" %}
+ {% if waiting_quotes %} +
    + {% for quote, hint in waiting_quotes %} +
  • + {{ quote|contact_name }} + {{ quote.total_cents|money }} + {{ quote.number }} + {% if hint.0 == "soon" %}{% if hint.1 == 0 %}{% translate "verloopt vandaag" %}{% else %}{% blocktranslate count days=hint.1 %}verloopt over {{ days }} dag{% plural %}verloopt over {{ days }} dagen{% endblocktranslate %}{% endif %}{% elif hint.0 == "past" %}{% translate "Verlopen" %}{% elif quote.expiry_date %}{% blocktranslate with date=quote.expiry_date|date:"SHORT_DATE_FORMAT" %}geldig tot {{ date }}{% endblocktranslate %}{% endif %} +
  • + {% endfor %} +
+
{% translate "Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als verlopen markeren." %}
+ {% else %} +
{% translate "Geen offertes die op antwoord wachten." %}
+ {% endif %} +
diff --git a/huismus/templates/core/home.html b/huismus/templates/core/home.html index 9a266cb..3aacc44 100644 --- a/huismus/templates/core/home.html +++ b/huismus/templates/core/home.html @@ -51,6 +51,8 @@

{{ greeting }}{% if user.first_name %}, {{ user.first_name }}{% endif %}

{% comment %}The notices come before the figures: on a phone the three figures stack and would push them out of sight (BUGS-BY-HAND.md).{% endcomment %} +{% comment %}Only warnings look like a warning: a slim tinted strip. News (bijgewerkt, nieuwe versie, bonnetjes) is a quiet line, and drafts are work, in their own card below the figures (design review, 2026-11-16).{% endcomment %} + {% if has_invoices %}
@@ -131,15 +124,15 @@

{{ greeting }}{% if user.first_name %}, {{ user.first_name }}{% endif %}

{% translate "Laatste facturen" %}

{% translate "Alle facturen" %}
{% if latest_invoices %}
-
{% translate "Naam" %}{% translate "Klantnummer" %}{% translate "Plaats" %}{% translate "Actie" %}
- +
{% translate "Nummer" %}{% translate "Klant" %}{% translate "Bedrag" %}{% translate "Status" %}
+ {% for invoice in latest_invoices %} - - - + + + {% endfor %} @@ -149,25 +142,10 @@

{{ greeting }}{% if user.first_name %}, {{ user.first_name }}{% endif %}

{% translate "Je hebt nog geen facturen uitgegeven." %} {% endif %} -
-

{% translate "Wachten op antwoord" %}

{% translate "Offertes" %}
- {% if waiting_quotes %} -
    - {% for quote, hint in waiting_quotes %} -
  • -
    - {{ quote|contact_name }} -
    {{ quote.number }}{% if hint.0 == "soon" %} · {% if hint.1 == 0 %}{% translate "verloopt vandaag" %}{% else %}{% blocktranslate count days=hint.1 %}verloopt over {{ days }} dag{% plural %}verloopt over {{ days }} dagen{% endblocktranslate %}{% endif %}{% elif hint.0 == "past" %} · {% translate "geldigheid voorbij" %}{% elif quote.expiry_date %} · {% blocktranslate with date=quote.expiry_date|date:"SHORT_DATE_FORMAT" %}geldig tot {{ date }}{% endblocktranslate %}{% endif %}
    -
    - {{ quote.total_cents|money }} -
  • - {% endfor %} -
-
{% translate "Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als verlopen markeren." %}
- {% else %} -
{% translate "Geen offertes die op antwoord wachten." %}
- {% endif %} -
+
+ {% if drafts %}{% include "core/_drafts_card.html" %}{% endif %} + {% include "core/_waiting_quotes.html" %} +
{% else %}
@@ -187,26 +165,9 @@

{% translate "Nog geen facturen" %}

{% translate "Naar je uitgaven" %} → +{% if drafts %}
{% include "core/_drafts_card.html" %}
{% endif %} {% if waiting_quotes %} -
-

{% translate "Wachten op antwoord" %}

{% translate "Offertes" %}
- {% if waiting_quotes %} -
    - {% for quote, hint in waiting_quotes %} -
  • -
    - {{ quote|contact_name }} -
    {{ quote.number }}{% if hint.0 == "soon" %} · {% if hint.1 == 0 %}{% translate "verloopt vandaag" %}{% else %}{% blocktranslate count days=hint.1 %}verloopt over {{ days }} dag{% plural %}verloopt over {{ days }} dagen{% endblocktranslate %}{% endif %}{% elif hint.0 == "past" %} · {% translate "geldigheid voorbij" %}{% elif quote.expiry_date %} · {% blocktranslate with date=quote.expiry_date|date:"SHORT_DATE_FORMAT" %}geldig tot {{ date }}{% endblocktranslate %}{% endif %}
    -
    - {{ quote.total_cents|money }} -
  • - {% endfor %} -
-
{% translate "Verzonden offertes zonder antwoord. Na de geldigheidsdatum kun je ze als verlopen markeren." %}
- {% else %} -
{% translate "Geen offertes die op antwoord wachten." %}
- {% endif %} -
+ {% include "core/_waiting_quotes.html" %} {% endif %} {% endif %} {% if last_backup %} diff --git a/huismus/templates/core/offline.html b/huismus/templates/core/offline.html index c4a85de..c942870 100644 --- a/huismus/templates/core/offline.html +++ b/huismus/templates/core/offline.html @@ -15,20 +15,20 @@ body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; font: 16px/1.5 system-ui, sans-serif; text-align: center; - background: light-dark(#F1ECFD, #0F0B1E); color: light-dark(#1A1530, #F0EDFA); + background: light-dark(#FBF8F3, #191613); color: light-dark(#2A2520, #F2ECE4); } main { max-width: 26rem; } h1 { font-size: 1.375rem; margin: 16px 0 8px; } p { margin: 0 0 24px; opacity: .8; } a { display: inline-block; padding: 10px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; - background: light-dark(#6B3FD9, #A98BF5); color: light-dark(#FFFFFF, #160A38); + background: light-dark(#0D6B6E, #5FC9C4); color: light-dark(#FFFFFF, #0A1F1F); }
- +

{% translate "Huismus is niet bereikbaar" %}

{% translate "Dit apparaat krijgt geen verbinding met Huismus. Controleer je wifi of VPN en probeer het opnieuw." %}

{% translate "Opnieuw proberen" %} diff --git a/huismus/templates/documents/_pill_overdue.html b/huismus/templates/documents/_pill_overdue.html index 3029240..e957cab 100644 --- a/huismus/templates/documents/_pill_overdue.html +++ b/huismus/templates/documents/_pill_overdue.html @@ -1,2 +1,2 @@ {% load i18n %}{% comment %}Wants `doc`. Include it only inside {% if doc.is_overdue %}: for any other document the count is 0. -In a list the pill always says "Te laat", one width, with how late beside it in quiet text: the days, or from 100 days the due date (huismus-intern/besluiten.md, 2026-11-15). On the invoice itself (`full=True`) it says how many days.{% endcomment %}{% if full %}{% blocktranslate count days=doc.days_overdue %}{{ days }} dag te laat{% plural %}{{ days }} dagen te laat{% endblocktranslate %}: {% translate "Vervaldatum voorbij en nog niet volledig betaald." %}{% else %}{% translate "Te laat" %}: {% translate "Vervaldatum voorbij en nog niet volledig betaald." %} {% if doc.days_overdue >= 100 %}{% blocktranslate with date=doc.due_date|date:"j M Y" %}sinds {{ date }}{% endblocktranslate %}{% else %}{% blocktranslate count days=doc.days_overdue %}{{ days }} dag{% plural %}{{ days }} dagen{% endblocktranslate %}{% endif %}{% endif %} +In a list the pill always says "Te laat", one width, with how late beside it in quiet text: the days, or from 100 days the due date (huismus-intern/besluiten.md, 2026-11-15). On the invoice itself (`full=True`) it says how many days.{% endcomment %}{% if full %}{% blocktranslate count days=doc.days_overdue %}{{ days }} dag te laat{% plural %}{{ days }} dagen te laat{% endblocktranslate %}: {% translate "Vervaldatum voorbij en nog niet volledig betaald." %}{% else %}{% translate "Te laat" %}: {% translate "Vervaldatum voorbij en nog niet volledig betaald." %} {% if doc.days_overdue >= 100 %}{% blocktranslate with date=doc.due_date|date:"SHORT_DATE_FORMAT" %}sinds {{ date }}{% endblocktranslate %}{% else %}{% blocktranslate count days=doc.days_overdue %}{{ days }} dag{% plural %}{{ days }} dagen{% endblocktranslate %}{% endif %}{% endif %} diff --git a/huismus/templates/documents/_quote_status.html b/huismus/templates/documents/_quote_status.html index 55adbf4..2fff30e 100644 --- a/huismus/templates/documents/_quote_status.html +++ b/huismus/templates/documents/_quote_status.html @@ -17,7 +17,7 @@ {% translate "Verzend de offerte om hem een nummer te geven. Daarna kun je hem mailen of de PDF downloaden." %} {% elif document.status == "sent" %} {% translate "Wacht op antwoord van de klant" %} - {% translate "Heb je antwoord? Leg het hier vast." %}{% if document.expiry_date %} {% blocktranslate with date=document.expiry_date|date:"SHORT_DATE_FORMAT" %}Geldig tot {{ date }}.{% endblocktranslate %}{% endif %} + {% translate "Heb je antwoord? Leg het hier vast." %}{% if document.expiry_date %} {% blocktranslate with date=document.expiry_date|date:"SHORT_DATE_FORMAT" %}Geldig tot {{ date }}.{% endblocktranslate %}{% endif %} {% elif document.status == "accepted" %} {% translate "Geaccepteerd door de klant" %} {% if converted_invoice %}{% translate "Er is al een factuur van gemaakt." %} {% translate "Naar de factuur" %}{% else %}{% translate "Zet de offerte om naar een factuur." %}{% endif %} diff --git a/huismus/templates/documents/list.html b/huismus/templates/documents/list.html index 7a0898b..dcce95e 100644 --- a/huismus/templates/documents/list.html +++ b/huismus/templates/documents/list.html @@ -3,7 +3,7 @@ {% block title %}{% translate "Facturen" %} — Huismus{% endblock %} -{% comment %}The page's own "Nieuwe factuur" is its violet button (the owner, 2026-11-15), so the panel's and the phone's + stay quiet here.{% endcomment %} +{% comment %}The page's own "Nieuwe factuur" is its petrol button (the owner, 2026-11-15), so the panel's and the phone's + stay quiet here.{% endcomment %} {% block main_attrs %} data-shortcut-new="{% url 'documents:create' %}"{% endblock %} {% block shortcut_search %}{% include "core/_shortcut_search.html" %}{% endblock %} @@ -31,7 +31,7 @@

{% translate "Nog geen facturen" %}

{% else %} -
+
{% translate "Klant" %}{% translate "Nummer" %}{% translate "Status" %}{% translate "Bedrag" %}
+
- - - - - + {% include "core/_sort_th.html" with col=sort.klant label=_("Klant") %} + {% include "core/_sort_th.html" with col=sort.nummer label=_("Nummer") %} + {% include "core/_sort_th.html" with col=sort.datum label=_("Datum") %} + {% include "core/_sort_th.html" with col=sort.status label=_("Status") %} + {% include "core/_sort_th.html" with col=sort.bedrag label=_("Bedrag") cls="r" %} @@ -80,7 +85,7 @@

{{ group_titles|get: {% if document.source %}{% translate "Geïmporteerd" %}{% endif %}

- +
{% translate "Klant" %}{% translate "Nummer" %}{% translate "Datum" %}{% translate "Status" %}{% translate "Bedrag" %}
{{ document.number }}{{ document.issue_date|date:"j M Y" }}{{ document.issue_date|date:"SHORT_DATE_FORMAT" }} {% if document.group == "concept" %}{% translate "Concept" %} {% elif document.group == "creditnotas" %}{% translate "Creditnota" %} diff --git a/huismus/templates/documents/quote_list.html b/huismus/templates/documents/quote_list.html index 8a932a2..397ccde 100644 --- a/huismus/templates/documents/quote_list.html +++ b/huismus/templates/documents/quote_list.html @@ -27,7 +27,7 @@

{% translate "Nog geen offertes" %}

{% else %} -
+