{% macro sidefilter(filter_form, stream_url) %}
  {% if filter_form %}
    <div class="sidefilter">
      <form id="{{ filter_form.id }}" action="{{ stream_url }}"
            class="filter-form init-block"
            data-block-name="{{ filter_form.js_block }}"
            {%- if filter_form.search_input %} data-search-input="{{ filter_form.search_input }}"{% endif %}>
        <a class="sidefilter-close">
          <legend>Фильтры</legend>
        </a>
        <fieldset>
          {{ filter_form.render() }}
          <button type="reset" class="button sidefilter__clear">
            Сбросить
          </button>
          <button type="submit" class="button sidefilter__submit">
            Применить
          </button>
        </fieldset>
        <div class="sidefilter-tags"></div>
      </form>
    </div>
  {% endif %}
{% endmacro %}

{% macro paginate(paginator) %}
  {% if paginator %}
    <div class="pages">
      {% for p, u in paginator.pages %}
        {% if p==paginator.page  %}
          <div class="active">{{ p }}</div>
        {% elif p==None %}
          <div>&hellip;</div>
        {% else %}
          <a href="{{ u }}"><div>{{ p }}</div></a>
        {% endif %}
      {% endfor %}
    </div>
  {% endif %}
{% endmacro %}

