Added basic user authentication.

This commit is contained in:
2023-08-23 17:45:39 -04:00
parent 511acab59c
commit bac5437e7e
8 changed files with 95 additions and 13 deletions

View File

@@ -43,11 +43,21 @@
<!-- Page links. -->
{% if num_pages > 1 %}
<td>
<div class="mauto">
<div class="mauto mr-2">
{% for page in pages %}<a href="./?page={{page}}{%if search %}&{{search}}{% endif %}">{{page}}</a>{% if not forloop.last %}<span> </span>{% endif %}{% endfor %}
</div>
</td>
{% endif %}
<!-- Logout button. -->
<td>
<form method="post" action="{% url 'logout' %}">
{% csrf_token %}
<button type="submit" class="clear-btn">
<img src="{% static 'imgs/boot.png' %}" class="small-nav-icon">
</button>
</form>
</td>
</tr>
</table>
@@ -70,7 +80,7 @@
<!-- Search submit. -->
<td>
<button type="submit" class="search-btn">
<button type="submit" class="clear-btn">
<img src="{% static 'imgs/find.png' %}" class="small-nav-icon">
</button>
</td>

View File

@@ -0,0 +1,42 @@
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height" />
<title>
NibasaViewer login
</title>
<link href="{% static 'css/styles.css' %}" rel="stylesheet">
</head>
<body class="background">
<div class="fc mauto pd">
<form method="post" action="{% url 'login' %}" class="fc">
{% csrf_token %}
<table>
<tr>
<td>
{{ form.username.label_tag }}
</td>
<td>
{{ form.username }}
</td>
</tr>
<tr>
<td>
{{ form.password.label_tag }}
</td>
<td>
{{ form.password }}
</td>
</tr>
</table>
<input type="submit" value="login" class="float-right">
<input type="hidden" name="next" value="{{ next }}">
</form>
</div>
</body>
</html>