-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fb6b62
commit 83644eb
Showing
6 changed files
with
165 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Generated by Django 4.2.13 on 2024-07-15 16:10 | ||
|
||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("wagtailcore", "0093_uploadedfile"), | ||
("cms", "0011_infocard"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="FAQPage", | ||
fields=[ | ||
( | ||
"page_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="wagtailcore.page", | ||
), | ||
), | ||
( | ||
"body", | ||
wagtail.fields.StreamField( | ||
[ | ||
( | ||
"faq_group", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"group_title", | ||
wagtail.blocks.CharBlock( | ||
help_text="Le titre du groupe de questions-réponses.", required=True | ||
), | ||
), | ||
( | ||
"faqs", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"question", | ||
wagtail.blocks.CharBlock( | ||
help_text="La question fréquemment posée.", | ||
required=True, | ||
), | ||
), | ||
( | ||
"answer", | ||
wagtail.blocks.RichTextBlock( | ||
help_text="La réponse à la question.", required=True | ||
), | ||
), | ||
] | ||
) | ||
), | ||
), | ||
] | ||
), | ||
) | ||
], | ||
blank=True, | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "FAQ Page", | ||
"verbose_name_plural": "FAQ Pages", | ||
}, | ||
bases=("wagtailcore.page",), | ||
), | ||
] |
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,7 @@ | ||
{% extends "layouts/base.html" %} | ||
{% block content %} | ||
<div class="container pt-2 faq-page"> | ||
<h1>{{ page.title }}</h1> | ||
{% for block in page.body %}{{ block }}{% endfor %} | ||
</div> | ||
{% endblock %} |
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,17 @@ | ||
<div class="card"> | ||
<div class="card-header" id="heading{{ faq_id }}"> | ||
<h2 class="mb-0"> | ||
<button class="btn btn-link" | ||
type="button" | ||
data-toggle="collapse" | ||
data-target="#collapse{{ faq_id }}" | ||
aria-expanded="true" | ||
aria-controls="collapse{{ faq_id }}">{{ self.question }}</button> | ||
</h2> | ||
</div> | ||
<div id="collapse{{ faq_id }}" | ||
class="collapse" | ||
aria-labelledby="heading{{ faq_id }}"> | ||
<div class="card-body">{{ self.answer }}</div> | ||
</div> | ||
</div> |
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,10 @@ | ||
{% load wagtailcore_tags %} | ||
<div class="faq-group mb-3"> | ||
<h3>{{ self.group_title }}</h3> | ||
<div class="accordion" id="accordion{{ group_id }}"> | ||
{% for faq in self.faqs %} | ||
{% comment %} <p>{{ faq.title }}</p> {% endcomment %} | ||
{% include_block faq with parent_id=group_id %} | ||
{% endfor %} | ||
</div> | ||
</div> |