Skip to content
Snippets Groups Projects
Commit 8adc4c22 authored by mrschnei's avatar mrschnei
Browse files

Added user profile

parent 87a76e11
No related branches found
No related tags found
No related merge requests found
......@@ -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>
<!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>
......@@ -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:
......
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