Skip to content

Commit 23e0079

Browse files
matteiusclaude
andcommitted
fix(pdf): honor show_help_text_in_detail in PDF output + release 0.74.18
The submission detail view rendered per-field help text under each label when show_help_text_in_detail was checked, but the PDF and bulk-PDF outputs ignored the flag entirely. _build_pdf_rows didn't carry help_text onto its per-field entry dict, so the templates had nothing to render. Added help_text to _build_pdf_rows, plus rendering hooks in submission_pdf.html and submission_bulk_pdf.html (main form table plus the approval-step section tables in both). Style matches the detail view: small italic line beneath the label. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0f68e98 commit 23e0079

5 files changed

Lines changed: 38 additions & 15 deletions

File tree

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [0.74.18] - 2026-05-04
11+
12+
### Fixed
13+
- **`show_help_text_in_detail` now applies to PDF output too.** The
14+
submission detail view honored the per-field flag (rendering help
15+
text in italics under the label) but the PDF and bulk-PDF templates
16+
did not — ``_build_pdf_rows`` never carried ``help_text`` onto the
17+
per-field entry dict, so the templates had nothing to render. Added
18+
``help_text`` to ``_build_pdf_rows``, plus rendering hooks in
19+
``submission_pdf.html`` and ``submission_bulk_pdf.html`` (main form
20+
table and approval-step section tables in both). Help text appears
21+
beneath the label in a smaller italic style, matching the detail
22+
view's treatment.
23+
1024
## [0.74.17] - 2026-05-04
1125

1226
### Changed

django_forms_workflows/templates/django_forms_workflows/submission_bulk_pdf.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
.col-label { width: 22%; }
5050
.col-value { width: 28%; }
5151
.data-table th { background-color: #f0f0f0; font-weight: bold; font-size: 8pt; color: #333; border: 1px solid #d0d0d0; padding: 3pt 6pt; text-align: left; vertical-align: top; }
52+
.data-table .field-help { font-size: 7pt; font-style: italic; color: #666; font-weight: normal; margin-top: 1pt; }
5253
.data-table td { font-size: 9pt; border: 1px solid #d0d0d0; padding: 3pt 6pt; vertical-align: top; }
5354
.data-table tr { page-break-inside: avoid; break-inside: avoid; }
5455
.section-row td { background-color: #e8f0f7 !important; color: #1a3a52; font-weight: bold; font-size: 8pt; letter-spacing: 0.3pt; text-transform: uppercase; padding: 4pt 6pt; border: 1px solid #b8ccd8; }
@@ -118,21 +119,21 @@
118119
<tr><td colspan="4" style="background: #f8f9fa; padding: 8pt;">{{ row.value|render_markdown }}</td></tr>
119120
{% elif row.type == 'pair' %}
120121
<tr>
121-
<th>{{ row.fields.0.label }}</th>
122+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
122123
<td>{% with v=row.fields.0.value %}{% if v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
123-
<th>{{ row.fields.1.label }}</th>
124+
<th>{{ row.fields.1.label }}{% if row.fields.1.help_text %}<div class="field-help">{{ row.fields.1.help_text }}</div>{% endif %}</th>
124125
<td>{% with v=row.fields.1.value %}{% if v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
125126
</tr>
126127
{% elif row.type == 'triple' %}
127128
{% for field in row.fields %}
128129
<tr>
129-
<th>{{ field.label }}</th>
130+
<th>{{ field.label }}{% if field.help_text %}<div class="field-help">{{ field.help_text }}</div>{% endif %}</th>
130131
<td colspan="3">{% with v=field.value %}{% if v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
131132
</tr>
132133
{% endfor %}
133134
{% else %}
134135
<tr>
135-
<th>{{ row.fields.0.label }}</th>
136+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
136137
<td colspan="3">{% with v=row.fields.0.value %}{% if v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
137138
</tr>
138139
{% endif %}
@@ -162,15 +163,15 @@
162163
<tr><td colspan="4" style="background: #f8f9fa; padding: 8pt;">{{ row.value|render_markdown }}</td></tr>
163164
{% elif row.type == 'pair' %}
164165
<tr>
165-
<th>{{ row.fields.0.label }}</th>
166+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
166167
<td>{% with v=row.fields.0.value %}{% if v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
167-
<th>{{ row.fields.1.label }}</th>
168+
<th>{{ row.fields.1.label }}{% if row.fields.1.help_text %}<div class="field-help">{{ row.fields.1.help_text }}</div>{% endif %}</th>
168169
<td>{% with v=row.fields.1.value %}{% if v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
169170
</tr>
170171
{% else %}
171172
{% for field in row.fields %}
172173
<tr>
173-
<th>{{ field.label }}</th>
174+
<th>{{ field.label }}{% if field.help_text %}<div class="field-help">{{ field.help_text }}</div>{% endif %}</th>
174175
<td colspan="3">{% with v=field.value %}{% if v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
175176
</tr>
176177
{% endfor %}

django_forms_workflows/templates/django_forms_workflows/submission_pdf.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@
9393
text-align: left;
9494
vertical-align: top;
9595
}
96+
.data-table .field-help {
97+
font-size: 7pt;
98+
font-style: italic;
99+
color: #666;
100+
font-weight: normal;
101+
margin-top: 1pt;
102+
}
96103
.data-table td {
97104
font-size: 9pt;
98105
border: 1px solid #d0d0d0;
@@ -265,23 +272,23 @@
265272

266273
{% elif row.type == 'pair' %}
267274
<tr>
268-
<th>{{ row.fields.0.label }}</th>
275+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
269276
<td>{% with v=row.fields.0.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:200px;max-height:80px;">{% elif v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
270-
<th>{{ row.fields.1.label }}</th>
277+
<th>{{ row.fields.1.label }}{% if row.fields.1.help_text %}<div class="field-help">{{ row.fields.1.help_text }}</div>{% endif %}</th>
271278
<td>{% with v=row.fields.1.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:200px;max-height:80px;">{% elif v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
272279
</tr>
273280

274281
{% elif row.type == 'triple' %}
275282
{% for field in row.fields %}
276283
<tr>
277-
<th>{{ field.label }}</th>
284+
<th>{{ field.label }}{% if field.help_text %}<div class="field-help">{{ field.help_text }}</div>{% endif %}</th>
278285
<td colspan="3">{% with v=field.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:360px;max-height:120px;">{% elif v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
279286
</tr>
280287
{% endfor %}
281288

282289
{% else %}
283290
<tr>
284-
<th>{{ row.fields.0.label }}</th>
291+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
285292
<td colspan="3">{% with v=row.fields.0.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:360px;max-height:120px;">{% elif v.filename %}{{ v.filename }}{% if v.size %} ({{ v.size|filesizeformat }}){% endif %}{% else %}{{ v }}{% endif %}{% endwith %}</td>
286293
</tr>
287294
{% endif %}
@@ -335,15 +342,15 @@ <h3 style="margin-top: 20px;">Attachments</h3>
335342
</tr>
336343
{% elif row.type == 'pair' %}
337344
<tr>
338-
<th>{{ row.fields.0.label }}</th>
345+
<th>{{ row.fields.0.label }}{% if row.fields.0.help_text %}<div class="field-help">{{ row.fields.0.help_text }}</div>{% endif %}</th>
339346
<td>{% with v=row.fields.0.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:200px;max-height:80px;">{% elif v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
340-
<th>{{ row.fields.1.label }}</th>
347+
<th>{{ row.fields.1.label }}{% if row.fields.1.help_text %}<div class="field-help">{{ row.fields.1.help_text }}</div>{% endif %}</th>
341348
<td>{% with v=row.fields.1.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:200px;max-height:80px;">{% elif v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
342349
</tr>
343350
{% else %}
344351
{% for field in row.fields %}
345352
<tr>
346-
<th>{{ field.label }}</th>
353+
<th>{{ field.label }}{% if field.help_text %}<div class="field-help">{{ field.help_text }}</div>{% endif %}</th>
347354
<td colspan="3">{% with v=field.value %}{% if v|is_signature %}<img src="{{ v }}" style="max-width:360px;max-height:120px;">{% elif v.filename %}{{ v.filename }}{% else %}{{ v }}{% endif %}{% endwith %}</td>
348355
</tr>
349356
{% endfor %}

django_forms_workflows/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,6 +3355,7 @@ def flush_third():
33553355
"key": key,
33563356
"value": _get_choice_label(field, form_data[key]),
33573357
"width": field.width,
3358+
"help_text": field.help_text if field.show_help_text_in_detail else "",
33583359
}
33593360

33603361
if field.width == "half":

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.74.17"
3+
version = "0.74.18"
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)