{% extends 'core/base.html' %}
{% load i18n widget_tweaks %}

{% block title %}Add a Child{% endblock %}

{% block content %}
    <h1>Add a Child</h1>
    <form role="form" method="post">
        {% csrf_token %}
        {% for field in form %}
            <div class="form-group">
                <label for="id_{{ field.name }}">{{ field.label }}</label>
                {% if field.errors %}
                    {{ field|attr:"class:form-control is-invalid" }}
                {% else %}
                    {{ field|attr:"class:form-control" }}
                {% endif %}
                {% if field.help_text %}
                    <p class="help-block"><small>{{ field.help_text }}</small></p>
                {% endif %}
            {% if field.errors %}
                <p class="invalid-feedback">{% for error in  field.errors %}{{ error }}{% endfor %}</p>
            {% endif %}
            </div>
        {% endfor %}
        <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
    </form>
{% endblock %}
{% extends 'core/base.html' %}
{% load widget_tweaks %}

{% block title %}
    {% if request.resolver_match.url_name == 'child-update' %}
        Update a Child
    {% else %}
        Add a Child
    {% endif %}
{% endblock %}

{% block content %}
    {% if object %}
        <h1>Update <span class="text-info">{{ object.first_name }} {{ object.last_name }}</span></h1>
    {% else %}
        <h1>Add a Child</h1>
    {% endif %}
    <form role="form" method="post">
        {% csrf_token %}
        {% for field in form %}
            <div class="form-group">
                <label for="id_{{ field.name }}">{{ field.label }}</label>
                {% if field.errors %}
                    {{ field|attr:"class:form-control is-invalid" }}
                {% else %}
                    {{ field|attr:"class:form-control" }}
                {% endif %}
                {% if field.help_text %}
                    <p class="help-block"><small>{{ field.help_text }}</small></p>
                {% endif %}
            {% if field.errors %}
                <p class="invalid-feedback">{% for error in  field.errors %}{{ error }}{% endfor %}</p>
            {% endif %}
            </div>
        {% endfor %}
        <button type="submit" class="btn btn-primary">Submit</button>
    </form>
{% endblock %}
Update Child form for add/update differences.
Update Child form for add/update differences.
