refactor: Style transaction items for untracked accounts

This commit extends the "Untrack Account" feature by applying a special style to transaction items that belong to an untracked account.

- The transaction item template is modified to apply a "dimmed" style to transactions from untracked accounts.
- The styling follows the precedence: Account (untracked) > Category (muted) > Transaction (hidden).
- The dropdown menu for transaction items now shows "Controlled by account" if the transaction's account is untracked.
This commit is contained in:
google-labs-jules[bot]
2025-08-09 05:47:18 +00:00
parent 9102654eab
commit 7f8261b9cc
9 changed files with 92 additions and 23 deletions
+20
View File
@@ -155,6 +155,26 @@ def account_delete(request, pk):
)
@only_htmx
@login_required
@require_http_methods(["POST"])
def account_toggle_untracked(request, pk):
account = get_object_or_404(Account, id=pk)
if account.is_untracked_by(request.user):
account.untracked_by.remove(request.user)
messages.success(request, _("Account is now tracked."))
else:
account.untracked_by.add(request.user)
messages.success(request, _("Account is now untracked."))
return HttpResponse(
status=204,
headers={
"HX-Trigger": "updated",
},
)
@only_htmx
@login_required
@require_http_methods(["GET"])