Browse Source

Messages

main
Oliver 11 months ago
parent
commit
be03e50cf4
3 changed files with 85 additions and 74 deletions
  1. 4
    70
      templates/base.html
  2. 73
    0
      templates/bootstrapbase.html
  3. 8
    4
      templates/registration/login.html

+ 4
- 70
templates/base.html View File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport">
<title>{% block title %} Platzhalter {% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>
{% extends "bootstrapbase.html" %}


<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>

{% for message in messages %}
<div class="alert {{ message.tags }}" role="alert">
{{ message }}
</div>
{% endfor %}


<div class="container">
{% block content %} Platzhalter {% endblock %}

{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-primary">Abmelden</a>
{% endif %}

{% if not user.is_authenticated %}
{% block login %}
{% if user.is_anonymous %}
<a href="{% url 'login' %}" class="btn btn-primary">Anmelden</a> <a href="{% url 'login' %}" class="btn btn-primary">Anmelden</a>
{% endif %} {% endif %}

</div>



<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

</body>
</html>
{% endblock %}





+ 73
- 0
templates/bootstrapbase.html View File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport">
<title>{% block title %} Platzhalter {% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>

<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>

{% for message in messages %}
<div class="alert {{ message.tags }}" role="alert">
{{ message }}
</div>
{% endfor %}


<div class="container">
{% block content %} Platzhalter {% endblock %}

{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-primary">Abmelden</a>
{% endif %}

{% block login %} {% endblock %}

</div>



<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

</body>
</html>



+ 8
- 4
templates/registration/login.html View File

{% extends "base.html" %}
{% extends "bootstrapbase.html" %}


{% block title %}Anmeldung{% endblock %} {% block title %}Anmeldung{% endblock %}


{% block content %} {% block content %}


{% if form.errors %} {% if form.errors %}
<p>Benutzername oder Passwort falsch.</p>
<div class="alert alert-warning" role="alert">
Benutzername oder Passwort falsch.
</div>
{% endif %} {% endif %}


{% if next %} {% if next %}
</tr> </tr>
</table> </table>


<input type="submit" value="Anmelden">
<input type="submit" class="btn btn-primary" value="Anmelden">
<input type="hidden" name="next" value="{{ next }}"> <input type="hidden" name="next" value="{{ next }}">
</form> </form>


<hr>

<p> <p>
<a href="{% url 'password_reset' %}">Passwort vergessen?</a>
<a href="{% url 'password_reset' %}" class="btn btn-light">Passwort vergessen?</a>
</p> </p>


{% endblock %} {% endblock %}

Loading…
Cancel
Save