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
8adc4c22
Commit
8adc4c22
authored
4 years ago
by
mrschnei
Browse files
Options
Downloads
Patches
Plain Diff
Added user profile
parent
87a76e11
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servicePoints/templates/index.html
+95
-22
95 additions, 22 deletions
servicePoints/templates/index.html
servicePoints/templates/userProfile.html
+19
-0
19 additions, 0 deletions
servicePoints/templates/userProfile.html
servicePoints/views/accounts.py
+5
-0
5 additions, 0 deletions
servicePoints/views/accounts.py
with
119 additions
and
22 deletions
servicePoints/templates/index.html
+
95
−
22
View file @
8adc4c22
...
...
@@ -2,37 +2,110 @@
<html>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/style.css"
>
<style>
.dropbtn
{
background-color
:
darkgray
;
color
:
black
;
padding
:
8px
;
font-size
:
14px
;
border
:
none
;
cursor
:
pointer
;
}
.dropdown
{
position
:
relative
;
display
:
inline-block
;
float
:
right
;
}
.dropdown-content
{
display
:
none
;
position
:
absolute
;
background-color
:
#f1f1f1
;
min-width
:
160px
;
overflow
:
auto
;
box-shadow
:
0px
8px
16px
0px
rgba
(
0
,
0
,
0
,
0.2
);
right
:
0
;
z-index
:
1
;
}
.dropdown-content
a
{
color
:
black
;
padding
:
12px
16px
;
text-decoration
:
none
;
display
:
block
;
}
.dropdown
a
:hover
{
background-color
:
#ddd
;
}
.show
{
display
:
block
;
}
</style>
</head>
<body>
Username: {{username}}
<div
class=
"dropdown"
>
<button
onclick=
"myFunction()"
class=
"dropbtn"
>
Settings
</button>
<div
id=
"myDropdown"
class=
"dropdown-content"
>
<a
href=
"/accounts/profile/"
>
Profile
</a>
<a
href=
"/accounts/logout/"
>
Logout
</a>
</div>
</div>
<h1
style=
"text-align:center"
>
Welcome to ServicePoints!
</h1>
<p>
{{username}}
</p>
<p>
{{org}}
</p>
<p>
Hours: {{hours}}
</p>
<a
href=
"/accounts/logout/"
>
logout
</a>
<a
href=
"/accounts/delete/"
>
delete
</a>
<p>
<a
href=
"/accounts/mask/"
>
<img
src=
/images/mask.png
alt=
"mask"
>
</a>
<a
href=
"/accounts/blood/"
>
<img
src=
/images/blood.png
alt=
"blood"
>
</a>
<a
href=
"/accounts/food/"
>
<img
src=
/images/food.png
alt=
"food"
>
</a>
<a
href=
"/accounts/tutorsu/"
>
<img
src=
/images/tutor.png
alt=
"tutorsu"
>
</a>
<a
href=
"/accounts/submitPoints/"
>
<img
src=
/images/submit.png
alt=
"mask"
>
</a>
{% if leader == 1 %}
<a
href=
"/accounts/mask/"
>
<img
src=
/images/mask.png
alt=
"mask"
>
</a>
<a
href=
"/accounts/blood/"
>
<img
src=
/images/blood.png
alt=
"blood"
>
</a>
<a
href=
"/accounts/food/"
>
<img
src=
/images/food.png
alt=
"food"
>
</a>
<a
href=
"/accounts/tutorsu/"
>
<img
src=
/images/tutor.png
alt=
"tutorsu"
>
</a>
<a
href=
"/accounts/submitPoints/"
>
<img
src=
/images/submit.png
alt=
"mask"
>
</a>
{% if leader == 1 %}
<a
href=
"/accounts/mask/"
>
<img
src=
/images/view.png
alt=
"mask"
>
</a>
<a
href=
"/accounts/mask/"
>
<img
src=
/images/requests.png
alt=
"mask"
>
</a>
{% endif %}
{% endif %}
</p>
</head>
<script>
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function
myFunction
()
{
document
.
getElementById
(
"
myDropdown
"
).
classList
.
toggle
(
"
show
"
);
}
// Close the dropdown if the user clicks outside of it
window
.
onclick
=
function
(
event
)
{
if
(
!
event
.
target
.
matches
(
'
.dropbtn
'
))
{
var
dropdowns
=
document
.
getElementsByClassName
(
"
dropdown-content
"
);
var
i
;
for
(
i
=
0
;
i
<
dropdowns
.
length
;
i
++
)
{
var
openDropdown
=
dropdowns
[
i
];
if
(
openDropdown
.
classList
.
contains
(
'
show
'
))
{
openDropdown
.
classList
.
remove
(
'
show
'
);
}
}
}
}
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
servicePoints/templates/userProfile.html
0 → 100644
+
19
−
0
View file @
8adc4c22
<!DOCTYPE html>
<html>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/style.css"
>
<title>
Profile
</title>
<a
href=
"/"
>
Home
</a>
</head>
<body>
<h1
style=
"text-align:center"
>
Profile
</h1>
<a
href=
"/accounts/logout/"
>
logout
</a>
<a
href=
"/accounts/delete/"
>
delete
</a>
</body>
</html>
This diff is collapsed.
Click to expand it.
servicePoints/views/accounts.py
+
5
−
0
View file @
8adc4c22
...
...
@@ -263,6 +263,11 @@ def food():
context
=
{}
return
render_template
(
'
food.html
'
,
**
context
)
@servicePoints.app.route
(
'
/accounts/profile/
'
)
def
profile
():
context
=
{}
return
render_template
(
'
userProfile.html
'
,
**
context
)
@servicePoints.app.route
(
'
/images/<path:filename>
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
images
(
filename
):
if
"
username
"
in
flask
.
session
:
...
...
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