Created
November 20, 2013 14:23
-
-
Save jacoor/7564019 to your computer and use it in GitHub Desktop.
Snippets of django form fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load i18n %} | |
{% if f %} | |
<li class="form-field {% if forloop and forloop.counter|divisibleby:2 %}even{% endif %} {{f.auto_id }} {{f.field.widget.attrs.li_class}} {% if f.errors %} invalid error{% endif %}"> | |
{% if f.field.before %} | |
<span class="before">{{f.field.before}}</span> | |
{% endif %} | |
{% if f.field.or_divider %} | |
<div class="or-divider-container"><div class="or-divider">{% trans "or" %}</div></div> | |
{% endif %} | |
{% if f.help_text and tooltip %} | |
<div class="input_wrapper with_tooltip show_tooltip"> | |
{% endif %} | |
{% if f.label %} | |
{{f.label_tag}} | |
{% endif %} | |
{{f}} | |
{% if f.help_text and tooltip %} | |
<span class="tooltip_marker">?</span> | |
{% endif %} | |
{% if not no_errors %} | |
{% if f.errors %} | |
<small>{{f.errors}}</small> | |
{% endif %} | |
{% endif %} | |
{% if f.help_text and not tooltip %} | |
<span class="help_text {{f.field.widget.attrs.help_text_class}}"> | |
{{f.help_text|safe}} | |
</span> | |
{% endif %} | |
{% if f.help_text and tooltip %} | |
</div> | |
{% endif %} | |
{% if f.help_text and tooltip %} | |
{{f.help_text|safe}} | |
{% endif %} | |
</li> | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="form-field {{f.auto_id }} {{f.field.widget.attrs.li_class}} {% if f.errors %} invalid error{% endif %}"> | |
<label for="{{ f.auto_id }}">{{ f.label }} | |
{% if f.field.required %}<span class="required">*</span>{% endif %} | |
</label> | |
{{f}} | |
{% if f.errors %} | |
<small>{{f.errors}}</small> | |
{% endif %} | |
{% if f.help_text %} | |
<span class="help_text {{f.field.widget.attrs.help_text_class}}"> | |
{{f.help_text|safe}} | |
</span> | |
{% endif %} | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="row form-field {{f.auto_id }} {{f.field.widget.attrs.li_class}} {% if f.errors %} invalid error{% endif %}"> | |
{% if f.label %} | |
<div class="{% if label_columns %} {{label_columns}} {% else %}columns large-4{% endif%}"> | |
{% include "inc/forms/label_with_class.html" with class="inline" %} | |
</div> | |
{% endif %} | |
<div class="{% if input_columns %} {{input_columns}} {% else %}columns large-8{% endif %} {% if not f.errors %}pull-4{% endif %}"> | |
{{f}} | |
</div> | |
{% if f.errors %} | |
<div class="columns large-4">{{f.errors}}</div> | |
{% endif %} | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label for="{{f.auto_id}}" class="{{class}}">{{f.label|safe}}</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment