{% extends "isearch/base.html" %}
{% import "isearch/include/macros.html" as macros %}

{% block title %}Список огранизаций{% endblock %}

{% block organizations_active %}active{% endblock %}

{% block container %}
<h2>Организации</h2>

<p><a href="{{ url('isearch-sources-all-indexations') }}">Все индексации</a></p>

<form>
 {{ form.as_p() }}
 <p><input class="btn primary" type="submit" value="Найти"></p>
</form>

<table class="table table-bordered table-hover">
    <thead>
        <th>id</th>
        <th>directory_id</th>
        <th>directory_revision</th>
        <th>label</th>
        <th>Название</th>
        <th>Сервисы</th>
        <th>Ссылки</th>
    </thead>
    {% for org in organizations %}
        <tr {% if org.deleted %}class="label-important"{% endif %}>
            <td>{{ macros.admin_org_link(org, org.id) }}</td>
            <td>{{ macros.admin_org_link(org, org.directory_id) }}</td>
            <td>{{ org.directory_revision }}</td>
            <td>{{ org.label }}</td>
            <td style="max-width: 400pt; overflow: hidden;">{{ org.name }}</td>
            <td>
                {% for service in org.service_set.all() %}
                    {{ service.name }} <br/>
                {% endfor %}
            </td>
            <td>
                <p><a href="{{ url('isearch-sources-all-indexations') }}?organization_id={{ org.id }}">Индексации</a></p>
                <p><a href="{{ url('isearch-sources') }}?organization_id={{ org.id }}">Источники</a></p>

            </td>
        </tr>
    {% endfor %}
</table>
{% with objects=organizations %}
    {% include 'isearch/pager.html' %}
{% endwith %}

{% endblock %}
