<div class="b-offices">
    <p class="header"><strong>Фильтр по офисам</strong></p>
    <ul>
    {% ifequal current_office_id None %}
        <li class="selected"><span class="sel">Все офисы</span> <sup>{{ book_count }}</sup></li>
    {% else %}
        <li><a href="{% url list_books_tag current_tag_id %}">Все офисы</a> <sup>{{ book_count }}</sup></li>
    {% endifequal %}
    {% for office in offices %}
        {% ifequal office.id current_office_id %}
            <li class="selected"><span class="sel">{{ office.name }}</span> <sup>{{ office.count_of_bookitems }}</sup></li>
        {% else %}
            <li>
                <a href="{% url list_books_office current_tag_id office.id %}">{{ office.name }}</a> <sup>{{ office.count_of_bookitems }}</sup>
            </li>
        {% endifequal %}
    {% endfor %}
    {% ifequal current_office_id 0 %}
        <li class="selected" style="margin-left:-0.6em;"><span class="sel">&laquo;Черная дыра&raquo;</span> <sup>{{ books_in_black_hole }}</sup></li>
    {% else %}
        <li style="margin-left:-0.6em;">&laquo;<a href="{% url list_books_office current_tag_id 0 %}">Черная дыра</a>&raquo; <sup>{{ books_in_black_hole }}</sup></li>
    {% endifequal %}
    </ul>
</div>