{%- import "helper/util.html" as util %}
{%- import "helper/diff.html" as diff %}

{% if type.description %}
<div class="description stack">
    {% for description in type.description %}
    <div class="diff_version" data-version="{{ description.versions|join(" ") }}">
        {{- description.value -}}
    </div>
    {%- endfor -%}
</div>
{%- endif -%}

<div class="configuration stack">
    <h5><i class="i-presentation"></i> Presentation: </h5>
    <div class="code"><table class="table-hover">
        <colgroup>
            <col width="50%%"></col>
            <col width="50%%"></col>
        </colgroup>
        <tbody>
{{ diff.diff_code_commented(type.item) }}
        </tbody>
    </table></div>

{% if type.item and type.item[0].value.type|lower == "enum" %}
    <h6>Values: </h6>
    {%- call util.render_table([{"width": "200px", "name": "Value"}, {"name": "Description"}]) %}
        {%- for item in type.item|sort %}
            {%- for value in item.value.descriptions|sort %}
            <tr class="diff_version" data-version="{{ value.versions|join(" ") }}">
                <td><span class="str">{{ util.none_to_empty(value.value.name) }}</span></td>
                <td><span class="com">{{ util.none_to_empty(value.value.description) }}</span></td>
            </tr>
            {%- endfor %}
        {%- endfor %}
    {%- endcall %}
{%- endif %}
</div>