{% extends 'assets/add_assets.html' %}
{% load assets %}
{% load bob %}
{% load i18n %}

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

{% if office_info_form %}
  <div class="well">
    {% for field in office_info_form %}
      {% field_wrapper field %}
    {% endfor %}
  </div>
{% endif %}

{% block tabular_info %}
  <div>
      <h6>
        <a href="{{ history_link }}">{% trans "Full history" %}</a>
        {% if parent_link %}
        | <a href="{{ parent_link }}">{% trans "Parent" %}</a>
        {% endif %}
      </h6>
  </div>
  {% if status_history %}
      <div>
          <h5>{% trans "Status history" %}</h5>
          <table class="table table-striped table-bordered details-history">
              <thead><tr>
                  <th>{% trans "Date" %}</th>
                  <th>{% trans "Author" %}</th>
                  <th>{% trans "Before" %}</th>
                  <th>{% trans "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 %}
  {% transition_history asset %}
{% endblock %}

{% block additional_inputs %}
  {% for field in part_info_form %}
    {% field_wrapper field %}
  {% endfor %}
{% endblock %}
