-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9827712
commit e6ce839
Showing
6 changed files
with
149 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
from django.contrib.auth.models import AbstractUser | ||
from django.db import models | ||
from datetime import timedelta | ||
|
||
class Question(models.Model): | ||
question_text = models.CharField(max_length=200) | ||
question_story = models.TextField() | ||
question_level = models.IntegerField(default=-1) | ||
answer = models.CharField(max_length=100) | ||
answer = models.CharField(max_length=100) | ||
# TODO: add image in models | ||
# image = models.ImageField(null=True, blank=True) | ||
wait_duration = models.DurationField(default=timedelta(seconds=13)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,84 @@ | ||
{% load static %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{% block title %}{% endblock %}</title> | ||
<style> | ||
@import url('https://fonts.googleapis.com/css?family=Old+Standard+TT'); | ||
|
||
img { | ||
margin-left: 20%; | ||
} | ||
|
||
body { | ||
font-family: 'Old Standard TT', serif; | ||
margin: 0; | ||
} | ||
|
||
#header { | ||
font-family: 'Old Standard TT', serif; | ||
color: white; | ||
text-align: center; | ||
font-size: 45px; | ||
margin: 10px; | ||
} | ||
|
||
#container { | ||
display: flex; | ||
align-items: center; | ||
/* border: 1px solid black; */ | ||
height: 100vh; | ||
justify-content: space-between; | ||
} | ||
|
||
.links { | ||
text-decoration: none; | ||
/* border: 1px solid blue; */ | ||
color: white; | ||
font-size: 26px; | ||
padding: 12px 12px 12px 25px; | ||
} | ||
|
||
.sidebar { | ||
/* border: 1px solid red; */ | ||
width: 300px; | ||
background-color: #231f20; | ||
display: flex; | ||
flex-direction: column; | ||
position: fixed; | ||
bottom: 0px; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
#content { | ||
/* border: 1px solid red; */ | ||
margin-left: 400px; | ||
margin-right: 400px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<main> | ||
{% block content %} | ||
{% endblock %} | ||
</main> | ||
<div id="container"> | ||
<div class="sidebar"> | ||
<div class="logo"> | ||
<h1 id="header">Sherlocked</h1> | ||
<img src="{% static 'img/sherlock.png' %}" height="150" width="150" alt="sherlock image"> | ||
</div> | ||
<a href="#" class="links">Solve Mystery</a> | ||
<a href="#" class="links">Leaderboard</a> | ||
<a href="#" class="links">Description</a> | ||
<a href="#" class="links">Rules</a> | ||
<a href="#" class="links">Forum</a> | ||
<a href="#" class="links">Logout</a> | ||
</div> | ||
|
||
<div id="content"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
<h2>Sign up</h2> | ||
<form method="post" action="{% url 'signup' %}"> | ||
<form method="post" action="{% url 'signup' %}"> | ||
{% csrf_token %} | ||
{% for field in form %} | ||
<p> | ||
{{ field.label_tag }}<br> | ||
{{ field }} | ||
{% for error in field.errors %} | ||
<p style="color: red">{{ error }}</p> | ||
{% endfor %} | ||
</p> | ||
<p> | ||
{{ field.label_tag }}<br> | ||
{{ field }} | ||
{% for error in field.errors %} | ||
<p style="color: red">{{ error }}</p> | ||
{% endfor %} | ||
</p> | ||
{% endfor %} | ||
<button type="submit">Sign up</button> | ||
</form> | ||
<button type="submit">submit</button> | ||
<p><span id="validate-message"></span></p> | ||
</form> | ||
|
||
<script> | ||
document.addEventListener('DOMContentLoaded', () => { | ||
var pass1 = document.querySelector("#id_password1"); | ||
var pass2 = document.querySelector("#id_password2"); | ||
pass2.addEventListener('keyup', () => { | ||
var validateMessage = document.querySelector("#validate-message"); | ||
if (pass1.value === pass2.value && pass1.value != "") { | ||
validateMessage.innerHTML = "Yay!"; | ||
} else { | ||
validateMessage.innerHTML = "Nope.. You shall not pass."; | ||
} | ||
}); | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters