{# -*- 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 #} {% else %} {# the form is displayed when template opens via GET not POST #}Add a new sock to our inventory.
{# 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 %}