Skip to content

Commit

Permalink
🎨 [#1617] Fixed labels for correct HTML syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Aug 17, 2023
1 parent c494770 commit c6ce805
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load l10n form_tags %}

<label class="radio">
<div class="radio">
{% spaceless %}
{% initial_match as checked %}
<input
Expand All @@ -13,4 +13,4 @@
/>
<label class="radio__label" for="id_{{ name }}_{{ index }}">{{ choice.1 }}</label>
{% endspaceless %}
</label>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="form__control {{ extra_classes|default:"" }}">
<label class="label {% if no_label %}label--gapless{% endif %}">
{% if icon %}{% icon icon outlined=True %}{% endif %}
<label class="label__label {% if no_label %}label__label--hidden{% endif %}">
<span class="label__label {% if no_label %}label__label--hidden{% endif %}">
{{ field.label }}
{% if field.field.required %}<span class="label__label--required"> * </span>{% endif %}
</label>
</span>
{{ field|addclass:"input" }}
{% if field.help_text and not no_help %}
<p class="p">{{ field.help_text }}</p>
Expand Down
27 changes: 0 additions & 27 deletions src/open_inwoner/components/templates/components/Form/Label.html

This file was deleted.

5 changes: 5 additions & 0 deletions src/open_inwoner/scss/components/Card/Card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
.form .caption__content {
color: var(--color-tinted-mute);
}

.card__body--direction-horizontal .link .link__text {
text-align: right;
padding-left: var(--spacing-small);
}
}

&__img {
Expand Down
3 changes: 2 additions & 1 deletion src/open_inwoner/scss/components/Form/MultiCheckbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
margin: 0;
gap: 18px;

label {
label,
.label {
display: flex;
flex-direction: row;
gap: 10px;
Expand Down
8 changes: 4 additions & 4 deletions src/open_inwoner/templates/pages/plans/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ <h1 class="h1">{% trans "Start nieuwe samenwerking" %}</h1>
<div>{% trans "Doel" %}</div>
<div></div>
</div>
<label class="plan-template__row radio">
<div class="label plan-template__row radio">
<div>
<input class="radio__input" type="radio" name="template" value="" id="id_template_0" {% if not form.data.template %}checked{% endif %}>
<label class="radio__label" for="id_template_0">Geen template</label>
</div>
<div></div>
<div></div>
</label>
</div>
{% for tpl_id, plan_template in form.template.field.choices %}
<label class="plan-template__row radio">
<div class="label plan-template__row radio">
<div>
<input class="radio__input" type="radio" name="template" value="{{ plan_template.id }}" id="id_template_{{ plan_template.id }}"
{% if tpl_id == form.data.template %}checked{% endif %}>
Expand All @@ -60,7 +60,7 @@ <h2 class="h2 modal__title" id="modal__title">{{ plan_template.name }}
</div>
</div>
</div>
</label>
</div>
{% endfor %}
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<input type="{{ widget.type }}" name="{{ widget.name }}" data-init="{{ widget.value|default:'' }}"{% include "django/forms/widgets/attrs.html" %}>
<label>
<span>
<input type="text" name="{{ widget.init_name }}" id="{{ widget.init_id }}" {% if widget.value %} value="{{ widget.value.instance.uuid }}"{% endif %} class="message-file__init">
</label>
</span>

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ url }}">{{ widget.value }}</a>{% if not widget.required %}
<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"{% if widget.attrs.disabled %} disabled{% endif %}>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
<span for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</span>{% endif %}<br>
{{ widget.input_text }}:{% endif %}
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>

0 comments on commit c6ce805

Please sign in to comment.