From 741979aee5edddba3b021945f2afd36e67c9f5b0 Mon Sep 17 00:00:00 2001 From: null Date: Mon, 26 Feb 2024 12:50:46 +0100 Subject: [PATCH] refactor --- app.py | 7 ++- docker-compose.yaml | 12 ++++ static/css/styles.css | 9 ++- static/js/main.js | 0 templates/index copy.html | 126 ++++++++++++++++++++++++++++++++++++++ templates/index.html | 126 +++++++++----------------------------- 6 files changed, 178 insertions(+), 102 deletions(-) create mode 100644 docker-compose.yaml create mode 100644 static/js/main.js create mode 100644 templates/index copy.html diff --git a/app.py b/app.py index 815b88c..09ff66c 100644 --- a/app.py +++ b/app.py @@ -18,8 +18,13 @@ create_conditions_routes(app, r, conn) def index(): cursor = r.table("conditions").run(conn) conditions = list(cursor) + conditionModel = { + "id": "string", + "itemDescription": "string", + "itemName": "string" + } - return render_template('index.html', data={"conditions": conditions}) + return render_template('index.html', data={"conditions": { "data": conditions, "model": conditionModel }}) if __name__ == '__main__': app.run(host='0.0.0.0', port=8080, debug=True) diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4eafd23 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '3.8' + +services: + finfree-be: + image: finfree-be + volumes: + - .:/usr/src/app + ports: + - "8080:8080" + environment: + - RETHINKDB_URL=192.168.90.11 + - RETHINKDB_PORT=40002 diff --git a/static/css/styles.css b/static/css/styles.css index 02ee867..875f641 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -26,18 +26,17 @@ table { margin-top: 20px; } -table, th, td { border: 1px solid #ddd; -} - -th, -td { padding: 12px; text-align: left; } +tfoot td { + border: none; +} + button { background-color: #4CAF50; color: white; diff --git a/static/js/main.js b/static/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/templates/index copy.html b/templates/index copy.html new file mode 100644 index 0000000..6ed08e0 --- /dev/null +++ b/templates/index copy.html @@ -0,0 +1,126 @@ + + + + + + + Trading Zone Website + + + + + + +
+

Conditions

+ + + + + + + + + + + + + + + + +
IDNameDescription
+ +
+
+ + + + +
+
+
+
+

+ + +
+
+ + + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index fa3b866..df3e713 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,115 +6,49 @@ Trading Zone Website + - -

Conditions

- - + +
+
+
+
+

+ + + + +
+
- - - + {% for key, items in data.conditions.model.items() %} + + {% endfor %} - + {% for item in data.conditions.data %} + + {% for key, value in item.items() %} + + {% endfor %} + + {% endfor %} + + + + +
IDNameDescription{{ key }}
{{ value }}
+ +
- - - - -
-
-
-
-

- - -
-
- - - \ No newline at end of file