From b81e8026cc0683bc66dc56d82cb88085224d0d74 Mon Sep 17 00:00:00 2001 From: Dat Nguyen Date: Mon, 2 Dec 2019 11:58:10 -0600 Subject: final styling? --- Web/Server/Results/results.csv | 2 +- Web/Server/Server.py | 15 ++++++++------- Web/Server/static/Server.css | 22 ++++++++++++++++------ Web/Server/static/Server.js | 4 ++-- Web/Server/templates/base.html | 5 +---- Web/Server/templates/index.html | 16 +++++----------- Web/Server/templates/results.html | 4 +++- 7 files changed, 36 insertions(+), 32 deletions(-) diff --git a/Web/Server/Results/results.csv b/Web/Server/Results/results.csv index a16431a..82b0137 100644 --- a/Web/Server/Results/results.csv +++ b/Web/Server/Results/results.csv @@ -1,2 +1,2 @@ THIS IS RESULTS TEXT -Current Time = 21:17:28 \ No newline at end of file +Current Time = 10:55:30 \ No newline at end of file diff --git a/Web/Server/Server.py b/Web/Server/Server.py index 3a4f351..6070406 100644 --- a/Web/Server/Server.py +++ b/Web/Server/Server.py @@ -33,20 +33,20 @@ def upload_file(): if request.method == 'POST': # Check if the post request has the file part if 'file' not in request.files: - flash('No file part') - return redirect(request.url) + print("hi") + return render_template('index.html', error = 'No file part') # Grab the file file = request.files['file'] if file.filename == '': - flash('No file selected for uploading') - return redirect(request.url) + print("hi") + return render_template('index.html', error = 'No file selected for uploading') # Send the file content as a post to the PI if file and allowed_file(file.filename): dictToSend = {'filename':file.filename, 'file_content':file.read()} - file.close + file.close() print('Running test') response = requests.post(PI_URL + '/tests/endpoint', json=dictToSend) @@ -61,8 +61,9 @@ def upload_file(): return render_template('results.html') else: - flash('Allowed file types are .py') - return redirect(request.url) + print("hi") + return render_template('index.html', error = 'Allowed file types are .py') + return render_template('index.html', error = 'No file selected') @app.route('/results', methods=['GET']) def download(): diff --git a/Web/Server/static/Server.css b/Web/Server/static/Server.css index 78e53c7..10d8b23 100644 --- a/Web/Server/static/Server.css +++ b/Web/Server/static/Server.css @@ -2,15 +2,16 @@ color: white; background-color: maroon; border-style: solid; - border: 1px solid black; + border: 1px solid #d5d6d2; text-align: center; margin:5px; } .button { background-color: gold; - border: none; - color: white; + border: solid; + border-color:#d5d6d2; + color: black; padding: 15px 32px; text-align: center; text-decoration: none; @@ -20,11 +21,9 @@ .button:hover{ background-color: white; - color: gold; cursor: pointer; } - a{ color:white; text-decoration:none; @@ -33,6 +32,15 @@ a:hover{ text-decoration:underline } +#main{ + color: black; + background-color: #d5d6d2; + border-style: solid; + border: 1px solid #d5d6d2; + text-align: center; + margin:5px; +} + #about{ display: none; } @@ -46,7 +54,9 @@ a:hover{ } #choose_file{ - + border: none; + text-decoration: none; + display: inline-block; } #submit{ diff --git a/Web/Server/static/Server.js b/Web/Server/static/Server.js index 129951b..6c2be18 100644 --- a/Web/Server/static/Server.js +++ b/Web/Server/static/Server.js @@ -1,6 +1,6 @@ function showLoad(){ - var paragraph = document.getElementById("message"); - var text = document.createTextNode("RUNNING TEST"); + var paragraph = document.getElementById("running"); + var text = document.createTextNode("Running Test, Please wait for Results"); paragraph.appendChild(text); var div = document.getElementById("upload"); diff --git a/Web/Server/templates/base.html b/Web/Server/templates/base.html index e253819..a1bc09b 100644 --- a/Web/Server/templates/base.html +++ b/Web/Server/templates/base.html @@ -10,9 +10,6 @@ -
-
-

By Alin Butoi, Paul D’Amico, Dat Nguyen, Ross Olson, Rachel Schow
@@ -42,7 +39,7 @@
-
+
{% block content %} default content {% endblock %} diff --git a/Web/Server/templates/index.html b/Web/Server/templates/index.html index 730d6c5..6f7e738 100644 --- a/Web/Server/templates/index.html +++ b/Web/Server/templates/index.html @@ -2,17 +2,11 @@ {% block content %}
-

Upload a python file onto the Inverted Pendulum

+

Upload a python file onto the inverted pendulum

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

    - {% for message in messages %} -
  • {{ message }}
  • - {% endfor %} -
+ {% if error %} +

{{ error }}

{% endif %} - {% endwith %}

@@ -22,11 +16,11 @@

- +

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