Update for home use

This commit is contained in:
2021-12-01 12:02:01 +01:00
parent 72c6a3762d
commit f2845486df
5 changed files with 44 additions and 7 deletions
+11 -2
View File
@@ -5,12 +5,21 @@
{% endblock %}
{% block body %}
<div>
{% if user.is_authenticated %}
<p><a href="{% url 'logout' %}?next=/posts" class="btn btn-warning">Abmelden</a></p>
{% endif %}
{% if not user.is_authenticated %}
<p><a href="{% url 'login' %}?next=/posts" class="btn btn-warning">Anmelden</a></p>
{% endif %}
</div>
<div>
{% for notice in notices %}
<h3> {{ notice.notice_title }}</h3>
<p> {{ notice.notice_text }}</p>
<p><a class="btn btn-info" role="button"> href={% url 'delete' id=n %} Löschen </a></p>
{% if user.is_staff %}
<p><a href="{% url 'delete' deleteId=notice.id %}" class="btn btn-danger"> Meldung löschen </a></p>
{% endif %}
{% endfor %}
</div>
<p><a href="{% url 'new' %}" class="btn btn-info" role="button">Neue Nachricht</a></p>
+21
View File
@@ -0,0 +1,21 @@
{% extends 'base.html' %}
{% block title %}
Login
{% endblock %}
{% block body %}
<div class="container">
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
Benutzername: {{ form.username }} <br>
Passwort: {{ form.password }} <br>
<button type="submit" class="btn btn-default">Anmelden</button>
<input type="hidden" name="next" value="{{ next }}">
</form>
</div>
{% endblock %}