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

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

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

{% block main %}
    <link rel="stylesheet" type="text/css" href="{% static 'bom/css/style.css' %}"/>
{% endblock %}

{% block content %}
    <div class="container-app">
        {% if profile.role == 'A' %}
            <div class="row">
                <form action="{% url 'bom:part-class-edit' part_class_id=part_class.id %}" method="post" class="col s12">
                    {% csrf_token %}
                    {{ part_class_form.non_field_errors }}
                    {{ part_class_form.code|materializecss:'s12 m2' }}
                    {{ part_class_form.name|materializecss:'s12 m6' }}
                    {{ part_class_form.comment|materializecss:'s12 m12' }}
                    <div class="row">
                        <div class="col s6">
                            <a href="{% url 'bom:settings' %}indabom" 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 green lighten-1" type="submit" name="action">Save</button>
                        </div>
                    </div>
                </form>
            </div>
        {% else %}
            {% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
        {% endif %}
    </div>
{% endblock %}