Skip to content

Commit 17c86c4

Browse files
committed
[#2137] Added disabled pseudo-checkbox for notifications
1 parent 0e0fb79 commit 17c86c4

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

src/open_inwoner/accounts/templates/accounts/registration_necessary.html

+8-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ <h1 class="h1">{% trans "Registratie voltooien" %}</h1><br>
1616
{% autorender_field form field %}
1717
{% endfor %}
1818

19-
{# pseudo checkbox for notifications that cannot be disabled #}
20-
<div class="checkbox">
21-
<input type="checkbox" id="id_cases_notifications_action_required" name="cases_notifications_action_required" disabled="" class="checkbox__input checkbox__input--disabled" checked="">
22-
<label class="checkbox__label" for="id_cases_notifications_action_required">{% trans "Zaaknotificaties - action required" %}</label>
23-
<p class="p">{% trans "E-mail notifications for case updates that require action (cannot be disabled)" %}</p>
24-
</div>
19+
<div class="form__control">
20+
{# pseudo checkbox for notifications that cannot be disabled #}
21+
<div class="checkbox">
22+
<span role="checkbox" aria-disabled="true" aria-checked="true" class="checkbox__input checkbox__pseudo checkbox__input--disabled" aria-labelledby="id_cases_notifications_action_required" tabindex="0"></span>
23+
<span class="checkbox__label checkbox__pseudo-label" id="id_cases_notifications_action_required">{% trans "Zaaknotificaties - action required" %}</span>
24+
<p class="p">{% trans "E-mail notifications for case updates that require action (cannot be disabled)" %}</p>
25+
</div>
26+
</div>
2527

2628
{% form_actions primary_icon='arrow_forward' primary_text="Verzenden" %}
2729
</form>

src/open_inwoner/scss/components/Form/Checkbox.scss

+23
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
border-radius: 1px; // intended-var-change.
3636
background-color: var(--color-white);
3737
}
38+
39+
&.checkbox__pseudo-label {
40+
padding-left: calc(var(--gutter-width) + 4px);
41+
}
3842
}
3943

4044
.checkbox__input:checked ~ .checkbox__label:before {
@@ -51,4 +55,23 @@
5155
font-family: 'Material Icons';
5256
content: '\e876';
5357
}
58+
59+
/// Mimic checked-styles for pseudo checkboxes
60+
61+
&__pseudo ~ .checkbox__label:before {
62+
background-color: var(--color-secondary);
63+
color: var(--color-font-secondary);
64+
font-family: 'Material Icons';
65+
left: 4px;
66+
content: '\e876';
67+
}
68+
69+
&__pseudo.checkbox__input--disabled ~ .checkbox__label:before {
70+
border-color: var(--color-gray) !important;
71+
background-color: var(--color-gray);
72+
color: var(--color-white);
73+
font-family: 'Material Icons';
74+
left: 3px;
75+
content: '\e876';
76+
}
5477
}

src/open_inwoner/templates/pages/profile/notifications.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ <h1 class="h1" id="title">
1616
{% autorender_field form field %}
1717
{% endfor %}
1818

19-
{# pseudo checkbox for notifications that cannot be disabled #}
20-
<div class="checkbox">
21-
<input type="checkbox" id="id_cases_notifications_action_required" name="cases_notifications_action_required" disabled="" class="checkbox__input checkbox__input--disabled" checked="">
22-
<label class="checkbox__label" for="id_cases_notifications_action_required">{% trans "Zaaknotificaties - action required" %}</label>
23-
<p class="p">{% trans "E-mail notifications for case updates that require action (cannot be disabled)" %}</p>
19+
<div class="form__control">
20+
{# pseudo checkbox for notifications that cannot be disabled #}
21+
<div class="checkbox">
22+
<span role="checkbox" aria-disabled="true" aria-checked="true" class="checkbox__input checkbox__pseudo checkbox__input--disabled" aria-labelledby="id_cases_notifications_action_required" tabindex="0"></span>
23+
<span class="checkbox__label checkbox__pseudo-label" id="id_cases_notifications_action_required">{% trans "Zaaknotificaties - action required" %}</span>
24+
<p class="p">{% trans "E-mail notifications for case updates that require action (cannot be disabled)" %}</p>
25+
</div>
2426
</div>
2527

2628
{% form_actions primary_text=_("Opslaan") primary_icon="arrow_forward" secondary_href='profile:detail' secondary_text=_('Terug') secondary_icon_position="before" secondary_icon='arrow_backward' %}

0 commit comments

Comments
 (0)