{% extends 'bom/bom-base.html' %}

{% load static %}
{% load materializecss %}

{% block head-title %}{{ title }}{% endblock %}

{% block bom-menu %}
    <li><a href="{% url 'bom:part-info' part_id=part.id %}">Cancel</a></li>
{% endblock %}

{% if profile.role == 'A' %}
    {% block content %}
        <div class="row container-app">
            <form action="{% url 'bom:part-revision-edit' part_id=part.id part_revision_id=part_revision.id %}" method="post" class="col s12">
                {% csrf_token %}
                {{ part_form.non_field_errors }}
                <div class="row">
                    <div class="col s12">
                        <i>Edit this revision's properties below, or click <a href="{% url 'bom:part-manage-bom' part_id=part.id part_revision_id=part_revision.id %}">here</a>
                            if you want to manage this revision's bill of materials.</i>
                    </div>
                </div>

                {% include 'bom/part-revision-display.html' with part_revision_form=form %}

                <div class="row">
                    <div class="col s6">
                        <a href="javascript:history.back()" class="waves-effect waves-light btn-flat grey-text lighten-1" style="margin-left: -16px;">Cancel</a>
                    </div>
                    <div class="col s6 right-align">
                        <button class="waves-effect waves-light btn btn-primary" type="submit" name="action">Save
                        </button>
                    </div>
                </div>
            </form>
        </div>
    {% endblock %}
{% endif %}