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/_base.html.jinja | 71 ++++++++++++++++++++ templates/_fragments.html.jinja | 34 ++++++++++ templates/homepage.html.jinja | 95 +++++++++++++++++++++++++++ templates/launder.html.jinja | 38 +++++++++++ templates/wallet.html.jinja | 140 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 378 insertions(+) create mode 100644 templates/_base.html.jinja create mode 100644 templates/_fragments.html.jinja create mode 100644 templates/homepage.html.jinja create mode 100644 templates/launder.html.jinja create mode 100644 templates/wallet.html.jinja (limited to 'templates') diff --git a/templates/_base.html.jinja b/templates/_base.html.jinja new file mode 100644 index 0000000..5649718 --- /dev/null +++ b/templates/_base.html.jinja @@ -0,0 +1,71 @@ +{# + UGE / L2 / Intro to relational databases / Python project prototype + Author: Pacien TRAN-GIRARD + Licence: EUPL-1.2 +#} + +{% import '_fragments.html.jinja' as fragments %} + + + + + + + + + + {% block headers %} + + + + + + {% block title %}{% endblock %} - PèPal + {% endblock %} + + + +
+
+
+ + + +
+
+ +
+ {% block flash_messages %} + {{ fragments.flash_messages(messages) }} + {% endblock %} +
+ +
+ {% block content %}{% endblock %} +
+ + +
+ + + diff --git a/templates/_fragments.html.jinja b/templates/_fragments.html.jinja new file mode 100644 index 0000000..e5b3175 --- /dev/null +++ b/templates/_fragments.html.jinja @@ -0,0 +1,34 @@ +{# + UGE / L2 / Intro to relational databases / Python project prototype + Author: Pacien TRAN-GIRARD + Licence: EUPL-1.2 +#} + + +{% macro logo() %} + +{% endmacro %} + + +{% macro user_header(user) %} + + 👤 {{ user.username }} + + + + 👛 {{ user.balance }} § + + +
+ +
+{% endmacro %} + + +{% macro flash_messages(messages) %} + {% for class, message in messages %} +
{{ message }}
+ {% endfor %} +{% endmacro %} diff --git a/templates/homepage.html.jinja b/templates/homepage.html.jinja new file mode 100644 index 0000000..39ed94f --- /dev/null +++ b/templates/homepage.html.jinja @@ -0,0 +1,95 @@ +{# + UGE / L2 / Intro to relational databases / Python project prototype + Author: Pacien TRAN-GIRARD + Licence: EUPL-1.2 +#} + +{% extends '_base.html.jinja' %} + +{% block title %}Homepage{% endblock %} + +{% block content %} +
+ +
+ +

Create a new account

+ +
+
+ + +
+
+ + +
+
+ + + +
+
+
+ +
+ +

Log in into your account

+ +
+
+ + +
+
+ +
+
+ +
+
+
+ +
+{% endblock %} diff --git a/templates/launder.html.jinja b/templates/launder.html.jinja new file mode 100644 index 0000000..4d4cda7 --- /dev/null +++ b/templates/launder.html.jinja @@ -0,0 +1,38 @@ +{# + UGE / L2 / Intro to relational databases / Python project prototype + Author: Pacien TRAN-GIRARD + Licence: EUPL-1.2 +#} + +{% extends '_base.html.jinja' %} + +{% block title %}Transfer in progress...{% endblock %} + +{% block headers %} + {{ super() }} + + + +{% endblock %} + +{# delay notifications to the next page #} +{% block flash_messages %}{% endblock %} + +{% block content %} +
+
+
+
+
+
+
+
+
+
+ +
+

Laundering in progress...

+

The financial cycle will be completed soon.

+
+
+{% endblock %} 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 %} +
+ +
+

Deposit

+
+
+ + +
+
+
+ +
+

Withdraw

+
+
+ + +
+
+
+ +
+

Transfer

+
+
+ + + +
+
+
+ +
+ +

Transaction history

+ + + + + + + + + + + {% for transaction in transactions %} + + + + + + {% else %} + + + + {% endfor %} + +
DateOperationAmount
{{ transaction.datetime.strftime('%Y-%m-%d %H:%M:%S') }}{{ format_operation(transaction) }} + {{ transaction.amount }} § +
No past transaction.
+{% endblock %} -- cgit v1.2.3