-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #11625: Add HTMX support to ObjectEditView
- Loading branch information
1 parent
c3e04dc
commit a0e4019
Showing
4 changed files
with
65 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% load form_helpers %} | ||
|
||
{% if form.fieldsets %} | ||
|
||
{# Render hidden fields #} | ||
{% for field in form.hidden_fields %} | ||
{{ field }} | ||
{% endfor %} | ||
|
||
{# Render grouped fields according to Form #} | ||
{% for group, fields in form.fieldsets %} | ||
<div class="field-group mb-5"> | ||
{% if group %} | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">{{ group }}</h5> | ||
</div> | ||
{% endif %} | ||
{% for name in fields %} | ||
{% with field=form|getfield:name %} | ||
{% if not field.field.widget.is_hidden %} | ||
{% render_field field %} | ||
{% endif %} | ||
{% endwith %} | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
|
||
{% if form.custom_fields %} | ||
<div class="field-group mb-5"> | ||
<div class="row mb-2"> | ||
<h5 class="offset-sm-3">Custom Fields</h5> | ||
</div> | ||
{% render_custom_fields form %} | ||
</div> | ||
{% endif %} | ||
|
||
{% if form.comments %} | ||
<div class="field-group mb-5"> | ||
<h5 class="text-center">Comments</h5> | ||
{% render_field form.comments %} | ||
</div> | ||
{% endif %} | ||
|
||
{% else %} | ||
|
||
{# Render all fields in a single group #} | ||
<div class="field-group mb-5"> | ||
{% render_form form %} | ||
</div> | ||
|
||
{% endif %} |