From a8b4c42e32b1d28e4c8fd56c4b06f214aa22c867 Mon Sep 17 00:00:00 2001 From: benjamyn Date: Wed, 22 Jan 2020 22:43:19 +1100 Subject: [PATCH] Moved parts of the html separate files --- shop.py | 1 - templates/addForm.html | 7 ++++++ templates/auth.html | 10 +-------- templates/header.html | 9 ++++++++ templates/index.html | 48 ++++-------------------------------------- templates/list.html | 25 ++++++++++++++++++++++ templates/mobile.html | 42 +++--------------------------------- 7 files changed, 49 insertions(+), 93 deletions(-) create mode 100644 templates/addForm.html create mode 100644 templates/header.html create mode 100644 templates/list.html diff --git a/shop.py b/shop.py index c9fbf5e..7dc7f06 100644 --- a/shop.py +++ b/shop.py @@ -67,7 +67,6 @@ def index(): @app.route('/post', methods=['POST']) def handle_data(): - pprint(request.form) if "addValue" in request.form: for x in request.form: # print(x) diff --git a/templates/addForm.html b/templates/addForm.html new file mode 100644 index 0000000..88097bf --- /dev/null +++ b/templates/addForm.html @@ -0,0 +1,7 @@ +
+ Name:
+
+ Item:
+

+ +
\ No newline at end of file diff --git a/templates/auth.html b/templates/auth.html index 3f75c0e..93307b5 100644 --- a/templates/auth.html +++ b/templates/auth.html @@ -1,12 +1,4 @@ - - - - Shopping List - - - - - + {% include "header.html" %}

{{ data["title"] }}

diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..db08c1f --- /dev/null +++ b/templates/header.html @@ -0,0 +1,9 @@ + + + + Shopping List + + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 2c3b0c9..4ba6f15 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,52 +1,12 @@ - - - - This is my site - - - - - +{% include "header.html" %}

{{ data["title"] }}

+ {% include "addForm.html" %} +
- - - - - - - - - {% for x in data["results"] %} - - - - - - - - {% endfor %} -
ItemRequesterGottem?Remove
{{x[1]}}{{x[4]}} {% if x[3] == 0 %} -
- {% else %} - yes - {% endif %}
- -
-
- + {% include "list.html" %}
- diff --git a/templates/list.html b/templates/list.html new file mode 100644 index 0000000..3ab6a88 --- /dev/null +++ b/templates/list.html @@ -0,0 +1,25 @@ + + + + + + + + +{% for x in data["results"] %} + + + + + + + +{% endfor %} +
ItemRequesterGottem?Remove
{{x[1]}}{{x[4]}} {% if x[3] == 0 %} +
+ {% else %} + yes + {% endif %}
+ +
+
\ No newline at end of file diff --git a/templates/mobile.html b/templates/mobile.html index 52dd24f..1afd8ce 100644 --- a/templates/mobile.html +++ b/templates/mobile.html @@ -1,47 +1,11 @@ - - - - Shopping List - - - - - +{% include "header.html" %}

{{ data["title"] }}

-
- Name:
- Item:

- -
+ {% include "addForm.html" %}
- - - - - - - - - {% for x in data["results"] %} - - - - - - - - {% endfor %} -
ItemRequesterGottem?Remove
{{x[1]}}{{x[4]}} {% if x[3] == 0 %} -
- {% else %} - yes - {% endif %}
- -
-
+ {% include "list.html" %}