From 57ff25198a82b3f6f413440e4005f0ade8dfb8d8 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 29 Jul 2021 18:04:48 +0200 Subject: app: render and serve proper web pages --- templates/wallet.html.jinja | 140 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 templates/wallet.html.jinja (limited to 'templates/wallet.html.jinja') diff --git a/templates/wallet.html.jinja b/templates/wallet.html.jinja new file mode 100644 index 0000000..86919e4 --- /dev/null +++ b/templates/wallet.html.jinja @@ -0,0 +1,140 @@ +{# + UGE / L2 / Intro to relational databases / Python project prototype + Author: Pacien TRAN-GIRARD + Licence: EUPL-1.2 +#} + +{% extends '_base.html.jinja' %} + +{% block title %}My wallet{% endblock %} + +{% macro format_operation(transaction) %} + {% if transaction.operation == 'transfer' %} + {% if transaction.amount > 0 %} + Transfer from {{ transaction.source }} + {% else %} + Transfer to {{ transaction.recipient }} + {% endif %} + {% else %} + {{ transaction.operation.capitalize() }} + {% endif %} +{% endmacro %} + +{% macro amount_class(transaction) %} + {{ 'amount-positive' if transaction.amount > 0 else 'amount-negative'}} +{% endmacro %} + +{% block content %} +
Date | +Operation | +Amount | +
---|---|---|
{{ transaction.datetime.strftime('%Y-%m-%d %H:%M:%S') }} | +{{ format_operation(transaction) }} | ++ {{ transaction.amount }} § + | +
No past transaction. | +