From 374ca77b2a7a093537515607d5f10226fef06e29 Mon Sep 17 00:00:00 2001 From: Dat Nguyen Date: Fri, 29 Nov 2019 21:59:28 -0600 Subject: some aesthetics --- Web/PI/Uploads/test.py | 17 ---------- Web/Server/Results/results.csv | 2 ++ Web/Server/Server.py | 2 +- Web/Server/static/Server.css | 24 ++++++++++++++ Web/Server/templates/base.html | 23 +++++++++++++ Web/Server/templates/index.html | 69 ++++++++++++++++----------------------- Web/Server/templates/results.html | 11 +++++++ 7 files changed, 90 insertions(+), 58 deletions(-) delete mode 100644 Web/PI/Uploads/test.py create mode 100644 Web/Server/Results/results.csv create mode 100644 Web/Server/templates/base.html create mode 100644 Web/Server/templates/results.html diff --git a/Web/PI/Uploads/test.py b/Web/PI/Uploads/test.py deleted file mode 100644 index 5091e89..0000000 --- a/Web/PI/Uploads/test.py +++ /dev/null @@ -1,17 +0,0 @@ -import time, os, sys -from datetime import datetime - -file_name = os.path.basename(sys.argv[0]) - -file_name = file_name.split(".")[0] - -now = datetime.now() -current_time = now.strftime("%H:%M:%S") -print("Current Time = " + current_time) - -f = open("Results/" + file_name + "_results", "w+") -f.write("THIS IS RESULTS TEXT\n") -f.write("Current Time = " + current_time) -f.close() -print("Running test.py for ~ 5 seconds.") -time.sleep(5) diff --git a/Web/Server/Results/results.csv b/Web/Server/Results/results.csv new file mode 100644 index 0000000..a16431a --- /dev/null +++ b/Web/Server/Results/results.csv @@ -0,0 +1,2 @@ +THIS IS RESULTS TEXT +Current Time = 21:17:28 \ No newline at end of file diff --git a/Web/Server/Server.py b/Web/Server/Server.py index a936b96..3a4f351 100644 --- a/Web/Server/Server.py +++ b/Web/Server/Server.py @@ -59,7 +59,7 @@ def upload_file(): results.write(results_content) results.close() - return render_template('index.html', results = 'True') + return render_template('results.html') else: flash('Allowed file types are .py') return redirect(request.url) diff --git a/Web/Server/static/Server.css b/Web/Server/static/Server.css index e69de29..6f366ec 100644 --- a/Web/Server/static/Server.css +++ b/Web/Server/static/Server.css @@ -0,0 +1,24 @@ +.container{ + color: white; + background-color: maroon; + border-style: solid; + border: 1px solid black; + text-align: center; + margin:5px; +} + +#title{ + font-size: xx-large; +} + +#subtitle{ + font-size: large; +} + +#choose_file{ + +} + +#submit{ + +} \ No newline at end of file diff --git a/Web/Server/templates/base.html b/Web/Server/templates/base.html new file mode 100644 index 0000000..a141c0a --- /dev/null +++ b/Web/Server/templates/base.html @@ -0,0 +1,23 @@ + + + + + + + ANDI'S PIE + + +
+ {% block content %} + default content + {% endblock %} +
+ + \ No newline at end of file diff --git a/Web/Server/templates/index.html b/Web/Server/templates/index.html index 70a282b..1350fdd 100644 --- a/Web/Server/templates/index.html +++ b/Web/Server/templates/index.html @@ -1,43 +1,32 @@ - - - - - - - ANDI'S PIE -
-

Select a file to upload

-

- {% with messages = get_flashed_messages() %} - {% if messages %} -

- {% endif %} - {% endwith %} -

- -
-
-

- -

-
+{% extends "base.html" %} + +{% block content %} +
+

Select a file to upload

+

+ {% with messages = get_flashed_messages() %} + {% if messages %} +

    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+ {% endif %} + {% endwith %} +

+ + +

- +

- -
- -
- - {% if results %} -
- -
- {% endif %} + +

+ +

+ +
+ +
- - \ No newline at end of file +{% endblock %} diff --git a/Web/Server/templates/results.html b/Web/Server/templates/results.html new file mode 100644 index 0000000..5714f96 --- /dev/null +++ b/Web/Server/templates/results.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} +
+ +
+ +
+ +
+{% endblock %} \ No newline at end of file -- cgit v1.2.3