Skip to content
Snippets Groups Projects
Commit 1a004f64 authored by ashagp2's avatar ashagp2
Browse files

Adding the UI module

parent 6ac21553
No related branches found
No related tags found
No related merge requests found
from flask import Flask, render_template, request, redirect, send_from_directory, url_for, send_file
app=Flask(__name__)
@app.route("/")
@app.route("/home")
def home():
return render_template('home.html')
@app.route("/about")
def about():
return render_template('about.html')
@app.route("/AQIHealthImpact")
def impact():
return render_template('aqihealthimpact.html')
@app.route("/userinput")
def input():
return render_template('userinput.html')
@app.route('/login', methods=['GET','POST'])
def login():
if (request.method == 'POST'):
username = request.form['uname']
password = request.form['psw']
if (res == "SUCCESS"):
return render_template('userinput.html')
else:
error_msg = 'Please enter a valid username and/or password'
data = { 'error': error_msg }
return render_template('Login.html', data=data)
return render_template('Login.html')
if __name__=='__main__':
app.run(debug=True)
con
\ No newline at end of file
AirQualityIndexApp/static/images/aqi.jpg

11.1 KiB

{% extends 'base.html' %}
{% block content %}
<!doctype html>
<div class="text-center">
<h1 class="mt-5">Search AQI for your City</h1>
<p class="lead">Please enter a city and date to perform a search.</p>
<form class="form-inline justify-content-center" method="post">
<div class="form-row">
<div class="col-auto">
<input class="form-control mb-2" style="width:200px" name="City" id="City"
placeholder="City" value="{{ request.form['query'] }}">
<input type="date" class="form-control mb-2" style="width:200px" name="date">
</div>
<div class="col-auto">
<input class="btn btn-primary mb-2" type="submit" value="Search">
</div>
</div>
</form>
<h1 class="mt-5">AQI is 28 </h1>
<h1 class="mt-5"><font color="green">Air Quality is good! </font> </h1>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<!doctype html>
<div class="text-center">
<h1 class="mt-5">Login</h1>
<form class="form-inline justify-content-center" method="post">
<div class="form-column">
<div class="col-auto">
<label for="uname"><b>Username</b></label>
<input type="text" class="form-control mb-2" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" class="form-control mb-2" placeholder="Enter Password" name="psw" required>
</div>
<div class="col-auto">
<input class="btn btn-primary mb-2" type="submit" value="Login">
</div>
</div>
</form>
</div>
{% endblock %}
About.html
<!doctype html>
<html class="no-js" lang="">
<head>
<h1>About Page</h1>
</head>
<body>
</body>
</html>
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<!doctype html>
<div class="text-center">
<h1 class="mt-5">Health Impact of AQI for your City</h1>
<p class="lead">Please enter your city and date to know the number of people affected by Air Quality</p>
<form class="form-inline justify-content-center" method="post">
<div class="form-row">
<div class="col-auto">
<input class="form-control mb-2" style="width:200px" name="City" id="City"
placeholder="City" value="{{ request.form['query'] }}">
<input type="date" class="form-control mb-2" style="width:200px" name="date">
<br>
<br>
</div>
<p class="lead"><b>5 people have reported respiratory issues</b> </p>
<br>
<div class="col-auto">
<br>
</div>
</div>
<input class="btn btn-primary mb-2" type="submit" value="Search">
</form>
</div>
{% endblock %}
\ No newline at end of file
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand mb-0 h1" href="{{ url_for('home') }}"><img src="/static/images/aqi.jpg" width="100" height="100" >
Air Quality Index
</a>
<ul class="nav ml-auto justify-content-end">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('input') }}">Input Heath Index</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('impact') }}">AQI Heath Impact</a>
</li>
</ul>
</nav>
<main role="main" class="container">
{% block content %}{% endblock %}
</main>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script>
(function() {
$('#upload-submit').click(function(evt) {
$('#upload-spinner').removeClass('d-none');
return true;
});
})();
</script>
{% block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<!doctype html>
<div class="text-center">
<h1 class="mt-5">Health Impact of AQI for your City</h1>
<p class="lead">Please enter your city and date to know the number of people affected by Air Quality</p>
<form class="form-inline justify-content-center" method="post">
<div class="form-row">
<div class="col-auto">
<input class="form-control mb-2" style="width:200px" name="City" id="City"
placeholder="City" value="{{ request.form['query'] }}">
<input type="date" class="form-control mb-2" style="width:200px" name="date">
</div>
<div class="col-auto">
<input class="btn btn-primary mb-2" type="submit" value="Search">
</div>
</div>
</form>
</div>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<!doctype html>
<div class="text-center">
<h1 class="mt-5">How are you feeling today?</h1>
<p class="lead">Please enter your city,date and health index to provide your input </p>
<form class="form-inline justify-content-center" method="post">
<div class="form-row">
<div class="col-auto">
<input class="form-control mb-2" style="width:200px" name="City" id="City"
placeholder="City" value="{{ request.form['query'] }}">
<input type="date" class="form-control mb-2" style="width:200px" name="date">
<select name="cars" class="form-control mb-2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div class="col-auto">
<input class="btn btn-primary mb-2" type="submit" value="Submit">
</div>
</div>
</form>
</div>
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment