Skip to content

Commit 96f8820

Browse files
committed
fix: Show completed approval steps and move decision inline
- Display completed approval steps with their data (green cards showing previous approvals like Advisor info) - Move the decision section (comments + approve/reject buttons) inline with the current approval step card instead of at the bottom - Future steps preview moved outside the form to appear after Bump version to 0.7.4
1 parent 635d3d7 commit 96f8820

3 files changed

Lines changed: 51 additions & 27 deletions

File tree

django_forms_workflows/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Enterprise-grade, database-driven form builder with approval workflows
44
"""
55

6-
__version__ = "0.7.3"
6+
__version__ = "0.7.4"
77
__author__ = "Django Forms Workflows Contributors"
88
__license__ = "LGPL-3.0-only"
99

django_forms_workflows/templates/django_forms_workflows/approve.html

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,39 @@ <h5 class="mb-0"><i class="bi bi-file-text"></i> Submission Data</h5>
9292
</div>
9393
</div>
9494

95+
<!-- Completed Approval Steps (show previous approvals) -->
96+
{% for step in approval_steps %}
97+
{% if step.is_completed %}
98+
<div class="card mb-4 border-success">
99+
<div class="card-header bg-success text-white">
100+
<h5 class="mb-0"><i class="bi bi-check-circle"></i> Step {{ step.number }}: {{ step.group_name }}
101+
<span class="badge bg-light text-success float-end">Completed</span>
102+
</h5>
103+
</div>
104+
<div class="card-body">
105+
<table class="table table-bordered table-sm mb-0">
106+
{% for key, value in submission.form_data.items %}
107+
{% if step.number == 1 and key|slice:":7" == "advisor" %}
108+
<tr><th style="width: 30%;">{{ key|title }}</th><td>{{ value }}</td></tr>
109+
{% elif step.number == 2 and key|slice:":3" == "fa_" %}
110+
<tr><th style="width: 30%;">{{ key|title }}</th><td>{{ value }}</td></tr>
111+
{% elif step.number == 3 and key|slice:":9" == "registrar" %}
112+
<tr><th style="width: 30%;">{{ key|title }}</th><td>{{ value }}</td></tr>
113+
{% elif step.number == 4 and key|slice:":7" == "manager" %}
114+
<tr><th style="width: 30%;">{{ key|title }}</th><td>{{ value }}</td></tr>
115+
{% endif %}
116+
{% endfor %}
117+
</table>
118+
</div>
119+
</div>
120+
{% endif %}
121+
{% endfor %}
122+
95123
<!-- Approval Form with Step Fields -->
96124
<form method="post" data-loading-message="Processing your decision...">
97125
{% csrf_token %}
98126

99-
<!-- Current Step Fields Section -->
127+
<!-- Current Step Fields Section with Decision inline -->
100128
<div class="card mb-4 border-primary">
101129
<div class="card-header bg-primary text-white">
102130
<h5 class="mb-0"><i class="bi bi-pencil-square"></i> Step {{ current_step_number }}: {{ task.step_name }}
@@ -106,34 +134,14 @@ <h5 class="mb-0"><i class="bi bi-pencil-square"></i> Step {{ current_step_number
106134
<div class="card-body">
107135
<p class="text-muted mb-4">Please review the submission above and fill in the required fields below.</p>
108136
{{ approval_step_form|crispy }}
109-
</div>
110-
</div>
111137

112-
<!-- Future Steps Preview (greyed out) -->
113-
{% for step in approval_steps %}
114-
{% if step.number > current_step_number %}
115-
<div class="card mb-4 border-secondary opacity-50">
116-
<div class="card-header bg-light text-muted">
117-
<h5 class="mb-0"><i class="bi bi-hourglass"></i> Step {{ step.number }}: {{ step.group_name }}
118-
<span class="badge bg-secondary float-end">Pending</span>
119-
</h5>
120-
</div>
121-
<div class="card-body">
122-
<p class="text-muted mb-0"><em>This step will be available after all previous steps are approved.</em></p>
123-
</div>
124-
</div>
125-
{% endif %}
126-
{% endfor %}
138+
<hr class="my-4">
127139

128-
<!-- Decision Section -->
129-
<div class="card mb-4 border-success">
130-
<div class="card-header bg-light">
131-
<h5 class="mb-0"><i class="bi bi-clipboard-check"></i> Your Decision</h5>
132-
</div>
133-
<div class="card-body">
140+
<!-- Decision Section inline -->
141+
<h6 class="mb-3"><i class="bi bi-clipboard-check"></i> Your Decision</h6>
134142
<div class="mb-3">
135143
<label for="comments" class="form-label">Comments (Optional)</label>
136-
<textarea class="form-control" id="comments" name="comments" rows="3" placeholder="Add any comments about your decision..."></textarea>
144+
<textarea class="form-control" id="comments" name="comments" rows="2" placeholder="Add any comments about your decision..."></textarea>
137145
</div>
138146
<div class="d-grid gap-2 d-md-block">
139147
<button type="submit" name="decision" value="approve" class="btn btn-success btn-lg">
@@ -150,6 +158,22 @@ <h5 class="mb-0"><i class="bi bi-clipboard-check"></i> Your Decision</h5>
150158
</div>
151159
</form>
152160

161+
<!-- Future Steps Preview (greyed out) -->
162+
{% for step in approval_steps %}
163+
{% if step.number > current_step_number %}
164+
<div class="card mb-4 border-secondary opacity-50">
165+
<div class="card-header bg-light text-muted">
166+
<h5 class="mb-0"><i class="bi bi-hourglass"></i> Step {{ step.number }}: {{ step.group_name }}
167+
<span class="badge bg-secondary float-end">Pending</span>
168+
</h5>
169+
</div>
170+
<div class="card-body">
171+
<p class="text-muted mb-0"><em>This step will be available after all previous steps are approved.</em></p>
172+
</div>
173+
</div>
174+
{% endif %}
175+
{% endfor %}
176+
153177
{% else %}
154178
<!-- Standard Approval (No Step Fields) -->
155179
<!-- Submission Data -->

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.7.3"
3+
version = "0.7.4"
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)