Update Child form for add/update differences.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-16 09:29:29 -04:00
parent e0e2e91de1
commit 195f93f7d5
1 changed files with 14 additions and 4 deletions

View File

@ -1,10 +1,20 @@
{% extends 'core/base.html' %} {% extends 'core/base.html' %}
{% load i18n widget_tweaks %} {% load widget_tweaks %}
{% block title %}Add a Child{% endblock %} {% block title %}
{% if request.resolver_match.url_name == 'child-update' %}
Update a Child
{% else %}
Add a Child
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<h1>Add a Child</h1> {% 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"> <form role="form" method="post">
{% csrf_token %} {% csrf_token %}
{% for field in form %} {% for field in form %}
@ -23,6 +33,6 @@
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
<button type="submit" class="btn btn-primary">{% trans "Submit" %}</button> <button type="submit" class="btn btn-primary">Submit</button>
</form> </form>
{% endblock %} {% endblock %}