Skip to content

Commit 517ce7b

Browse files
committed
v0.5.10: Remove JS spinner - just use standard form submission
1 parent bfefb52 commit 517ce7b

3 files changed

Lines changed: 3 additions & 50 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.5.9"
6+
__version__ = "0.5.10"
77
__author__ = "Django Forms Workflows Contributors"
88
__license__ = "LGPL-3.0-only"
99

django_forms_workflows/templates/django_forms_workflows/approve.html

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ <h5 class="mb-0">Your Decision</h5>
7575
<label for="comments" class="form-label">Comments (Optional)</label>
7676
<textarea class="form-control" id="comments" name="comments" rows="3" placeholder="Add any comments about your decision..."></textarea>
7777
</div>
78-
79-
<!-- Action buttons (shown initially) -->
80-
<div class="d-grid gap-2 d-md-block" id="actionButtons">
78+
<div class="d-grid gap-2 d-md-block">
8179
<button type="submit" name="decision" value="approve" class="btn btn-success btn-lg">
8280
<i class="bi bi-check-circle"></i> Approve
8381
</button>
@@ -88,57 +86,12 @@ <h5 class="mb-0">Your Decision</h5>
8886
<i class="bi bi-arrow-left"></i> Back
8987
</a>
9088
</div>
91-
92-
<!-- Loading spinner (hidden initially) -->
93-
<div class="d-none" id="loadingSpinner">
94-
<div class="d-flex align-items-center">
95-
<div class="spinner-border text-primary me-3" role="status">
96-
<span class="visually-hidden">Processing...</span>
97-
</div>
98-
<div>
99-
<strong id="loadingText">Processing your decision...</strong>
100-
<p class="text-muted mb-0 small">This may take a few moments.</p>
101-
</div>
102-
</div>
103-
</div>
10489
</form>
10590
</div>
10691
</div>
10792
</div>
10893
</div>
10994
{% endblock %}
11095

111-
{% block extra_js %}
112-
<script>
113-
document.addEventListener('DOMContentLoaded', function() {
114-
const form = document.getElementById('approvalForm');
115-
const actionButtons = document.getElementById('actionButtons');
116-
const loadingSpinner = document.getElementById('loadingSpinner');
117-
const loadingText = document.getElementById('loadingText');
118-
119-
form.addEventListener('submit', function(e) {
120-
// Get the clicked button's value
121-
const clickedButton = e.submitter;
122-
const decision = clickedButton ? clickedButton.value : 'processing';
12396

124-
// Update loading text based on decision
125-
if (decision === 'approve') {
126-
loadingText.textContent = 'Approving submission...';
127-
} else if (decision === 'reject') {
128-
loadingText.textContent = 'Rejecting submission...';
129-
}
130-
131-
// Hide buttons, show spinner
132-
actionButtons.classList.add('d-none');
133-
loadingSpinner.classList.remove('d-none');
134-
135-
// Disable only buttons to prevent double-click (not inputs - that breaks CSRF)
136-
const buttons = form.querySelectorAll('button');
137-
buttons.forEach(function(btn) {
138-
btn.disabled = true;
139-
});
140-
});
141-
});
142-
</script>
143-
{% endblock %}
14497

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.5.9"
3+
version = "0.5.10"
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)