diff options
author | Marius Peter <marius.peter@tutanota.com> | 2022-05-01 21:38:59 +0200 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2022-05-01 21:38:59 +0200 |
commit | caa0e1db19c0616031f7879d4298ed152b05f557 (patch) | |
tree | 927a70654c46c27cb9f313ac6020efa863b32035 /app/templates/add_product.html | |
parent | ce73f10a4aaa717de025fd2dc591294fea0db8de (diff) |
Jinja2 templates.
Diffstat (limited to 'app/templates/add_product.html')
-rw-r--r-- | app/templates/add_product.html | 44 |
1 files changed, 0 insertions, 44 deletions
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 #} - <p class="lead"><strong>{{ message }}</strong></p> - {# links #} - <p><a href="{{ url_for('add_product') }}" class="button">Submit another product.</a></p> -<p><a href="/fapg/home">Return to the index.</a></p> - -{% else %} - - {# the form is displayed when template opens via GET not POST #} - <p class="lead alert alert-primary">Add a new sock to our inventory.</p> -<p class="ml-4"><a href="/fapg/home" class="button">Return to the index.</a></p> -{# 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 %} - <div class="alert alert-danger alert-dismissible" role="alert"> - <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> - {{ err }} - </div> - {% endfor %} - {% endif %} -{% endwith %} -{# end of flash #} - -{# the form, thanks to WTForms #} -{{ wtf.quick_form(form) }} - -{% endif %} -{% endblock %} |