Better visual error display. Fixes issue #13

This commit is contained in:
Martin Mahner 2013-03-28 21:45:32 +01:00
parent 2996bb9a3b
commit 16b4f0fc0a

View file

@ -5,17 +5,25 @@
{{ snippet_form.non_field_errors }} {{ snippet_form.non_field_errors }}
<div style="display: none;">{{ snippet_form.title }}</div> <div style="display: none;">{{ snippet_form.title }}</div>
<div class="control-group form-content {% if is_new %}autofocus{% endif %}"> <div class="
control-group
form-content
{% if is_new %}autofocus{% endif %}
{% if snippet_form.content.errors %}error{% endif %}
">
{{ snippet_form.content }} {{ snippet_form.content }}
</div> </div>
<div class="control-group form-options"> <div class="control-group form-options">
<div class="form-options-lexer"> <div class="form-options-lexer
{{ snippet_form.lexer.errors }} {% if snippet_form.lexer.errors %}control-group error{% endif %}">
<div class="input-append"> <div class="input-append">
{{ snippet_form.lexer }} {{ snippet_form.lexer }}
<button class="btn" id="guess_lexer_btn" type="button">{% trans "Guess lexer" %}</button> <button class="btn" id="guess_lexer_btn" type="button">{% trans "Guess lexer" %}</button>
</div> </div>
{% for error in snippet_form.lexer.errors %}
<span class="help-inline">{{ error }}</span>
{% endfor %}
</div> </div>
<div class="form-options-expire"> <div class="form-options-expire">
{{ snippet_form.expire_options.errors }} {{ snippet_form.expire_options.errors }}