{% import math %} {% set pagebar.searchs += ['sort', 'order'] %} {% set pagebar.searchs += list(set(handler.request.arguments) - set(map(lambda item:item.split(':')[-1], pagebar.searchs))) %} {% set cols = 3 %} {% set rows = int(math.ceil(len(pagebar.searchs)/cols)) %} {% for i in range(rows) %}
{% for j in range(cols) %} {% if i*cols+j < len(pagebar.searchs) %} {% if pagebar.searchs[i*cols+j].find(':') >= 0 %} {% set label = pagebar.searchs[i*cols+j].split(':')[0] %} {% set field = pagebar.searchs[i*cols+j].split(':')[1] %} {% else %} {% set label = pagebar.searchs[i*cols+j] %} {% set field = pagebar.searchs[i*cols+j] %} {% end %}
{% if pagebar.options and field in pagebar.options %} {% elif pagebar.types and field in pagebar.types %} {% else %} {% end %}
{% else %} {% break %} {% end %} {% end %} {% if i == rows - 1 %} {% if j == cols - 1 and i*cols+j < len(pagebar.searchs) %}
{% end %}
{% end %}
{% end %}