Sitecof : Champ libre dans directoryentry

This commit is contained in:
Evarin 2020-08-29 23:15:28 +02:00
parent 7db75c0060
commit 74b9721fbd
3 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,30 @@
# Generated by Django 2.2.15 on 2020-08-29 21:14
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('cofcms', '0003_directory_entry_optional_links'),
]
operations = [
migrations.AlterField(
model_name='cofdirectoryentrypage',
name='links',
field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True),
),
migrations.AlterField(
model_name='cofdirectoryentrypage',
name='links_en',
field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True, null=True),
),
migrations.AlterField(
model_name='cofdirectoryentrypage',
name='links_fr',
field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True, null=True),
),
]

View file

@ -193,6 +193,15 @@ class COFDirectoryEntryPage(Page):
]
),
),
(
"info",
blocks.StructBlock(
[
("nom", blocks.CharBlock(required=False)),
("texte", blocks.CharBlock(required=True)),
]
),
),
],
blank=True,
)

View file

@ -35,8 +35,10 @@
<li>
{% if block.block_type == "lien" %}
<a href="{{ block.value.url }}">{{ block.value.texte }}</a>
{% elif block.block_type == "contact" %}
<span class="label">{{ block.value.texte }} :</span> <button data-mref="{{ block.value.email|obfuscate_mail }}" class="facteur">{% trans "Afficher l'adresse mail" %}</button>
{% else %}
{{ block.value.texte }} : <button data-mref="{{ block.value.email|obfuscate_mail }}" class="facteur">{% trans "Afficher l'adresse mail" %}</a>
{% if block.value.nom %}<span class="label">{{ block.value.nom }} :</span> {% endif %}{{ block.value.texte }}
{% endif %}
</li>
{% endfor %}