{% extends "epic/base_layout.html" %}
{% load humanize %}

{% block buttons %}
  <a class="btn btn-default" href="{% url 'epic:datasheet_list' %}">
    Up <i class="glyphicon glyphicon-chevron-up"></i>
  </a>
{% endblock buttons %}

{% block content %}
{{ block.super }}

<table class="table table-bordered table-hover table-striped"
       style="background-color: white">
  {% for field in fields %}
  <tr>
    <td style="width:20em"><strong>{{ field.0 }}</strong></td>
    <td>{{ field.1|safe }}</td>
  </tr>
  {% endfor %}
</table>

<p>
  <a class="btn btn-primary"
     href="{% url 'epic:datasheet_edit' object.id %}">
    Edit <i class="glyphicon glyphicon-edit"></i>
  </a>
  <a class="btn btn-danger"
      href="{% url 'epic:datasheet_delete' object.id %}"
      onclick="return confirm
               ('Are you sure you want to delete this datasheet?')">
    Delete <i class="glyphicon glyphicon-remove"></i></a>
</p>

<div class="panel panel-default">
  <div class="panel-heading">
    <h2 class="panel-title">Associated Parts</h2>
  </div>
  <div class="panel-body">
    {{ parts|safe }}
  </div>
</div>


{% endblock content %}
