Ajout d'un pied de page
This commit is contained in:
parent
7794003791
commit
5df074612a
6 changed files with 36 additions and 3 deletions
18
blog/base/migrations/0003_sitesettings_footer.py
Normal file
18
blog/base/migrations/0003_sitesettings_footer.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,6 +1,7 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from wagtail.admin.panels import FieldPanel
|
from wagtail.admin.panels import FieldPanel
|
||||||
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
|
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
|
||||||
|
from wagtail.fields import RichTextField
|
||||||
|
|
||||||
|
|
||||||
@register_setting
|
@register_setting
|
||||||
|
@ -13,8 +14,10 @@ class SiteSettings(BaseSiteSetting):
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
footer = RichTextField(blank=True)
|
||||||
|
|
||||||
panels = [
|
panels = [
|
||||||
FieldPanel("title"),
|
FieldPanel("title"),
|
||||||
FieldPanel("logo"),
|
FieldPanel("logo"),
|
||||||
|
FieldPanel("footer"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -16,3 +16,11 @@ strong {
|
||||||
nav img {
|
nav img {
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
text-align: center;
|
||||||
|
--pico-font-weight: 500;
|
||||||
|
}
|
||||||
|
footer > :last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<main class="container">
|
<main class="container">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
|
{% include "footer.html" %}
|
||||||
{# Global javascript #}
|
{# Global javascript #}
|
||||||
<script type="text/javascript" src="{% static 'js/blog.js' %}"></script>
|
<script type="text/javascript" src="{% static 'js/blog.js' %}"></script>
|
||||||
{% block extra_js %}{# Override this in templates to add extra javascript #}{% endblock %}
|
{% block extra_js %}{# Override this in templates to add extra javascript #}{% endblock %}
|
||||||
|
|
6
blog/blog/templates/footer.html
Normal file
6
blog/blog/templates/footer.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{% load wagtailcore_tags %}
|
||||||
|
{% if settings.base.SiteSettings.footer %}
|
||||||
|
<footer class="container">
|
||||||
|
{{ settings.base.SiteSettings.footer|richtext }}
|
||||||
|
</footer>
|
||||||
|
{% endif %}
|
|
@ -10,7 +10,4 @@
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
|
||||||
<li>Lien</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in a new issue