Ajout d'un pied de page

This commit is contained in:
Edgar P. Burkhart 2024-06-14 16:03:02 +02:00
parent 7794003791
commit 5df074612a
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
6 changed files with 36 additions and 3 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 5.0.6 on 2024-06-14 13:59
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("base", "0002_sitesettings_title"),
]
operations = [
migrations.AddField(
model_name="sitesettings",
name="footer",
field=wagtail.fields.RichTextField(blank=True),
),
]

View file

@ -1,6 +1,7 @@
from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
from wagtail.fields import RichTextField
@register_setting
@ -13,8 +14,10 @@ class SiteSettings(BaseSiteSetting):
null=True,
blank=True,
)
footer = RichTextField(blank=True)
panels = [
FieldPanel("title"),
FieldPanel("logo"),
FieldPanel("footer"),
]

View file

@ -16,3 +16,11 @@ strong {
nav img {
height: 2rem;
}
footer {
text-align: center;
--pico-font-weight: 500;
}
footer > :last-child {
margin-bottom: 0;
}

View file

@ -37,6 +37,7 @@
<main class="container">
{% block content %}{% endblock %}
</main>
{% include "footer.html" %}
{# Global javascript #}
<script type="text/javascript" src="{% static 'js/blog.js' %}"></script>
{% block extra_js %}{# Override this in templates to add extra javascript #}{% endblock %}

View file

@ -0,0 +1,6 @@
{% load wagtailcore_tags %}
{% if settings.base.SiteSettings.footer %}
<footer class="container">
{{ settings.base.SiteSettings.footer|richtext }}
</footer>
{% endif %}

View file

@ -10,7 +10,4 @@
</li>
{% endif %}
</ul>
<ul>
<li>Lien</li>
</ul>
</nav>