added base template, added header bar to all pages

This commit is contained in:
iou1name 2018-06-18 22:13:49 -04:00
parent 0980554cff
commit faf4b995b2
7 changed files with 87 additions and 74 deletions

View File

@ -1,14 +1,26 @@
#questBody {
height: 100%;
#header {
position: fixed;
padding-left: 10px;
padding-right: 32%;
top: 0;
left: 0;
width: 100%;
list-style-type: none;
margin: 0;
padding: 0;
background-color: #dddddd;
}
#header li {
display: inline;
}
#questContainer {
display: flex;
overflow: auto;
}
.chat {
display: flex;
flex-direction: column;
#questBody {
padding-left: 10px;
padding-right: 32%;
}
#chatPane {
@ -16,7 +28,8 @@
width: 30%;
right: 0;
position: fixed;
padding-right: 20px;
display: flex;
flex-direction: column;
}
#chatWindow {
@ -28,6 +41,8 @@
#messageBox {
padding-bottom: 10px;
width: 100%;
display: flex;
flex-direction: column;
}
#messageTextarea {

14
templates/base.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %} - Anonkun</title>
<link rel="stylesheet" type="text/css" href="/static/anonkun.css">
{% block head %}{% endblock %}
</head>
<body>
<ul id="header">
<li><a href="{{ url_for('views.index') }}">Home</a></li>
</ul>
<div id="content">{% block content %}{% endblock %} </div>
</body>
</html>

View File

@ -1,13 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Make a new quest</title>
</head>
<body>
<form method="post" action="{{ url_for('views.create_quest') }}">
<input type="text" placeholder="Quest Title" name="quest_title" maxlength="300" required/><br/>
<textarea id="create_textarea" name="quest_body"></textarea>
<input type="submit" name="submit" value="Submit"/>
</form>
</body>
</html>
{% extends "base.html" %}
{% block title %}Start a new quest{% endblock %}
{% block content %}
<h1>New Quest</h1>
<form method="post" action="{{ url_for('views.create_quest') }}">
<input type="text" placeholder="Quest Title" name="quest_title" maxlength="300" required/><br/>
<textarea id="create_textarea" name="quest_body"></textarea>
<input type="submit" name="submit" value="Submit"/>
</form>
{% endblock %}

View File

@ -1,13 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Meet the new anonkun.</title>
</head>
<body>
{% extends "base.html" %}
{% block title %}Index{% endblock %}
{% block content %}
<h1>Quests 'n Shiet</h1>
<a href="./quest/unga-bunga-quest">Unga Bunga Quest</a><br />
<a href="./create_quest">Create New Quest</a><br />
<a href="./signup">Sign up</a><br />
<a href="./login">Login</a><br />
</body>
</html>
{% endblock %}

View File

@ -1,13 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
</head>
<body>
{% extends "base.html" %}
{% block title %}Login{% endblock %}
{% block content %}
<h1>Login</h1>
<form method="post" action="{{ url_for('views.login') }}">
<input type="text" placeholder="Username" name="user" maxlength="20" required/><br />
<input type="password" placeholder="Password" name="pass" maxlength="1024" required/><br />
<input type="submit" value="Log in" name="submit"/>
</form>
</body>
</html>
{% endblock %}

View File

@ -1,8 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ quest_title }}</title>
<link rel="stylesheet" type="text/css" href="/static/anonkun.css">
{% extends "base.html" %}
{% block title %}{{ quest_title }}{% endblock %}
{% block head %}
<script type="text/javascript" src="/static/socket.io.slim.js"></script>
<script>
var socket;
@ -43,31 +41,30 @@
return number;
}
</script>
</head>
<body>
<div id="questBody">
<h1>{{ quest_title }}</h1>
{% autoescape false %}
{{ quest_body }}
{% endautoescape %}
</div>
<div id="chatPane" class="chat">
<h1>Chat</h1>
<div id="chatWindow" class="chat">
{% endblock %}
{% block content %}
<div id="questContainer">
<div id="questBody">
<h1>{{ quest_title }}</h1>
{% autoescape false %}
{% for message in messages %}
<div class="message">
<div class="messageHeader">
<span class="messageName">{{ message[1] }}</span> <span class="messageDate">{{ message[3] | strftime }}</span>
</div>
<div class="messageMessage">{{ message[4] }}</div>
</div>
{% endfor %}
{{ quest_body }}
{% endautoescape %}
</div>
<div id="messageBox" class="chat">
<textarea id="messageTextarea"></textarea>
<div id="chatPane">
<h1>Chat</h1>
<div id="chatWindow">
{% autoescape false %}
{% for message in messages %}
<div class="message">
<div class="messageHeader">
<span class="messageName">{{ message[1] }}</span> <span class="messageDate">{{ message[3] | strftime }}</span>
</div>
<div class="messageMessage">{{ message[4] }}</div>
</div>
{% endfor %}
{% endautoescape %}
</div>
<div id="messageBox"><textarea id="messageTextarea"></textarea></div>
</div>
</div>
</body>
</html>
{% endblock %}

View File

@ -1,9 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Sign up a new account</title>
</head>
<body>
{% extends "base.html" %}
{% block title %}Sign up a new account{% endblock %}
{% block content %}
<h1>Sign up</h1>
<div id="namePassRules">
<p>Username rules:
<ul>
@ -14,12 +12,11 @@
<ul>
<li>Must be between 8 and 1024 characters</li>
</ul>
</div>
<form method="post" action="{{ url_for('views.signup') }}">
<input type="text" placeholder="Username" name="user" maxlength="20" required/><br />
<input type="password" placeholder="Password" name="pass" maxlength="1024" required/><br />
<input type="password" placeholder="Verify password" name="pass_verify" maxlength="1024" required/><br />
<input type="submit" value="Sign up" name="submit"/>
</form>
</body>
</html>
{% endblock %}