{% extends "timepiece/person/base.html" %}
{% load url from future %}
{% load bootstrap_toolkit %}

{% block title %}{% if not person %}Create Person{% else %}Edit {{ person.get_full_name }}{% endif %}{% endblock %}

{% block crumbs %}
    {{ block.super }}
    <li>
        <span class="divider">/</span>
        {% if not person %}
            <a href="{% url 'create_person' %}">Create Person</a>
        {% else %}
            <a href="{% url 'edit_person' person.pk %}">Edit Person</a>
        {% endif %}
    </li>
{% endblock crumbs %}

{% block content %}
    <div class="row-fluid">
        <div class="span12">
            <h2>{% if not person %}Create Person{% else %}Edit {{ person.name }}{% endif %}</h2>

            <br style="clear: both;" />

            <form id="create-edit-person" class="form-horizontal" action="" method="post" accept-charset="utf-8">
                {% csrf_token %}
                {{ person_form|as_bootstrap:"horizontal" }}
                <div class="form-actions">
                    <input class="btn btn-primary" type="submit" value="Save" name="submit" />
                    <input class="btn" type="button" onclick="history.go(-1)" value="Cancel" />
                </div>
            </form>
        </div>
    </div>
{% endblock %}
