removed reliance on built-in django ModelForms from templates/core/base.html, apps.dashboard.forms, .tests.test_forms & .test_views

This commit is contained in:
Disco DeDisco
2026-01-24 13:36:31 -05:00
parent 0afc5ee8d7
commit 6627042b7a
4 changed files with 31 additions and 47 deletions

View File

@@ -18,10 +18,20 @@
<h2 class="display-2 mb-2">{% block header_text %}{% endblock header_text %}</h2>
<form method="POST" action="{% block form_action %}{% endblock form_action %}">
{{ form.text }}
{% csrf_token %}
<input
id="id_text"
name="text"
class="form-control form-control-lg{% if form.errors %} is-invalid{% endif %}"
placeholder="Enter a to-do item"
value="{{ form.text.value | default:'' }}"
aria-describedby="id_text_feedback"
required
/>
{% if form.errors %}
<div class="invalid-feedback">{{ form.errors.text }}</div>
<div id="id_text_feedback" class="invalid-feedback">
{{ form.errors.text.0 }}
</div>
{% endif %}
</form>
</div>