Skip to content

Commit

Permalink
🚸(dashboard) add conditional entity check to consent templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorin committed Dec 10, 2024
1 parent e349f54 commit 509c97f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ <h3 class="fr-card__title">
<p class="fr-card__detail fr-icon-warning-fill">détail (optionnel)</p>
</div>
</div>

<div class="fr-card__footer">
{% if entities %}
<strong>{% trans "Validated consent for all entities" %}</strong>
<ul class="fr-links-group fr-mb-2w">
<li>
Expand All @@ -30,13 +32,14 @@ <h3 class="fr-card__title">
href="{% url "consent:manage" entity.slug %}" data-fr-js-link-actionee="true">
{{ entity.name }} :
{% blocktranslate with consent_total=entity.get_consents.count entity_count=entity.count_awaiting_consents pluralize=entity.count_awaiting_consents|pluralize %}
{{ entity_count }}/{{ consent_total }} consent{{ pluralize }} to validate for this entity
{{ entity_count }}/{{ consent_total }} consent{{ pluralize }} to validate
{% endblocktranslate %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ <h3 class="fr-card__title">
<p class="fr-card__detail fr-icon-warning-fill">détail (optionnel)</p>
</div>
</div>

<div class="fr-card__footer">
{% if entities %}
<ul class="fr-links-group">
{% for entity in entities %}
<li>
Expand All @@ -22,6 +24,7 @@ <h3 class="fr-card__title">
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/dashboard/apps/consent/templates/consent/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ <h2>{% trans "Manage consents" %}</h2>
<div class="consent-wrapper fr-py-6v fr-mb-6v">
<div class="consent-wrapper__inner">
{% for entity in entities %}
<fieldset class="fr-fieldset" id="checkboxes" aria-labelledby="checkboxes-legend checkboxes-messages">

<fieldset class="fr-fieldset" id="checkboxes" aria-labelledby="checkboxes-legend checkboxes-messages">
<legend class="fr-fieldset__legend--regular fr-fieldset__legend"
id="checkboxes-legend">{{ entity.name }}</legend>

Expand Down Expand Up @@ -59,7 +58,8 @@ <h2>{% trans "Manage consents" %}</h2>
{% endif %}
{% endblock dashboard_content %}

{% block dashboard_extra_js %}
<script src="{% static 'consent/js/app.js' %}">
</script>
{% block dashboard_extra_js %}
{% if entities %}
<script src="{% static 'consent/js/app.js' %}"></script>
{% endif %}
{% endblock dashboard_extra_js %}

0 comments on commit 509c97f

Please sign in to comment.