form.html 904 B

1234567891011121314151617181920212223242526272829303132
  1. {% extends "base.html" %}
  2. {% block content %}
  3. <h2>
  4. {% if request.path == '/add/' %}
  5. Добавить
  6. {% else %}
  7. Редактировать
  8. {% endif %}
  9. заметку
  10. </h2>
  11. <form class="form-horizontal" method="post">
  12. {% csrf_token %}
  13. {% include "includes/errors.html" %}
  14. <fieldset>
  15. <legend>{{ title }}</legend>
  16. {% for field in form %}
  17. <div class="control-group">
  18. <label class="control-label">{{ field.label }}</label>
  19. <div class="controls">
  20. {{ field }}
  21. {% if field.help_text %}
  22. <p class="help-inline"><small>{{ field.help_text }}</small></p>
  23. {% endif %}
  24. </div>
  25. </div>
  26. {% endfor %}
  27. </fieldset>
  28. <div class="form-actions">
  29. <button type="submit" class="btn btn-primary" >Сохранить</button>
  30. </div>
  31. </form>
  32. {% endblock %}