Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Le retour des liens sur les cartes #42

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions content_manager/templates/content_manager/blocks/card.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% load wagtailimages_tags wagtailcore_tags %}
<div class="fr-card{% if block.value.url or block.value.document %} fr-enlarge-link{% endif %}">
<div class="fr-card__body">
<div class="fr-card__content">
<h3 class="fr-card__title">
{% if block.value.url %}
<a href="{{ block.value.url }}">
{% elif block.value.document %}
<a href="{{ block.value.document.url }}">
{% endif %}
{{ block.value.title }}
{% if block.value.url or block.value.document.url %}</a>{% endif %}
</h3>
<p class="fr-card__desc">{{ block.value.text|linebreaksbr }}</p>
</div>
</div>
<div class="fr-card__header">
{% if block.value.image %}
<div class="fr-card__img">{% image block.value.image original class="fr-responsive-img" %}</div>
{% endif %}
{% if block.value.badge_text %}
<ul class="fr-badges-group">
<li>
<p class="fr-badge fr-badge--{{ block.value.badge_level }}{% if block.value.badge_icon %} fr-badge--no-icon{% endif %}">
{{ block.value.badge_text }}
</p>
</li>
</ul>
{% endif %}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ <h2>{{ subblock.value.title }}</h2>
</div>
</div>
{% elif subblock.block_type == 'card' %}
<div class="fr-col-12 fr-col-sm">
{% image subblock.value.image original as img %}
{% if subblock.value.document %}
{% dsfr_card title=subblock.value.title description=subblock.value.description link=subblock.value.document.url image_url=img.url %}
{% else %}
{% dsfr_card title=subblock.value.title description=subblock.value.description link=subblock.value.url image_url=img.url %}
{% endif %}
</div>
<div class="fr-col-12 fr-col-sm">{% include "content_manager/blocks/card.html" with block=subblock %}</div>
{% elif subblock.block_type == 'quote' %}
<div class="fr-col-12 fr-col-sm">
{% image subblock.value.image original as img %}
Expand Down