-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout des pages légales à l'assistant (#1212)
* add legal pages to assistant * add to footer * Add to env * merge migrations * squash migrations
- Loading branch information
1 parent
671b082
commit ecaaabb
Showing
11 changed files
with
180 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Generated by Django 5.1.4 on 2025-01-14 13:05 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def import_cms_pages(apps, schema_editor): | ||
CMSPage = apps.get_model("qfdmd", "CMSPage") | ||
ids = [223, 221, 226, 222, 230] | ||
for index, id in enumerate(ids): | ||
page, created = CMSPage.objects.update_or_create( | ||
id=id, defaults={"poids": index} | ||
) | ||
# Ensure the fields are populated | ||
page.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("qfdmd", "0028_remove_lien_poids"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="CMSPage", | ||
fields=[ | ||
( | ||
"id", | ||
models.IntegerField( | ||
help_text="Ce champ est le seul contribuable.<br>Il correspond à l'ID de la page Wagtail.<br>Tous les autres champs seront automatiquement contribués à l'enregistrementde la page dans l'administration Django.", | ||
primary_key=True, | ||
serialize=False, | ||
), | ||
), | ||
("body", models.JSONField(default=dict)), | ||
("search_description", models.CharField(default="")), | ||
("seo_title", models.CharField(default="")), | ||
("title", models.CharField(default="")), | ||
("slug", models.CharField(default="")), | ||
("poids", models.IntegerField(default=0)), | ||
], | ||
), | ||
migrations.RunPython(import_cms_pages, migrations.RunPython.noop), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated by Django 5.1.4 on 2025-01-14 17:28 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"qfdmd", | ||
"0029_alter_produit_filieres_rep_and_more_squashed_0030_alter_produitlien_poids", | ||
), | ||
("qfdmd", "0029_cmspage"), | ||
] | ||
|
||
operations = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
{% extends "dsfr/footer.html" %} | ||
|
||
{% block footer_links %} | ||
{% for page in footer_pages %} | ||
<li class="fr-footer__bottom-item"> | ||
<a class="fr-footer__bottom-link" href="{% url 'qfdmd:cms-page' page.slug %}"> | ||
{{ page.title }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
{% endblock footer_links %} | ||
{% load static %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "qfdmd/base.html" %} | ||
|
||
{% block analytics_action %}produitPageView{% endblock %} | ||
|
||
{% block title %} | ||
{{ block.super }} | {{ object.seo_title }} | ||
{% endblock title %} | ||
|
||
{% block meta_description %}{{ object.search_description|default:block.super }}{% endblock %} | ||
|
||
{% block main %} | ||
<article | ||
class="qf-flex qf-flex-col | ||
qf-gap-4w max-lg:qf-pr-0 max-xl:qf-pr-6w" | ||
> | ||
<header class="qf-mt-3w md:qf-mt-5w"> | ||
<h1 class="qf-m-0"> | ||
{{ object.title|capfirst }} | ||
</h1> | ||
</header> | ||
<div> | ||
|
||
{% for block in object.body %} | ||
{{ block.value|safe }} | ||
{% endfor %} | ||
</div> | ||
|
||
</article> | ||
{% endblock main %} |