diff --git a/servicePoints/templates/index.html b/servicePoints/templates/index.html index 50f2bab721cfe29d66b1babe0b87d3570db6eefb..aca9228ae848bcaae4cecb467d6e3bdacf016155 100644 --- a/servicePoints/templates/index.html +++ b/servicePoints/templates/index.html @@ -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> diff --git a/servicePoints/templates/submitPoints.html b/servicePoints/templates/submitPoints.html index cd49ae0ec261d785431c108af1150eb663e951ea..9406729aecc72883598ba3958e476fb5a213c1db 100644 --- a/servicePoints/templates/submitPoints.html +++ b/servicePoints/templates/submitPoints.html @@ -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"> diff --git a/servicePoints/templates/tutor.html b/servicePoints/templates/tutor.html index 3903d76d1eb2b790e159a26ca0d6de079aaeda19..158dd1c7bf0c5a4fd0797ea6eb2564a584c4bcd8 100644 --- a/servicePoints/templates/tutor.html +++ b/servicePoints/templates/tutor.html @@ -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> diff --git a/servicePoints/views/accounts.py b/servicePoints/views/accounts.py index 73daee088c974f920dcd0d6799efa6aefaf7b969..e1e8f8686ec381dddd15381c2255fec6eee4bd5f 100644 --- a/servicePoints/views/accounts.py +++ b/servicePoints/views/accounts.py @@ -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'])