Skip to content
Snippets Groups Projects
Commit 00fb55a0 authored by mrschnei's avatar mrschnei
Browse files

Updated tutor page

parent f1e3daf2
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@
<button onclick="myFunction()" class="dropbtn">Settings</button>
<div id="myDropdown" class="dropdown-content">
<a href="/accounts/profile/">Profile</a>
<hr />
<a href="/accounts/logout/">Logout</a>
</div>
</div>
......
......@@ -6,7 +6,7 @@
<p>{{username}}</p>
<p>{{org}}</p>
<p>Hours: {{hours}}</p>
<a href="/accounts/index/">Back to Homepage</a>
<a href="/">Back to Homepage</a>
</head>
<form action="/accounts/submitPoints/" method="post" enctype="multipart/form-data">
......
......@@ -91,7 +91,7 @@
<label for="subjects"><b>Tutoring Subject(s)</b></label>
<input type="text" placeholder="Enter Subject(s)" name="subjects" required>
<label for="time"><b>Available Times</b></label>
<label for="time"><b>Available Times (Day of the week: time)</b></label>
<input type="text" placeholder="Enter Times" name="time" required>
<div class="clearfix">
......@@ -104,10 +104,14 @@
<hr>
<h3>Username, Subject, Time, Email</h3>
<h1>Welcome to the Service Points Tutoring page!</h1>
<p>Search through our database of current tutors or sign up to have your name and information listed.</p>
<h3>Name, Subject(s), Time, Email</h3>
<p>
{% for tutor, email_ in zip(tutors, emails) %}
<p>{{tutor.username}}, {{tutor.subject}}, {{tutor.time}}, {{email_.email}}</p>
{% for tutor, user in zip(tutors, tutorsN) %}
<p>{{user.fullname}}, {{tutor.subject}}, {{tutor.time}}, {{user.email}}</p>
{% endfor %}
</p>
......
......@@ -66,10 +66,6 @@ def create():
if cursor.fetchone() is not None:
return flask.redirect(flask.url_for('duplicateUsername', prev='create'))
cursor.execute('SELECT * FROM orgs WHERE orgName=?', to_join)
if cursor.fetchone() is None:
return flask.redirect(flask.url_for('orgNotFound'))
if len(str(flask.request.form['password'])) is 0 or len(str(flask.request.form['fullname'])) is 0:
return flask.redirect(flask.url_for('incompleteForm', prev="create"))
......@@ -318,16 +314,14 @@ def tutorsu():
cursor = servicePoints.model.get_db()
cur = cursor.execute("SELECT * FROM tutors")
cur = cursor.execute("SELECT subject, time FROM tutors")
tutors = cur.fetchall()
username = flask.session["username"]
cur2 = cursor.execute('SELECT email FROM users WHERE '
'username =:who', {"who": username})
emails = cur2.fetchall()
cur2 = cursor.execute('SELECT fullname, email FROM users WHERE username IN (SELECT username FROM tutors)')
tutorsN = cur2.fetchall()
# Add database info to context
context = {"tutors": tutors, "emails": emails}
context = {"tutors": tutors, "tutorsN": tutorsN}
return flask.render_template("tutor.html", **context,zip=zip)
@servicePoints.app.route('/accounts/submitPoints/', methods=['GET', 'POST'])
......
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