Setup basic auth
This commit is contained in:
parent
3294ef2a82
commit
d7545ab43c
17 changed files with 315 additions and 4 deletions
36
base/templates/base.html
Normal file
36
base/templates/base.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Musik{% endblock %}</title>
|
||||
|
||||
<link rel="stylesheet" href="{% static "css/main.css" %}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.purple.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@4.6.0/fonts/remixicon.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<a href="{% url 'index' %}">
|
||||
<img class="logo" src="{% static "logo.svg" %}" height="64" width="64" alt="Musik">
|
||||
</a>
|
||||
<nav>
|
||||
<ul>
|
||||
{% if user.is_authenticated %}
|
||||
<li>{{ user.username }}</li>
|
||||
<li><form action="{% url 'logout' %}" method="post">{% csrf_token %}<input type="submit" value="Se déconnecter" class="logout"></form></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'login' %}" role="button">Se connecter <i class="ri-login-box-fill"></i></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main class="container">
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue