From 9770cf8345d47cb086bd386c0d5c0fca165a6d11 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Fri, 22 Apr 2022 13:24:41 +0200 Subject: First commit! :fire: --- app/templates/add_product.html | 44 ++++++++++++++++++++++++++++++ app/templates/base.html | 30 ++++++++++++++++++++ app/templates/errors/module-not-found.html | 14 ++++++++++ app/templates/home.html | 22 +++++++++++++++ app/templates/modules/calculator.html | 8 ++++++ app/templates/modules/catalog.html | 35 ++++++++++++++++++++++++ app/templates/modules/creator.html | 8 ++++++ app/templates/modules/logger.html | 8 ++++++ app/templates/modules/stock.html | 8 ++++++ 9 files changed, 177 insertions(+) create mode 100644 app/templates/add_product.html create mode 100644 app/templates/base.html create mode 100644 app/templates/errors/module-not-found.html create mode 100644 app/templates/home.html create mode 100644 app/templates/modules/calculator.html create mode 100644 app/templates/modules/catalog.html create mode 100644 app/templates/modules/creator.html create mode 100644 app/templates/modules/logger.html create mode 100644 app/templates/modules/stock.html (limited to 'app/templates') diff --git a/app/templates/add_product.html b/app/templates/add_product.html new file mode 100644 index 0000000..ad7ea0a --- /dev/null +++ b/app/templates/add_product.html @@ -0,0 +1,44 @@ +{# -*- 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 %} diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..0b53b5c --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,30 @@ +{# -*- mode: jinja2; -*- #} + + + + + + + + Farm Manager + + + + + + + +
+ {% block content %}{% endblock %} +
+ + + diff --git a/app/templates/errors/module-not-found.html b/app/templates/errors/module-not-found.html new file mode 100644 index 0000000..6496503 --- /dev/null +++ b/app/templates/errors/module-not-found.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %} +Module not found +{% endblock %} + +{% block content %} +

+ No module found with name {{ module }}. +

+

+ If you'd like to suggest a module, please send us an e-mail +

+{% endblock %} diff --git a/app/templates/home.html b/app/templates/home.html new file mode 100644 index 0000000..a9bac51 --- /dev/null +++ b/app/templates/home.html @@ -0,0 +1,22 @@ + + +{% extends "base.html" %} + +{% block title %} + Welcome, {{ user.name_first }}! +{% endblock %} + + +{% block content %} + +

You are logged in as {{ user }} on + project {{ project }}.

+ +

Available modules

+
+ {% for module in modules %} +
{{ module.name }}
{{ module.description }}
+ {% endfor %} +
+ +{% endblock %} diff --git a/app/templates/modules/calculator.html b/app/templates/modules/calculator.html new file mode 100644 index 0000000..f951a17 --- /dev/null +++ b/app/templates/modules/calculator.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %} +Calculator +{% endblock %} + +{% block content %} +insert module content here. +{% endblock %} diff --git a/app/templates/modules/catalog.html b/app/templates/modules/catalog.html new file mode 100644 index 0000000..857c654 --- /dev/null +++ b/app/templates/modules/catalog.html @@ -0,0 +1,35 @@ + + +{% extends "base.html" %} +{% block title %} + Catalog +{% endblock %} + +{% block content %} + insert module content here. + +

+ Add product to your catalog +

+ + + + + + + + + + + + {% for product in catalog %} + + + + + + + {% endfor %} + +
NamePriceSupplierUpdated
{{ product.name }}{{ product.price }}{{ product.supplier }}{{ product.updated }}
+{% endblock %} diff --git a/app/templates/modules/creator.html b/app/templates/modules/creator.html new file mode 100644 index 0000000..588f428 --- /dev/null +++ b/app/templates/modules/creator.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %} +Creator +{% endblock %} + +{% block content %} +insert module content here. +{% endblock %} diff --git a/app/templates/modules/logger.html b/app/templates/modules/logger.html new file mode 100644 index 0000000..7ba93b3 --- /dev/null +++ b/app/templates/modules/logger.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %} +Logger +{% endblock %} + +{% block content %} +insert module content here. +{% endblock %} diff --git a/app/templates/modules/stock.html b/app/templates/modules/stock.html new file mode 100644 index 0000000..5d20d5c --- /dev/null +++ b/app/templates/modules/stock.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %} +Stock +{% endblock %} + +{% block content %} +insert module content here. +{% endblock %} -- cgit v1.2.3