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

{% comment %}

This file is intended to be used as a Django include file for the purpose of displaying
all of the properties of a part revision, as follows:

    {% include 'bom/part-revision-display.html' with part_revision_form=XXX %}
 
where XXX should be the name of the includee's object that represent its PartRevisionForm.

{% endcomment %}
<div class="row">
    <div class="fieldWrapper">
        {{ part_revision_form.revision|materializecss:'m2 s12' }}
    </div>
    <div class="fieldWrapper">
        {{ part_revision_form.description|materializecss:'m8 s12' }}
    </div>
</div>

<div class="row">
    <div class="col s12">
        {% if part_revision_form.property_definitions %}
            <h4>Properties</h4>
        {% else %}
            <p><i>You can add part class specific properties (e.g. voltage, width, sheen, etc) after creating the
                part.</i></p>
        {% endif %}
    </div>
</div>

<div class="row">
    {% for group in part_revision_form.property_fields %}
        <div class="row">
            <div class="fieldWrapper">
                {{ group.property|materializecss:'m3 s6' }}
            </div>
            {% if group.unit %}
                <div class="fieldWrapper">
                    {{ group.unit|materializecss:'m3 s6' }}
                </div>
            {% endif %}
        </div>
    {% endfor %}
</div>
