Skip to content
Snippets Groups Projects
Commit 9ac74bf4 authored by aebopp's avatar aebopp
Browse files

tutoring edits

parents e43bc7e8 74bbfc9c
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,89 @@ ...@@ -4,10 +4,89 @@
<link rel="stylesheet" type="text/css" href="/css/style.css"> <link rel="stylesheet" type="text/css" href="/css/style.css">
<title>Blood Drives</title> <title>Blood Drives</title>
<a href="/">Home</a> <style>
.topnav {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
.topnav button:hover {
background: rgba(0,0,0,0.2);
}
main {
margin-top: 75px;
}
.topitem {
color: #f2f2f2;
float: left;
display: block;
font-size: 16px;
padding: 14px 16px;
}
.topmenu {
font-size: 16px;
padding: 14px 16px;
position: relative;
display: inline-block;
float: right;
}
.topmenu a {
color: #f2f2f2;
}
.listing {
float: left;
display: block;
padding: 14px 16px;
margin: 10px;
border-radius: 7px;
border: 3px solid black;
}
</style>
</head> </head>
<body> <body>
<h1 style="text-align:center">Blood Drives</h1>
<div class="topnav">
<div class="topitem">
Username: {{username}}
</div>
<div class="topitem">
Organization: {{org}}
</div>
<div class="topitem">
Hours: {{hours}}
</div>
<div class="topmenu">
<a href="/">Home</a>
</div>
<div class="topmenu">
<a href="https://www.redcross.org/give-blood.html">Red Cross</a>
</div>
</div>
<main>
<h1 style="text-align:center">Blood Drives</h1>
<div class="listing">
Ann Arbor Blood Donation Center <br />
Location: 4624 Packard Rd Ann Arbor, MI 48108 <br />
Times: 07/22/2020 : 11:00 AM - 07:15 PM <br />
<a href="">Link to Blood Drive</a>
</div>
<div class="listing">
Blood Drive 2 <br /> Location: Grand Rapids <br /> Link: <a href="">Link to Blood Drive</a>
</div>
</main>
</body> </body>
......
...@@ -4,10 +4,81 @@ ...@@ -4,10 +4,81 @@
<link rel="stylesheet" type="text/css" href="/css/style.css"> <link rel="stylesheet" type="text/css" href="/css/style.css">
<title>Food Drives</title> <title>Food Drives</title>
<a href="/">Home</a> <style>
.topnav {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
.topnav button:hover {
background: rgba(0,0,0,0.2);
}
main {
margin-top: 75px;
}
.topitem {
color: #f2f2f2;
float: left;
display: block;
font-size: 16px;
padding: 14px 16px;
}
.topmenu {
font-size: 16px;
padding: 14px 16px;
position: relative;
display: inline-block;
float: right;
}
.topmenu a {
color: #f2f2f2;
}
.listing {
float: left;
display: block;
padding: 14px 16px;
margin: 10px;
border-radius: 7px;
border: 3px solid black;
}
</style>
</head> </head>
<body> <body>
<h1 style="text-align:center">Food Drives</h1>
<div class="topnav">
<div class="topitem">
Username: {{username}}
</div>
<div class="topitem">
Organization: {{org}}
</div>
<div class="topitem">
Hours: {{hours}}
</div>
<div class="topmenu">
<a href="/">Home</a>
</div>
</div>
<main>
<h1 style="text-align:center">Food Drives</h1>
<div class="listing">
Food Drive 1 <br /> Location: Ann Arbor <br /> Link: <a href="">Food Drive Information</a>
</div>
<div class="listing">
Food Drive 2 <br /> Location: Detroit <br /> Link: <a href="">Food Drive Information</a>
</div>
</main>
......
...@@ -14,32 +14,85 @@ ...@@ -14,32 +14,85 @@
padding: 10px; padding: 10px;
} }
</style> .topnav {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
.topnav button:hover {
background: rgba(0,0,0,0.2);
}
main {
margin-top: 75px;
}
.topitem {
color: #f2f2f2;
float: left;
display: block;
font-size: 16px;
padding: 14px 16px;
}
.topmenu {
font-size: 16px;
padding: 14px 16px;
position: relative;
display: inline-block;
float: right;
}
.topmenu a {
color: #f2f2f2;
}
<a href="/">Home</a> </style>
</head> </head>
<body> <body>
<h1 style="text-align:center">How to Make and Donate Masks</h1>
<div class="topnav">
<div> <div class="topitem">
<div class="column" style="border-right:1px solid;"> Username: {{username}}
<h2 style="text-align:center">How to Make Masks</h2> </div>
<p>Linked below is a video tutorial for making masks with simple materials that can be bought cheaply or found around the home. <div class="topitem">
</p> Organization: {{org}}
<div style="text-align:center"> </div>
<iframe width="560" height="315" src="https://www.youtube.com/embed/VgHrnS6n4iA" frameborder="0" <div class="topitem">
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> Hours: {{hours}}
</div>
</div> </div>
<div class="column"> <div class="topmenu">
<h2 style="text-align:center">Where to donate masks</h2> <a href="/">Home</a>
<p>Find places can be tricky as the stock in masks rises around the country. Donations can still be useful for organizations or communities
that might not be able to purchase masks. Places to donate in your local area can be found through some searches on google.</p>
<p>Some links that might be useful: </p>
<a href="https://deaconess.com/How-to-make-a-Face-Mask/Mask-Donations?state=Michigan">Deaconess</a>
</div> </div>
</div> </div>
<main>
<h1 style="text-align:center">How to Make and Donate Masks</h1>
<div>
<div class="column" style="border-right:1px solid;">
<h2 style="text-align:center">How to Make Masks</h2>
<p>
Linked below is a video tutorial for making masks with simple materials that can be bought cheaply or found around the home.
</p>
<div style="text-align:center">
<iframe width="560" height="315" src="https://www.youtube.com/embed/VgHrnS6n4iA" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="column">
<h2 style="text-align:center">Where to donate masks</h2>
<p>
Find places can be tricky as the stock in masks rises around the country. Donations can still be useful for organizations or communities
that might not be able to purchase masks. Places to donate in your local area can be found through some searches on google.
</p>
<p>Some links that might be useful: </p>
<a href="https://deaconess.com/How-to-make-a-Face-Mask/Mask-Donations?state=Michigan">Deaconess</a>
</div>
</div>
</main>
</body> </body>
</html> </html>
...@@ -67,13 +67,69 @@ ...@@ -67,13 +67,69 @@
clear: both; clear: both;
display: table; display: table;
} }
.listing {
float: left;
display: block;
padding: 14px 16px;
margin: 10px;
border-radius: 7px;
border: 3px solid black;
}
.topnav {
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
main {
margin-top: 75px;
}
.topitem {
color: #f2f2f2;
float: left;
display: block;
font-size: 16px;
padding: 14px 16px;
}
.topmenu {
font-size: 16px;
padding: 14px 16px;
position: relative;
display: inline-block;
float: right;
}
.topmenu a {
color: #f2f2f2;
}
</style> </style>
<body> <body>
<a href="/">Home</a>
<title>ServicePoints</title> <title>ServicePoints</title>
<div class="topnav">
<div class="topitem">
Username: {{username}}
</div>
<div class="topitem">
Organization: {{org}}
</div>
<div class="topitem">
Hours: {{hours}}
</div>
<div class="topmenu">
<a href="/">Home</a>
</div>
</div>
<div id="id01" class="modal"> <div id="id01" class="modal">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span> <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
<form class="modal-content" action="/accounts/tutorsu/" method="post"> <form class="modal-content" action="/accounts/tutorsu/" method="post">
...@@ -81,8 +137,6 @@ ...@@ -81,8 +137,6 @@
<h1>Sign Up</h1> <h1>Sign Up</h1>
<p>Please fill in this form to sign up as a tutor.</p> <p>Please fill in this form to sign up as a tutor.</p>
<hr> <hr>
<label for="name"><b>Full Name</b></label>
<input type="text" placeholder="Enter Full Name" name="name" required>
<label for="subjects"><b>Tutoring Subject(s)</b></label> <label for="subjects"><b>Tutoring Subject(s)</b></label>
<input type="text" placeholder="Enter Subject(s)" name="subjects" required> <input type="text" placeholder="Enter Subject(s)" name="subjects" required>
...@@ -93,7 +147,7 @@ ...@@ -93,7 +147,7 @@
<div class="clearfix"> <div class="clearfix">
<button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button> <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
<form action="/accounts/tutor/" method="post"> <form action="/accounts/tutorsu/" method="post">
<input type="submit" class="signup" name="sign" value="Sign Up" /> <input type="submit" class="signup" name="sign" value="Sign Up" />
</form> </form>
</div> </div>
...@@ -101,34 +155,34 @@ ...@@ -101,34 +155,34 @@
</form> </form>
</div> </div>
<hr> <main>
<h1>Welcome to the Service Points Tutoring page!</h1>
<h1>Welcome to the Service Points Tutoring page!</h1> {% if registered == 0 %}
<p>Search through our database of current tutors or sign up to have your name and information listed.</p>
{% if registered == 0 %} <div class="su">
<button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Sign Up</button>
<p>Search through our database of current tutors or sign up to have your name and information listed.</p> </div>
{% endif %}
<div class="su"> {% if registered == 1 %}
<button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Sign Up</button>
</div>
{% endif %}
{% if registered == 1 %}
<p>Search through our database of current tutors or edit your listed information.</p> <p>Search through our database of current tutors or edit your listed information.</p>
<div class="su"> <div class="su">
<button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Edit Information</button> <button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Edit Information</button>
<button value='delete' type="submit" class="signup">Delete Profile</button> <form action="/accounts/tutorsu/" method="post">
<input type="submit" class="signup" name="delete" value="Delete Profile" />
</form>
</div> </div>
{% endif %} {% endif %}
<p>
<h3>Name, Subject(s), Time, Email</h3> {% for tutor, user in zip(tutors, tutorsN) %}
<p> <div class="listing">
{% for tutor, user in zip(tutors, tutorsN) %} {{user.fullname}}<br />
<p>{{user.fullname}}, {{tutor.subject}}, {{tutor.time}}, {{user.email}}</p> Subjects: {{tutor.subject}}<br />
{% endfor %} Available Times: {{tutor.time}}<br />
</p> Contact Email: {{user.email}}
</div>
{% endfor %}
</p>
</main>
</body> </body>
</html> </html>
No preview for this file type
...@@ -331,17 +331,35 @@ def incompleteForm(prev): ...@@ -331,17 +331,35 @@ def incompleteForm(prev):
@servicePoints.app.route('/accounts/mask/') @servicePoints.app.route('/accounts/mask/')
def mask(): def mask():
context = {} username = flask.session["username"]
cursor = servicePoints.model.get_db()
studentOrgCur = cursor.execute('SELECT orgName, hours FROM users WHERE '
'username =:who',
{"who": username})
results = studentOrgCur.fetchone()
context = {'username': username, 'org': results["orgName"], 'hours': results["hours"]}
return render_template('mask.html', **context) return render_template('mask.html', **context)
@servicePoints.app.route('/accounts/blood/') @servicePoints.app.route('/accounts/blood/')
def blood(): def blood():
context = {} username = flask.session["username"]
cursor = servicePoints.model.get_db()
studentOrgCur = cursor.execute('SELECT orgName, hours FROM users WHERE '
'username =:who',
{"who": username})
results = studentOrgCur.fetchone()
context = {'username': username, 'org': results["orgName"], 'hours': results["hours"]}
return render_template('blood.html', **context) return render_template('blood.html', **context)
@servicePoints.app.route('/accounts/food/') @servicePoints.app.route('/accounts/food/')
def food(): def food():
context = {} username = flask.session["username"]
cursor = servicePoints.model.get_db()
studentOrgCur = cursor.execute('SELECT orgName, hours FROM users WHERE '
'username =:who',
{"who": username})
results = studentOrgCur.fetchone()
context = {'username': username, 'org': results["orgName"], 'hours': results["hours"]}
return render_template('food.html', **context) return render_template('food.html', **context)
@servicePoints.app.route('/accounts/profile/', methods=['GET', 'POST']) @servicePoints.app.route('/accounts/profile/', methods=['GET', 'POST'])
...@@ -451,18 +469,24 @@ def tutorsu(): ...@@ -451,18 +469,24 @@ def tutorsu():
data = (flask.session['username'], flask.session['subjects'], data = (flask.session['username'], flask.session['subjects'],
flask.session['time']) flask.session['time'])
data2 = (flask.session['subjects'], flask.session['time'],
flask.session['username'])
to_add = (name,) to_add = (name,)
cursor.execute('SELECT * FROM tutors WHERE username=?', to_add) cursor.execute('SELECT * FROM tutors WHERE username=?', to_add)
if cursor.fetchone() is not None: if cursor.fetchone() is not None:
cur = servicePoints.model.get_db() cur = servicePoints.model.get_db()
cur.execute("UPDATE tutors SET username = ?, subject=?, time=?", data) cur.execute("UPDATE tutors SET subject=?, time=? WHERE username = ?", data2)
registered = 1
else: else:
cur = servicePoints.model.get_db() cur = servicePoints.model.get_db()
cur.execute("INSERT INTO tutors(username, subject, time) VALUES (?, ?, ?)", data) cur.execute("INSERT INTO tutors(username, subject, time) VALUES (?, ?, ?)", data)
registered = 0
return flask.redirect(flask.url_for('tutorsu')) return flask.redirect(flask.url_for('tutorsu'))
if 'delete' in flask.request.form:
cur = servicePoints.model.get_db()
cur.execute("DELETE from tutors WHERE username = ?", (flask.session['username'],))
cursor = servicePoints.model.get_db().cursor() cursor = servicePoints.model.get_db().cursor()
name = str(flask.session['username']) name = str(flask.session['username'])
...@@ -480,8 +504,16 @@ def tutorsu(): ...@@ -480,8 +504,16 @@ def tutorsu():
cur2 = cursor.execute('SELECT fullname, email FROM users WHERE username IN (SELECT username FROM tutors)') cur2 = cursor.execute('SELECT fullname, email FROM users WHERE username IN (SELECT username FROM tutors)')
tutorsN = cur2.fetchall() tutorsN = cur2.fetchall()
username = flask.session["username"]
cursor = servicePoints.model.get_db()
studentOrgCur = cursor.execute('SELECT orgName, hours FROM users WHERE '
'username =:who',
{"who": username})
results = studentOrgCur.fetchone()
# Add database info to context # Add database info to context
context = {"tutors": tutors, "tutorsN": tutorsN, "registered": registered}
context = {"tutors": tutors, "tutorsN": tutorsN, 'username': username, 'org': results["orgName"], 'hours': results["hours"], "registered": registered}
return flask.render_template("tutor.html", **context,zip=zip) return flask.render_template("tutor.html", **context,zip=zip)
@servicePoints.app.route('/accounts/submitPoints/', methods=['GET', 'POST']) @servicePoints.app.route('/accounts/submitPoints/', methods=['GET', 'POST'])
......
var/images/c0cf17efda2368530bb66b4e2fb68456865edbbdaa67c99783de324711384437.jpg

7.63 KiB

var/images/e7f4305f380d8eadfe6640bced697c42bb582eee646155db4b795aa98cc87410.png

157 KiB

No preview for this file type
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