From 1dad22d3e45d6506c8624e3a7111240fcc4ab786 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 15 May 2022 13:16:37 +0200 Subject: Templates. --- app/templates/add-invoice.html | 48 ---------- app/templates/add-item.html | 20 ---- app/templates/base.html | 41 +++++++-- app/templates/errors/item-not-found.html | 2 +- app/templates/errors/table-not-found.html | 14 +++ app/templates/home.html | 26 ++++-- app/templates/modules-promo.html | 22 +++++ app/templates/modules/add-invoice.html | 48 ++++++++++ app/templates/modules/add-item.html | 19 ++++ app/templates/modules/customers.html | 18 +++- app/templates/modules/edit-item.html | 19 ++++ app/templates/modules/ferti.html | 99 ++++++++++++++++++++ app/templates/modules/invoice-preview.html | 108 ++++++++++++++++++++++ app/templates/modules/invoices.html | 96 +++++++++++++------ app/templates/modules/logger.html | 142 ----------------------------- app/templates/modules/login.html | 16 ++++ app/templates/modules/orders.html | 8 +- app/templates/modules/products.html | 18 ++-- app/templates/modules/register.html | 16 ++++ app/templates/modules/settings.html | 57 ++++++++++++ app/templates/preview-invoice.html | 106 --------------------- 21 files changed, 565 insertions(+), 378 deletions(-) delete mode 100644 app/templates/add-invoice.html delete mode 100644 app/templates/add-item.html create mode 100644 app/templates/errors/table-not-found.html create mode 100644 app/templates/modules-promo.html create mode 100644 app/templates/modules/add-invoice.html create mode 100644 app/templates/modules/add-item.html create mode 100644 app/templates/modules/edit-item.html create mode 100644 app/templates/modules/ferti.html create mode 100644 app/templates/modules/invoice-preview.html delete mode 100644 app/templates/modules/logger.html create mode 100644 app/templates/modules/login.html create mode 100644 app/templates/modules/register.html create mode 100644 app/templates/modules/settings.html delete mode 100644 app/templates/preview-invoice.html (limited to 'app') diff --git a/app/templates/add-invoice.html b/app/templates/add-invoice.html deleted file mode 100644 index 92748be..0000000 --- a/app/templates/add-invoice.html +++ /dev/null @@ -1,48 +0,0 @@ -{# -*- mode: web; -*- #} - -{% extends "base.html" %} - - -{% block title %}Add a new invoice{% endblock %} -{% block content %} - -{% if message %} -{# the form was submitted and message exists #} -

{{ item }}

-{# links #} -

Submit another {{ item }}

-

Return to the index

- -{% else %} -{# the form is displayed when template opens via GET not POST #} - -{# show flash - based on WTForms validators see -https://pythonprogramming.net/flash-flask-tutorial/ -get_flashed_messages() exists here because of flash() in the route -function #} - -{% with errors = get_flashed_messages() %} {% if errors %} -{% for err in errors %} - -{% endfor %} -{% endif %} -{% endwith %} -{# end of flash #} - - -{# the form #} -
-
- Add a new {{ item }} to our database. - {% for field in form %} - {{ field.label() }} - {{ field() }}
- {% endfor %} -
-
- -{% endif %} -{% endblock %} diff --git a/app/templates/add-item.html b/app/templates/add-item.html deleted file mode 100644 index acffa87..0000000 --- a/app/templates/add-item.html +++ /dev/null @@ -1,20 +0,0 @@ -{# -*- mode: web; -*- #} - -{% extends "base.html" %} - - -{% block title %}Add a new {{ item }}{% endblock %} -{% block content %} - -{# the form #} -
-
- Add a new {{ item }} to our database. - {% for field in form %} - {{ field.label() }} - {{ field() }}
- {% endfor %} -
-
- -{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index b5f507d..e847149 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -13,26 +13,51 @@ -