{% extends "base.html" %}

{% block head %}
<script type="text/javascript">

</script>
{% endblock %}

{% block title %}
Patient form
{% endblock %}

{% block content %}

{% if object %}
<h2>Update patient:</h2>
{% else %}
<h2>Create a Patient</h2>
{% endif %}

{% if form.has_errors %}
<h2>Please correct the following error{{ form.errors|pluralize }}:</h2>
{% endif %}

<form method="post" action="" class="cssform">{% csrf_token %}
  {{ form.as_p }}
  <input type="submit" /> <input type="reset" />
</form>

<a href='/patient/list/'>Return to patient list</a>

<script type="text/javascript">
  $(document).ready(function(){
    $("#id_dead").datepicker();
    // $("#id_last_followup").datepicker();
    // $("#id_next_followup").datepicker();
  });
</script>

<!--
This is a lifesaver when debugging!
<p> {{ form.error_dict }} </p>
-->

{% endblock %}