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
4 changes: 3 additions & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ Added 2026-10-21:
- the PDF button opens a page with the PDF, a way back to the document, and Download (named after the document's number, `<number>.pdf`, ready to attach to an e-mail); where the browser can share files there is also Share, and in the installed app only Share; for an imported invoice with an original PDF the page switches between the original and the regenerated one; the editor's preview PDF still opens in a new tab; in the installed app it opens over the editor, which keeps what was typed;
- on a phone every action stays reachable: the editor's secondary actions (delete, cancel, copy, PDF, preview PDF, mail) sit behind a "Meer" button in its action bar, the tab bar's + opens four choices (factuur, offerte, klant, uitgave), and with its "Meer" menu the tab bar offers everything else the sidebar does. `tests/e2e/test_every_page.py` checks both on every page.
Added with the layout of direction "Vandaag" (issue #186, 2026-11-15; product-owner agent, `huismus-intern/besluiten.md`):
- on a wide screen the menu is a deep violet panel: the sparrow, "Je krijgt nog" (what customers still owe, and how much of it is overdue; `core.dashboard.outstanding_invoices`, the overview's figure, nothing before the first issued invoice), a button "Nieuwe factuur" straight to a new invoice, then Overzicht, Facturen, Offertes, Uitgaven, Klanten, Rapporten, Importeren, Instellingen; Hulp and Uitloggen at the foot. Cards have no border and round corners on a lilac background, buttons are pills, the font is the rounded system font where there is one (no web font);
- on a wide screen the menu is a deep violet panel: the sparrow, a button "Nieuwe factuur" straight to a new invoice, then Overzicht, Facturen, Offertes, Uitgaven, Klanten, Rapporten, Importeren, Instellingen; Hulp and Uitloggen at the foot. What customers still owe is on the overview only, not in the panel;
- look ("Verfijnd", the owner, 2026-11-15): white cards with a thin border on an almost white background, buttons with slightly rounded corners, the amount Openstaand in the text colour; the rounded system font only for headings and big amounts, the plain system font for the rest (no web font);
- in a list an overdue invoice says "Te laat" in a pill of one width, with how late beside it in quiet text: the days, or from 100 days "sinds" the due date; the invoice itself says how many days;
- one violet button per screen: the panel's "Nieuwe factuur" and the phone's + only on the overview and the invoice list (not when they are empty); elsewhere the screen's own main action;
- the invoice list shows its rows in groups: Te laat, Wacht op betaling (with the days until due), Nog niet verstuurd, Betaald (fully credited ones too), Creditnota's; tabs, search, year and "Meer laden" stay. "Geïmporteerd" is quiet text, and only overdue has a colour;
- an overview without any invoice or credit note shows one card to make the first instead of the invoice figures;
Expand Down
26 changes: 20 additions & 6 deletions docs/design/componenten.html

Large diffs are not rendered by default.

59 changes: 53 additions & 6 deletions huismus/business/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def cards(settings: Settings, theme: str = "") -> list[dict]:
"""The overview: per topic its line and, where it says something, a pill
(its text and huismus.css class). theme: the signed-in user's, for the
card Weergave."""
ok, warn, off = "pill-on", "pill-unpaid", "pill-expired"
# Quiet text, never a coloured pill: a tick for on, grey for off, the
# warning sign where you have to do something (huismus-intern/besluiten.md,
# 2026-11-15). Only "te laat" has a colour.
ok, warn, off = "state-on", "state-attention", "state-off"
# A context of their own: "Aan" is also "To" (a mail's recipient).
on_text, off_text = pgettext_lazy("setting", "Aan"), pgettext_lazy("setting", "Uit")
summary = {}
Expand Down Expand Up @@ -190,7 +193,7 @@ def _backups_card(ok, off) -> dict:
if not status.folder and not cloud.service:
line, pill = _("Nog geen map gekozen"), (pgettext_lazy("setting", "Uit"), off)
elif status.failed or (cloud.service and cloud.failed):
line, pill = _("De laatste back-up is mislukt"), (_("Mislukt"), "pill-overdue")
line, pill = _("De laatste back-up is mislukt"), (_("Mislukt"), "state-attention")
else:
line = _("Laatste back-up: %(moment)s") % {"moment": moment(last)} if last else ""
pill = (pgettext_lazy("setting", "Aan"), ok)
Expand All @@ -211,7 +214,7 @@ def _receipts_folder_card(ok, off) -> dict:
if not inbox.is_on(status):
line, pill = _("Nog geen map gekozen"), (pgettext_lazy("setting", "Uit"), off)
elif status.failed:
line, pill = _("Ophalen is mislukt"), (_("Mislukt"), "pill-overdue")
line, pill = _("Ophalen is mislukt"), (_("Mislukt"), "state-attention")
else:
line, pill = inbox.place(status), (pgettext_lazy("setting", "Aan"), ok)
return {
Expand All @@ -228,9 +231,12 @@ def _receipt_reading_card(ok, off) -> dict:
"""Bonnetjes lezen (SPEC.md M20, part 3, expenses.reading_views): the
user's own AI service turns receipts into expenses to check."""
if not ai_service.is_on():
line, pill = _("Nog geen dienst gekozen"), (pgettext_lazy("setting", "Uit"), off)
# The overview shows no intro, so the line says what goes here: your
# own API key (BUGS-BY-HAND.md, 2026-11-07).
line = _("Nog geen AI-dienst met API-sleutel")
pill = (pgettext_lazy("setting", "Uit"), off)
elif reading.failure_sentence():
line, pill = _("Lezen is mislukt"), (_("Mislukt"), "pill-overdue")
line, pill = _("Lezen is mislukt"), (_("Mislukt"), "state-attention")
else:
line = _("Met %(service)s") % {"service": ai_service.name()}
pill = (pgettext_lazy("setting", "Aan"), ok)
Expand Down Expand Up @@ -267,7 +273,7 @@ def _assistants_card(ok, off) -> dict:
elif assistant_key.is_used():
line, pill = "", (_("Gekoppeld"), ok)
else:
line, pill = "", (_("Wacht op verbinding"), "pill-sent")
line, pill = "", (_("Wacht op verbinding"), "state-wait")
return {
"title": _("AI-assistenten"),
"intro": _("Laat een AI-assistent met je administratie werken."),
Expand Down Expand Up @@ -335,3 +341,44 @@ def _appearance_card(theme) -> dict:
"line": f"{language_name(get_language())} · {dict(THEME_CHOICES)[theme]}",
"pill": None,
}


# The overview's groups, in this order; within a group the cards keep the
# order of cards() (huismus-intern/besluiten.md, 2026-11-15).
GROUPS = (
(_("Bedrijf en facturen"), ("bedrijf", "kor", "facturen", "huisstijl", "mailen")),
(_("Bonnetjes"), ("bonnetjesmap", "bonnetjes-lezen")),
(_("Back-ups en export"), ("back-ups", "exporteren")),
(_("Huismus"), ("ai-assistenten", "updates", "wachtwoord", "weergave")),
)

# An icon per card, from huismus/templates/icons.svg.
ICONS = {
"bedrijf": "building",
"kor": "percent",
"facturen": "hash",
"huisstijl": "image",
"mailen": "mail",
"bonnetjesmap": "folder",
"bonnetjes-lezen": "sparkles",
"back-ups": "archive",
"exporteren": "download",
"ai-assistenten": "chat",
"updates": "refresh",
"wachtwoord": "lock",
"weergave": "sun",
}


def grouped(cards: list[dict]) -> list[tuple[str, list[dict]]]:
"""The cards in their groups, each with its icon; a group without a
card on this installation is left out."""
by_slug = {card["slug"]: {**card, "icon": ICONS[card["slug"]]} for card in cards}
result = []
for title, slugs in GROUPS:
members = [by_slug.pop(slug) for slug in slugs if slug in by_slug]
if members:
result.append((title, members))
if by_slug: # a card that has no group yet: last, never lost
result[-1][1].extend(by_slug.values())
return result
2 changes: 1 addition & 1 deletion huismus/business/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _mail_text_blocks(form):
@login_required
def overview(request):
cards = topics.cards(Settings.load(), theme=theme_of(request.user))
return render(request, "business/overview.html", {"cards": cards})
return render(request, "business/overview.html", {"groups": topics.grouped(cards)})


@login_required
Expand Down
1 change: 0 additions & 1 deletion huismus/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
"huismus.core.context_processors.desktop",
"huismus.core.context_processors.sample_data",
"huismus.core.context_processors.theme",
"huismus.core.context_processors.panel",
],
},
},
Expand Down
11 changes: 0 additions & 11 deletions huismus/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
and whether the desktop app signed the window in without a password."""

from django.conf import settings
from django.utils.functional import SimpleLazyObject

from huismus.core import auto_backups
from huismus.core.appearance import theme_of
from huismus.core.dashboard import outstanding_invoices
from huismus.core.desktop import has_no_password

# Expense routes that have their own item in the sidebar's sub-navigation.
Expand Down Expand Up @@ -60,12 +58,3 @@ def theme(request):
if user is None or not user.is_authenticated:
return {"theme": ""}
return {"theme": theme_of(user)}


def panel(request):
"""panel_outstanding: what the menu panel shows under "Je krijgt nog"
(huismus/core/dashboard.py). Lazy, so a response that doesn't draw the
menu (an HTMX fragment, a PDF) runs no query for it."""
if not getattr(request, "user", None) or not request.user.is_authenticated:
return {}
return {"panel_outstanding": SimpleLazyObject(outstanding_invoices)}
Loading
Loading