{% extends "ui/base-devices.html" %}

{% load url from future %}
{% load icons %}

{% block contentarea %}
<div class="span7">
<table class="table table-striped table-bordered table-list device-list">
    <thead><tr>
        <th>Role</th>
        <th>Count</th>
    </tr></thead>
    <tbody>
        <tr {% if role == None %}class="active"{% endif %}>
            <td class="column-name"><a href=".">{% icon 'fugue-store' %}&nbsp;Venture's defaults</a></td>
            <td class="count"></td>
        </tr>
        {% for r in items %}
        <tr {% if r == role %}class="active"{% endif %}>
            <td class="column-name"><a
                href="{{ r.id|default:'' }}?{{ url_query.urlencode }}"
                >{%  for i in r.padding %}&nbsp;&nbsp;&nbsp;&nbsp;{%  endfor %}
                {% icon 'fugue-mask' %}&nbsp;{{ r.full_name }}
            </a>
            </td>
            <td class="count">
                <a class="badge badge-info" href="{% url 'search' %}?role={{r.venture}}%2f{{r.full_name}}">{{ r.device_set.count }}</a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
</div>
<div class="span5">
{% block info %}
<table class="table table-striped table-bordered details-role-properties">
    <thead><tr>
        <th width="16"></th>
        <th>Property</th>
        <th>Type</th>
        <th>Default</th>
    </tr></thead>
    <tbody>
        {% if role %}
            {% for p in role.roleproperty_set.all %}
                <tr>
                    <td>{% icon 'fugue-property' %}</td>
                    <td>{{ p.symbol }}</td>
                    <td>{{ p.type.symbol }}</td>
                    <td>{{ p.default }}</td>
                </tr>
            {% endfor %}
        {% else %}
            {% for p in venture.roleproperty_set.all %}
                <tr>
                    <td>{% icon 'fugue-property' %}</td>
                    <td>{{ p.symbol }}</td>
                    <td>{{ p.type.symbol }}</td>
                    <td>{{ p.default }}</td>
                </tr>
            {% endfor %}
        {% endif %}
    </tbody>
</table>
{% if editable %}
<p>Create a new property for this {% if role %}role{% else %}venture{% endif %}.</p>
 {% include 'ui/base-form.html' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
