mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Basic auth system
This commit is contained in:
30
core/templates/core/base.html
Normal file
30
core/templates/core/base.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<title>{% block title %}Bienvenue sur le Sith de l'AE!{% endblock %}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
{% block header %}
|
||||
{% if user %}Hello, {{ user.username }}!{% endif %}
|
||||
<ul>
|
||||
<li><a href="{% url 'core:register' %}">Register</a></li>
|
||||
<li><a href="{% url 'core:login' %}">Login</a></li>
|
||||
<li><a href="{% url 'core:logout' %}">Logout</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
<div id="content">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
{% block footer %}
|
||||
Site réalisé par des gens biens
|
||||
{% endblock %}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1
core/templates/core/index.html
Normal file
1
core/templates/core/index.html
Normal file
@ -0,0 +1 @@
|
||||
{% extends "sith/base.html" %}
|
14
core/templates/core/login.html
Normal file
14
core/templates/core/login.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<form action="{% url 'core:login' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<p><input type="submit" value="Login!" /></p>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
13
core/templates/core/register.html
Normal file
13
core/templates/core/register.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<form action="{% url 'core:register' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<p><input type="submit" value="Register!" /></p>
|
||||
</form>
|
||||
{% endblock %}
|
@ -1,13 +0,0 @@
|
||||
<h1>Register a user</h1>
|
||||
|
||||
{% if username %}
|
||||
You registered successfully, {{ username }}!
|
||||
{% endif %}
|
||||
|
||||
<form action="{% url 'sith:register' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<ul>
|
||||
{{ form }}
|
||||
<li><input type="submit" value="Register!" /></li>
|
||||
</ul>
|
||||
</form>
|
Reference in New Issue
Block a user