Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ServicePoints
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aebopp
ServicePoints
Commits
e37972df
Commit
e37972df
authored
4 years ago
by
mrschnei
Browse files
Options
Downloads
Patches
Plain Diff
Updated the Tutor page and changed tutor sign ups
parent
4f7f8339
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servicePoints/templates/duplicateTutor.html
+1
-1
1 addition, 1 deletion
servicePoints/templates/duplicateTutor.html
servicePoints/templates/tutor.html
+108
-15
108 additions, 15 deletions
servicePoints/templates/tutor.html
servicePoints/views/accounts.py
+15
-3
15 additions, 3 deletions
servicePoints/views/accounts.py
with
124 additions
and
19 deletions
servicePoints/templates/duplicateTutor.html
+
1
−
1
View file @
e37972df
...
...
@@ -10,7 +10,7 @@
You have already signed up for tutoring
</p>
<form
action=
"/accounts/duplicateTutor/"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"submit"
name=
"return"
value=
"Return to
Hom
e"
/>
<input
type=
"submit"
name=
"return"
value=
"Return to
Tutoring Pag
e"
/>
</form>
</body>
</html>
This diff is collapsed.
Click to expand it.
servicePoints/templates/tutor.html
+
108
−
15
View file @
e37972df
<!DOCTYPE html>
<html>
<style>
body
{
font-family
:
Arial
,
Helvetica
,
sans-serif
;}
*
{
box-sizing
:
border-box
;}
/* Full-width input fields */
input
[
type
=
text
]
{
width
:
100%
;
padding
:
15px
;
margin
:
5px
0
22px
0
;
display
:
inline-block
;
border
:
none
;
background
:
#f1f1f1
;
}
/* The Modal (background) */
.modal
{
display
:
none
;
/* Hidden by default */
position
:
fixed
;
/* Stay in place */
z-index
:
1
;
/* Sit on top */
left
:
0
;
top
:
0
;
width
:
100%
;
/* Full width */
height
:
100%
;
/* Full height */
overflow
:
auto
;
/* Enable scroll if needed */
background-color
:
#474e5d
;
padding-top
:
50px
;
}
/* Modal Content/Box */
.modal-content
{
background-color
:
#fefefe
;
margin
:
5%
auto
15%
auto
;
/* 5% from the top, 15% from the bottom and centered */
border
:
1px
solid
#888
;
width
:
80%
;
/* Could be more or less, depending on screen size */
}
/* The Close Button (x) */
.close
{
position
:
absolute
;
right
:
35px
;
top
:
15px
;
font-size
:
40px
;
font-weight
:
bold
;
color
:
#f1f1f1
;
}
/* Add padding to container elements */
.container
{
padding
:
16px
;
}
.close
:hover
,
.close
:focus
{
color
:
#f44336
;
cursor
:
pointer
;
}
.su
{
float
:
right
;
}
/* Clear floats */
.clearfix
::after
{
content
:
""
;
clear
:
both
;
display
:
table
;
}
</style>
<body>
<a
href=
"/"
>
Home
</a>
<title>
ServicePoints
</title>
<form
action=
"/accounts/tutorsu/"
method=
"post"
enctype=
"multipart/form-data"
>
<p>
Full Name
<input
type=
"text"
name=
"username"
/>
</p>
<p>
Tutuoring Subject(s):
<input
type=
"text"
name=
"subjects"
/>
</p>
<p>
Available times
<input
type=
"text"
name=
"time"
/>
</p>
<input
type=
"submit"
name=
"signup"
value=
"sign up"
/>
</form>
<div
class=
"su"
>
<button
onclick=
"document.getElementById('id01').style.display='block'"
style=
"width:auto; right: 35px"
>
Sign Up
</button>
</div>
<div
id=
"id01"
class=
"modal"
>
<span
onclick=
"document.getElementById('id01').style.display='none'"
class=
"close"
title=
"Close Modal"
>
×
</span>
<form
class=
"modal-content"
action=
"/accounts/tutorsu/"
method=
"post"
>
<div
class=
"container"
>
<h1>
Sign Up
</h1>
<p>
Please fill in this form to sign up as a tutor.
</p>
<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>
<input
type=
"text"
placeholder=
"Enter Subject(s)"
name=
"subjects"
required
>
<label
for=
"time"
><b>
Available Times
</b></label>
<input
type=
"text"
placeholder=
"Enter Times"
name=
"time"
required
>
<div
class=
"clearfix"
>
<button
type=
"button"
onclick=
"document.getElementById('id01').style.display='none'"
class=
"cancelbtn"
>
Cancel
</button>
<button
type=
"submit"
class=
"signup"
>
Sign Up
</button>
</div>
</div>
</form>
</div>
<hr>
<h3>
Username, Subject, Time, Email
</h3>
<p>
{% for tutor, email_ in zip(tutors, emails) %}
<p>
{{tutor.username}}, {{tutor.subject}}, {{tutor.time}}, {{email_.email}}
</p>
{% endfor %}
</p>
</body>
</html>
This diff is collapsed.
Click to expand it.
servicePoints/views/accounts.py
+
15
−
3
View file @
e37972df
...
...
@@ -237,7 +237,7 @@ def duplicateOrgName():
@servicePoints.app.route
(
'
/accounts/duplicateTutor/
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
duplicateTutor
():
if
flask
.
request
.
method
==
'
POST
'
:
return
flask
.
redirect
(
flask
.
url_for
(
'
tutor
'
))
return
flask
.
redirect
(
flask
.
url_for
(
'
tutor
su
'
))
context
=
{}
return
render_template
(
'
duplicateTutor.html
'
,
**
context
)
...
...
@@ -288,8 +288,20 @@ def tutorsu():
return
flask
.
redirect
(
flask
.
url_for
(
'
index
'
))
context
=
{}
return
render_template
(
'
tutor.html
'
,
**
context
)
cursor
=
servicePoints
.
model
.
get_db
()
cur
=
cursor
.
execute
(
"
SELECT * FROM tutors
"
)
tutors
=
cur
.
fetchall
()
username
=
flask
.
session
[
"
username
"
]
cur2
=
cursor
.
execute
(
'
SELECT email FROM users WHERE
'
'
username =:who
'
,
{
"
who
"
:
username
})
emails
=
cur2
.
fetchall
()
# Add database info to context
context
=
{
"
tutors
"
:
tutors
,
"
emails
"
:
emails
}
return
flask
.
render_template
(
"
tutor.html
"
,
**
context
,
zip
=
zip
)
@servicePoints.app.route
(
'
/accounts/submitPoints/
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
submitPoints
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment