{% extends BASE_TEMPLATE %}

{% load staticfiles %}
{% load materializecss %}

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

{% block title %}
<link rel="stylesheet" type="text/css" href="{% static 'bom/style.css' %}" />
Edit Part {{ part.full_part_number }}
{% endblock %}

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

{% block content %}
<div class="row">
    <form action="{% url 'bom:part-edit' part_id=part.id %}" method="post" class="col s12">
        <div class="row">
            {% csrf_token %}
            {{ part_form.non_field_errors }}
            <div class="fieldWrapper">
                {{ part_form.number_class|materializecss:'m4 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_form.number_item|materializecss:'m4 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_form.number_variation|materializecss:'m4 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_form.primary_manufacturer_part|materializecss:'m12 s12' }}
            </div>
		</div>
    	<div class="row">
            {% csrf_token %}
            {{ part_change_history_form.non_field_errors }}
            <div class="fieldWrapper">
                {{ part_change_history_form.revision|materializecss:'m2 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_change_history_form.description|materializecss:'m10 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_change_history_form.attribute|materializecss:'m6 s12' }}
            </div>
            <div class="fieldWrapper">
                {{ part_change_history_form.value|materializecss:'m6 s12' }}
            </div>
		</div>
		<div class="row">
	        <div class="fieldWrapper">
	        	<button class="waves-effect waves-light btn green lighten-1" type="submit" name="action">Save</button>
	        	<a href="javascript:history.back()" class="waves-effect waves-light btn green lighten-1">Cancel</a>
	    	</div>
    	</div>
    </form>
</div>
{% endblock %}