-
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.
feat(DDB): ajout d'un fragement wagtail pour info bulle des structures (
#1213) Co-authored-by: Sébastien Reuiller <[email protected]>
- Loading branch information
1 parent
1daf3b8
commit 8a5151c
Showing
5 changed files
with
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 4.2.10 on 2024-05-14 16:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cms", "0010_remove_homepage_banner_cta_id_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="InfoCard", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("title", models.CharField(max_length=255, verbose_name="Titre de l'encart")), | ||
( | ||
"slug", | ||
models.SlugField( | ||
allow_unicode=True, | ||
help_text="A slug to identify this info card", | ||
max_length=255, | ||
verbose_name="slug", | ||
), | ||
), | ||
("content_card", models.TextField(verbose_name="Contenu")), | ||
], | ||
options={ | ||
"verbose_name": "Carte info", | ||
"verbose_name_plural": "Cartes infos", | ||
}, | ||
), | ||
] |
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,17 @@ | ||
from django import template | ||
|
||
from lemarche.cms.snippets import InfoCard | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
# Advert snippets | ||
@register.inclusion_tag("cms/snippets/_info_card_snippet.html", takes_context=True) | ||
def cms_info_card(context): | ||
# we use only the last for now | ||
info_card = InfoCard.objects.last() | ||
return { | ||
"info_card": info_card, | ||
"request": context["request"], | ||
} |
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,8 @@ | ||
{% if info_card %} | ||
<div class="alert alert-info "> | ||
<p> | ||
<b><i class="ri-information-line"></i> Conseil</b> | ||
</p> | ||
{{info_card.content_card|linebreaks}} | ||
</div> | ||
{% endif %} |
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