Skip to content

Commit 87226b3

Browse files
matteiusclaude
andcommitted
fix: respect widths on approval form + consistent Submission Data rows
approve.html was rendering approval_step_form and editable_form via the {{ form|crispy }} filter, which discards FormHelper.layout. The width-aware Row/Column/Div structure produced by ApprovalStepForm._build_layout_fields was ignored, so half/third/quarter fields rendered stacked full width. Switch the three call sites to the {% crispy form %} tag so the layout is honored — matching form-submit and form-embed. In _form_data_rows.html, full-width rows split the label and value into separate <th>/<td> cells while the pair/triple/quad variants stacked the label as a small heading above the value in a single cell. Full-width rows now use the same label-above-value pattern for visual consistency across the whole table. Bumps version to 0.72.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e8aba1b commit 87226b3

4 files changed

Lines changed: 26 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.72.1] - 2026-04-16
11+
12+
### Fixed
13+
- **Approval page now respects field widths on the approval step form.**
14+
`approve.html` was rendering `approval_step_form` (and `editable_form`
15+
where the stage allows edits) via the `{{ form|crispy }}` filter, which
16+
ignores `FormHelper.layout`. The width-aware `Row` / `Column` / `Div`
17+
layout built by `ApprovalStepForm._build_layout_fields` was discarded,
18+
so half / third / quarter-width fields rendered stacked full width.
19+
Switched the three call sites to the `{% crispy form %}` tag so the
20+
layout is honored, matching form-submit and form-embed.
21+
- **Consistent Submission Data row styling.** In
22+
`_form_data_rows.html`, full-width rows were splitting the label and
23+
value into separate `<th>` / `<td>` cells while half / third / quarter
24+
rows rendered the label as a small heading above the value in a single
25+
cell. Full-width rows now use the same label-above-value layout so
26+
every row in the table reads the same way regardless of width.
27+
1028
## [0.72.0] - 2026-04-16
1129

1230
### Changed (potentially breaking)

django_forms_workflows/templates/django_forms_workflows/_form_data_rows.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ <h5 class="mb-0">{{ row.label }}</h5>
3030
{% else %}
3131
{% with field=row.fields.0 %}
3232
<tr>
33-
<th style="width: 30%; vertical-align: top;">{{ field.label }}</th>
34-
<td>{% include "django_forms_workflows/_field_value.html" with entry=field %}</td>
33+
<td colspan="2" class="px-3 py-2">
34+
<small class="text-muted fw-semibold">{{ field.label }}</small>
35+
<div>{% include "django_forms_workflows/_field_value.html" with entry=field %}</div>
36+
</td>
3537
</tr>
3638
{% endwith %}
3739
{% endif %}

django_forms_workflows/templates/django_forms_workflows/approve.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ <h5 class="mb-0"><i class="bi bi-file-text"></i> Submission Data{% if allow_edit
170170
</div>
171171
<div class="card-body">
172172
{% if allow_edit_form_data and editable_form %}
173-
{{ editable_form|crispy }}
173+
{% crispy editable_form %}
174174
{% else %}
175175
<table class="table table-bordered table-sm">
176176
{% include "django_forms_workflows/_form_data_rows.html" %}
@@ -254,7 +254,7 @@ <h5 class="mb-0"><i class="bi bi-pencil-square"></i> {{ task.display_label }}
254254
</div>
255255
<div class="card-body">
256256
<p class="text-muted mb-4">Please review the submission above and fill in the required fields below.</p>
257-
{{ approval_step_form|crispy }}
257+
{% crispy approval_step_form %}
258258

259259
<hr class="my-4">
260260

@@ -355,7 +355,7 @@ <h5 class="mb-0"><i class="bi bi-file-text"></i> Submission Data{% if allow_edit
355355
</div>
356356
<div class="card-body">
357357
{% if allow_edit_form_data and editable_form %}
358-
{{ editable_form|crispy }}
358+
{% crispy editable_form %}
359359
{% else %}
360360
<table class="table table-bordered">
361361
{% include "django_forms_workflows/_form_data_rows.html" %}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-forms-workflows"
3-
version = "0.72.0"
3+
version = "0.72.1"
44
description = "Enterprise-grade, database-driven form builder with approval workflows and external data integration"
55
license = "LGPL-3.0-only"
66
readme = "README.md"

0 commit comments

Comments
 (0)