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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user