From caa0e1db19c0616031f7879d4298ed152b05f557 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 1 May 2022 21:38:59 +0200 Subject: Jinja2 templates. --- app/templates/add_product.html | 44 ------------------------------------------ 1 file changed, 44 deletions(-) delete mode 100644 app/templates/add_product.html (limited to 'app/templates/add_product.html') diff --git a/app/templates/add_product.html b/app/templates/add_product.html deleted file mode 100644 index ad7ea0a..0000000 --- a/app/templates/add_product.html +++ /dev/null @@ -1,44 +0,0 @@ -{# -*- mode: jinja2; -*- #} - -{% extends "base.html" %} -{% import "bootstrap/wtf.html" as wtf %} - -{% block content %} - - {% block title %}Add a New Product{% endblock %} - - {% if message %} - - {# the form was submitted and message exists #} -

{{ message }}

- {# links #} -

Submit another product.

-

Return to the index.

- -{% else %} - - {# the form is displayed when template opens via GET not POST #} -

Add a new sock to our inventory.

-

Return to the index.

-{# 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, thanks to WTForms #} -{{ wtf.quick_form(form) }} - -{% endif %} -{% endblock %} -- cgit v1.2.3