Added login functionality. It's a bit clunky, but it deas what it needs to. Testing needed.
The header now has a search bar, but the page itself needs to be created.
This commit is contained in:
Michael Rodin 2023-10-18 12:55:20 +02:00
parent d4016ce80c
commit dda864a92e
10 changed files with 153 additions and 29 deletions

View file

@ -11,7 +11,15 @@
<header>
<span id="title">{{title}}</span>
<div id="container">
<button class="big-button">&#x1F50E;</div>
<form action="/search" method="get">
<input type="text" name="q" placeholder="search">
<input type="submit" value="&#x1F50E;" class="big-button" id="search-button">
</form>
{% if login %}
<a href="/user/{{userdata[0]}}"><button class="big-button">{{userdata[2]}}</button></a>
{% else %}
<a href="/login"><button class="big-button">Login</button></a>
{% endif %}
</div>
</header>
<div id="content">

View file

@ -8,9 +8,9 @@
{% if archives|length > 0 %}
<div class="grid-container">
{% for arch in archives %}
<div class="grid-item clickable"><b>{{arch[0]}}</b></div>
<div class="grid-item"><p>{{arch[1]|spacer}}</p></div>
<div class="grid-item"><p>{{arch[2]|ctime}}</p></div>
<a class="grid-item" href="/view/{{arch[0]}}"><div class="grid-item clickable"><b>{{arch[1]}}</b></div></a>
<div class="grid-item"><p>{{arch[2]|spacer}}</p></div>
<div class="grid-item"><p>{{arch[3]|ctime}}</p></div>
{% endfor %}
</div>

View file

@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block meta %}
<link rel="stylesheet" href="/static/login.css" />
{% endblock %}
{% block content %}
<form action="/login" method="post">
<div class="grid-container">
<span>Username: </span><input type="text" name="username" placeholder="Username">
<span>Password: </span><input type="password" name="password" placeholder="******">
<input type = 'submit' value = 'Login'/>
</div>
</form>
{% endblock %}