{#
    Copyright (c) 2015 Chintalagiri Shashank
    Released under the MIT license
#}

{% extends "base_templates/base.html" %}
{% import "parts/inventory_ident.html" as inventory_ident %}
{% import "parts/sourcing_part_costing_chart.html" as sourcing_part_costing_chart %}

{% block magellan %}
<!-- Magellan -->
<div data-magellan-expedition="sticky">
    <dl class="sub-nav">
        <dd data-magellan-arrival="details"><a href="#details">Details</a></dd>
        <dd data-magellan-arrival="documentation"><a href="#documentation">Documentation</a></dd>
        <dd data-magellan-arrival="changelog"><a href="#changelog">ChangeLog</a></dd>
        <dd data-magellan-arrival="costing"><a href="#costing">Costing</a></dd>
    </dl>
</div>
{% endblock %}


{% block main %}

<div class="row">
<div class="small-12 medium-6 columns" data-magellan-destination="details">
<h3> PCB Details </h3>
<a name="details"></a>
        <ul class="pricing-table shadow mrgn-20-top">
            <li class="price autoscale "> {{ stage.prototype.ident }} </li>
            <li class="description"> {{ stage.prototype.configs.description() }} </li>
            <li class="title"> PCB Details </li>
            {% for descriptor in stage.prototype.configs.pcbdescriptors %}
            <li class="bullet-item"> {{ descriptor }} </li>
            {% endfor %}
            {% if stage.prototype.status %}
              <span class="right label radius {{stage.prototype.status.html_class}}">
                  {{stage.prototype.status}}
              </span>
            {% endif %}
        </ul>

    <div class="small-12 columns panel header radius">
        <div class="sign small-9 medium-6 small-centered columns autoscale">
            <h6>References</h6>
        </div>

        <div class="small-12 columns">
        <a href="/entityhub/projects/{{stage.prototype.ident}}">
            <div class="button radius small-12 columns active-tb shadow mrgn-20-top">
                <div class="text-center">EDA Project</div>
                <div class="text-center"><b>{{ stage.prototype.ident }}</b></div>
            </div>
        </a>
        </div>
    </div>
</div>

<!-- Documentation -->
<div class="small-12 medium-6 columns">
<h3> Documentation </h3>
<a name="documentation"></a>
    <ul class="doclinklist">
        {% for doc in stage.prototype.docs %}
            {% include 'parts/doc_link_list_element.html' %}
        {% endfor %}
    </ul>
</div>
</div>

<!-- Rendering of Image -->
<div class="row">
    <ul class="large-block-grid-3 clearing-thumbs" data-clearing>
        {% for img in stage.imgs %}
        <li>
          <a class="th" href="{{ img.exposed_url }}">
              <img data-caption="{{ img.desc }}" src="{{ img.exposed_url }}" />
          </a>
        </li>
        {% endfor %}
    </ul>
</div>

<!--Changelog and Issues-->
<div class="row">
    {% if stage.prototype.changelog %}
    <div class="small-12 medium-6 columns" data-magellan-destination="changelog">
        <a name="changelog"></a>
        <div class="small-12 columns panel header radius">
            <div class="sign small-9 medium-6 small-centered columns autoscale">
                <h6>ChangeLog</h6>
            </div>
            {% set changelog = stage.prototype.changelog.parts %}
            {% include 'parts/changelog.html' %}
        </div>
    </div>
    {% endif %}
</div>


<div class="row" data-equalizer="costing">
<!-- Pricing Information -->
    {% if stage.costing %}
        {{ sourcing_part_costing_chart.render_part_costing_chart(stage.costing) }}
    {% endif %}

    <!-- Inventory Information -->
    {{ inventory_ident.render_status(stage.inv_status) }}
</div>

{% endblock %}
