{% extends 'assets/add_assets.html' %}

{% load bob %}

{% block form_title %}Edit part{% endblock %}

{% block office_info_inputs %}
<div class="span6 well">
  {% for field in office_info_form %}
    {% field_wrapper field %}
  {% endfor %}
</div>
<div class="span6">
    <h6>
      <a href="{{ history_link }}">Full history</a>
      {% if parent_link %}
          | <a href="{{ parent_link }}">Parent</a>
      {% endif %}
    </h6>
</div>
{% if status_history %}
    <div class="span6">
        <h5>Status history</h5>
        <table class="table table-striped table-bordered details-history">
            <thead><tr>
                <th>Date</th>
                <th>Author</th>
                <th>Before</th>
                <th>After</th>
            </tr></thead>
            <tbody>
            {% for h in status_history %}
                <tr>
                    <td>{{ h.date|timesince_limited }}</td>
                    <td>{{ h.user|default:'' }}</td>
                    <td>{{ h.old_value }}</td>
                    <td>{{ h.new_value }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endif %}
{% endblock %}

{% block additional_inputs %}
  {% for field in part_info_form %}
    <div class="control-group{% if field.errors %} error{% endif %}">
      <label class="control-label">{{ field.label }}</label>
      <div class="form-field controls">
        {{ field }}
        {% if field.errors %}
        <span class="help-inline">{% for error in field.errors %}{{ error }} {% endfor %}</span>
        {% endif %}
      </div>
    </div>
  {% endfor %}
{% endblock %}

