-
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.
- add Consent management views and template - add JavaScript functionality to select/uncheck all checkboxes in consent forms - enhance the admin interface - add test - add migration to proxy_for symmetrical=False
- Loading branch information
Showing
18 changed files
with
872 additions
and
48 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
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
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 @@ | ||
/** | ||
* check/uncheck all checkbox in consent form | ||
*/ | ||
document.getElementById("toggle-all") | ||
.addEventListener("change", function() { | ||
const checkboxes = document.getElementsByName("status"); | ||
checkboxes.forEach(checkbox => checkbox.checked = this.checked); | ||
}); |
9 changes: 0 additions & 9 deletions
9
src/dashboard/apps/consent/templates/consent/consent-management.html
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/dashboard/apps/consent/templates/consent/includes/_resume_awaiting_consents.html
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,29 @@ | ||
{% load i18n %} | ||
|
||
{% if awaiting %} | ||
<h2> | ||
{% trans "Consents summary" %} | ||
</h2> | ||
|
||
<p> | ||
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{% url "consent:manage" %}"> | ||
<strong> | ||
{% trans "Validate content for all entities" %} | ||
</strong> | ||
</a> | ||
</p> | ||
|
||
<ul> | ||
{% for entity in awaiting %} | ||
<li> | ||
<strong>{{ entity.name }}</strong> | ||
<br /> | ||
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{% url "consent:manage" entity.slug %}"> | ||
{% blocktranslate with entity_count=entity.dcount pluralize=entity.dcount|pluralize %} | ||
{{ entity_count }} consent{{ pluralize }} to validate for this entity | ||
{% endblocktranslate %} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} |
17 changes: 17 additions & 0 deletions
17
src/dashboard/apps/consent/templates/consent/includes/_resume_validated_consents.html
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 @@ | ||
{% load i18n %} | ||
|
||
{% if validated %} | ||
<h2>{% trans "Validated entities" %}</h2> | ||
|
||
<ul> | ||
{% for entity in validated %} | ||
<li> | ||
<strong>{{ entity.name }}</strong> | ||
<br /> | ||
{% blocktranslate with entity_count=entity.dcount pluralize=entity.dcount|pluralize %} | ||
{{ entity_count }} consent{{ pluralize }} validated | ||
{% endblocktranslate %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% 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
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,67 @@ | ||
{% extends "home/base.html" %} | ||
|
||
{% load i18n static %} | ||
|
||
{% block content %} | ||
<h2>{% trans "Manage consents" %}</h2> | ||
|
||
{% if consents %} | ||
<form action="" method="post"> | ||
{% csrf_token %} | ||
<fieldset class="fr-fieldset" id="checkboxes" aria-labelledby="checkboxes-legend checkboxes-messages"> | ||
|
||
<legend class="fr-fieldset__legend--regular fr-fieldset__legend" | ||
id="checkboxes-legend"> {% trans "Legend for all elements" %} | ||
</legend> | ||
|
||
<div class="fr-fieldset__element"> | ||
<div class="fr-checkbox-group"> | ||
<input type="checkbox" id="toggle-all" name="toggle-all" | ||
aria-describedby="toggle-all-1-messages" | ||
data-fr-js-checkbox-input="true" | ||
data-fr-js-checkbox-actionee="true"> | ||
<label class="fr-label" for="toggle-all">{% trans "Toggle All" %}</label> | ||
</div> | ||
</div> | ||
|
||
{% for dp in consents %} | ||
{% ifchanged dp.delivery_point.entity.name %} | ||
<strong>{{ dp.delivery_point.entity.name }}</strong> | ||
{% endifchanged %} | ||
|
||
<div class="fr-fieldset__element"> | ||
<div class="fr-checkbox-group"> | ||
<input type="checkbox" | ||
name="status" | ||
value="{{ dp.id }}" | ||
id="{{ dp.id }}" | ||
{% if dp.status == "VALIDATED" %} checked{% endif %} | ||
aria-describedby="{{ dp.id }}-messages" | ||
data-fr-js-checkbox-input="true" | ||
data-fr-js-checkbox-actionee="true" | ||
> | ||
<label class="fr-label" for="{{ dp.id }}">{{ dp.delivery_point.provider_assigned_id }}</label> | ||
<div class="fr-messages-group" id="{{ dp.id }}-messages" aria-live="assertive"></div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
|
||
<div class="fr-messages-group" id="checkboxes-messages" aria-live="assertive"> | ||
{{ field.errors }} | ||
</div> | ||
</fieldset> | ||
|
||
<button class="fr-btn" type="submit" name="submit"> {% trans "submit" %} </button> | ||
</form> | ||
|
||
{% else %} | ||
<p>{% trans "No consents to validate" %}</p> | ||
{% endif %} | ||
{% endblock content %} | ||
|
||
{% block extra_dashboard_js %} | ||
{% if consents %} | ||
<script src="{% static 'consent/js/app.js' %}"> | ||
</script> | ||
{% endif %} | ||
{% endblock extra_dashboard_js %} |
Oops, something went wrong.