form_fields.html 912 B

12345678910111213141516171819202122232425262728293031
  1. {% load i18n %}
  2. {% load mezzanine_tags %}
  3. {% nevercache %}
  4. <input type="hidden" name="referrer" value="{{ request.META.HTTP_REFERER }}">
  5. {% csrf_token %}
  6. {% endnevercache %}
  7. {% for field in form_for_fields %}
  8. {% if field.is_hidden %}
  9. {{ field }}
  10. {% else %}
  11. <div class="form-group input_{{ field.id_for_label }} {{ field.field.type }}
  12. {% if field.errors %} has-error{% endif %}">
  13. {% if field.label %}<label class="control-label" for="{{ field.auto_id }}">{{ field.label }}</label>{% endif %}
  14. {{ field }}
  15. {% if field.errors %}
  16. <p class="help-block">
  17. {% for e in field.errors %}
  18. {% if not forloop.first %} / {% endif %}{{ e }}
  19. {% endfor %}
  20. </p>
  21. {% elif field.help_text %}
  22. <p class="help-block">{{ field.help_text }}</p>
  23. {% elif field.field.required %}
  24. <p class="help-block">{% trans "required" %}</p>
  25. {% endif %}
  26. </div>
  27. {% endif %}
  28. {% endfor %}