Commits

Julian Brost committed 0089580

Fixed HTML validation errors on user settings page.

Comments (0)

Files changed (2)

MoinMoin/templates/forms.html

     {{ gen.label(field) }}
   </dt>
   <dd>
-    {{ gen.input(field, type=field_type) }}
+    {% if field_type == 'checkbox' %}
+      {#
+      Flatland adds the value to the ID of checkboxes which we do not want as
+      the for attributes of the labels will point to a non-existent ID in that
+      case. To fix this we manually generate the ID for checkboxes here.
+      related issue in flatland: https://bitbucket.org/jek/flatland/issue/9
+      #}
+      {{ gen.input(field, type='checkbox', id='f_' + field.flattened_name()) }}
+    {% else %}
+      {{ gen.input(field, type=field_type) }}
+    {% endif %}
     {{ render_errors(field) }}
   </dd>
 {% endmacro %}

MoinMoin/templates/usersettings_forms.html

     {{ forms.render_select(gen, form['theme_name']) }}
     {{ forms.render_field(gen, form['css_url'], 'url') }}
     {{ forms.render_field(gen, form['edit_rows'], 'text') }}
-    {{ forms.render_field(gen, form['results_per_page'], 'number') }}
+    {{ forms.render_field(gen, form['results_per_page'], 'text') }}
 </dl>
 {{ forms.render_hidden('part', 'ui') }}
 {{ forms.render_button(_("Save")) }}