diff --git a/src/vinywaji/gui/templates/views/profile.html b/src/vinywaji/gui/templates/views/profile.html index 0709bf6..731ff63 100644 --- a/src/vinywaji/gui/templates/views/profile.html +++ b/src/vinywaji/gui/templates/views/profile.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load custom_filters %} {% load static %} {% block authorized-content %} @@ -19,6 +20,11 @@
Basic Information
Webhooks
+

+ You can add webhooks for defined transactions.
+ This gives you the ability to call them from custom clients e.g. in a smart home integration. +

+ {% include "components/forms/add_webhook.html" %}
@@ -54,12 +60,29 @@
Webhooks
- {{ webhook.amount }} - {{ webhook.transaction_description }} + + + {{ webhook.amount|toeuro }} € + + + + Description: {{ webhook.transaction_description }}
diff --git a/src/vinywaji/gui/templatetags/__init__.py b/src/vinywaji/gui/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/vinywaji/gui/templatetags/custom_filters.py b/src/vinywaji/gui/templatetags/custom_filters.py new file mode 100644 index 0000000..e639ca9 --- /dev/null +++ b/src/vinywaji/gui/templatetags/custom_filters.py @@ -0,0 +1,13 @@ +from django import template + +register = template.Library() + + +@register.filter +def toeuro(value): + try: + value = int(value) / 100 + return f"{value:.2f}" + except: + pass + return "" diff --git a/src/vinywaji/gui/views.py b/src/vinywaji/gui/views.py index 54e52b1..9828e19 100644 --- a/src/vinywaji/gui/views.py +++ b/src/vinywaji/gui/views.py @@ -54,7 +54,7 @@ def get(self, request: HttpRequest, trigger: str): webhook[0].trigger() return HttpResponse("OK", status=200) else: - return HttpResponse("Failed", status=404) + return HttpResponse("Webhook not found", status=404) def manifest(request):