editable_form.html 1.0 KB

1234567891011121314151617181920212223242526272829
  1. {% load i18n %}
  2. {# Edit form #}
  3. <form style="display:none;" class="editable-form" method="post"
  4. action="{% url "edit" %}" id="{{ editable_form.uuid }}"
  5. {% if editable_form.is_multipart %} enctype="multipart/form-data"{% endif %}>
  6. {% csrf_token %}
  7. {% for field in editable_form %}
  8. <p{% if field.is_hidden %} style="display:none;"{% endif %}>
  9. {{ field.label_tag }}<br />{{ field }}{{ field.errors }}
  10. {% if field.help_text %}
  11. <span class="helptext">{{ field.help_text }}</span>
  12. {% endif %}
  13. </p>
  14. {% endfor %}
  15. <input type="submit" value="{% trans "Save" %}" class="btn btn-primary btn-lg">
  16. <input type="button" value="{% trans "Cancel" %}" class="btn btn-default btn-lg">
  17. </form>
  18. {# Original content wrapped in span #}
  19. <div class="editable-original">{{ original }}</div>
  20. {# Edit link #}
  21. <a style="visibility:hidden;" class="editable-link" href="#"
  22. rel="#{{ editable_form.uuid }}">{% trans "Edit" %}</a>
  23. {# Edit highlight #}
  24. <div style="visibility:hidden;" class="editable-highlight"></div>