{% load icons %}
<h3>{{ title }}</h3>

<table class="table table-striped table-bordered table-condensed">
    <tr>
        <th>Service</th>
        {% if not services_without_venture_mode %}
            <th>Venture</th>
            <th>Relation</th>
        {% endif %}
        <th>State</th>
        {% if perm_to_edit %}
            <th>Actions</th>
        {% endif %}
    </tr>
    {% for service in services %}
        <tr>
            <td><a href="/cmdb/ci/view/{{ service.id }}">{{ service.name }}</a></td>
            {% if not services_without_venture_mode %}
                <td>
                    {% if service.venture_id %}
                        <a href="/cmdb/ci/view/{{ service.venture_id }}">{{ service.venture }}</a>
                    {% else %}
                        -
                    {% endif %}
                </td>
                <td>
                    {{ service.relation_type|default:"None" }}
                </td>
            {% endif %}
            <td>{{ service.state }}</td>
            {% if perm_to_edit %}
                <td>{% spaceless %}
                    <a href="/cmdb/ci/edit/{{ service.id }}#relations">
                        {% icon 'fugue-toolbox--pencil' %}&nbsp;Edit
                    </a>
                {% endspaceless %}</td>
            {% endif %}
        </tr>
    {% endfor %}
</table>
