Introduce base_main.html for <main>

This commit is contained in:
Benjamin 2022-12-21 20:57:45 +01:00
parent 1cc8f602a8
commit 2acfcb29e9
3 changed files with 28 additions and 4 deletions

24
templates/base_main.html Normal file
View file

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block head %}
{% load static %}
{% endblock %}
{% block body %}
<nav>
<ul>
{% if user.is_authenticated %}
<li><a href="#">Account</a></li>
{% else %}
<li><a href="{% url 'login' %}">Login</a></li>
<li><a href="{% url 'new-user' %}">Create account</a></li>
{% endif %}
</ul>
</nav>
<main>
{% block main %}
{% endblock %}
</main>
{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% extends "base_main.html" %}
{% block body %}
{% block main %}
{% if form.errors %}
<section>

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% extends "base_main.html" %}
{% block body %}
{% block main %}
{% if form.errors %}
<section>
<h2>Error:</h2>