Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add a label to the forms rendered with our custom tag

Roland Geider9bfbc4bdca96
diff --git a/manager/templates/tags/yaml_form_element.html b/manager/templates/tags/yaml_form_element.html
index 404b0169c..29fd0497c 100644
--- a/manager/templates/tags/yaml_form_element.html
+++ b/manager/templates/tags/yaml_form_element.html
@@ -2,14 +2,16 @@
<tr id="form-{{field.name}}">
<td style="text-align:right;">
{% if field.errors %}<div class="ym-fbox-text ym-error"><span class="ym-message">{% endif %}
+ <label for="{{field.auto_id}}">
{% trans field.label %}
+ </label>
{% if field.errors %}</span></div>{% endif %}
</td>
<td>
<div class="{{css_class}} {% if field.errors %}ym-error{% endif %}">
{{ field }}
</div>
-
+
{% if field.errors %}
<div class="ym-fbox-text ym-error">
{% for error in field.errors %}
@@ -17,7 +19,7 @@
{% endfor %}
</div>
{% endif %}
-
+
{% if field.help_text %}<p class="dimmed">{% trans field.help_text %}</p>{% endif %}
</td>
</tr>