Resolves #409
This commit is contained in:
Andrew Hayward 2013-06-05 13:05:06 +01:00
Родитель e17a406ca6
Коммит a9279eae49
2 изменённых файлов: 26 добавлений и 27 удалений

Просмотреть файл

@ -12,9 +12,6 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob
var selectID = ($(this).attr('for')); var selectID = ($(this).attr('for'));
var selectEle = $('#' + selectID); var selectEle = $('#' + selectID);
$('#' + selectID + ' option:first').text($(this).text()); $('#' + selectID + ' option:first').text($(this).text());
var selectWrap = $('<div class="selectWrapper"></div>').append(this,selectEle);
$('.navbar.filter form').prepend(selectWrap);
}); });
} }

Просмотреть файл

@ -6,30 +6,32 @@
{% if filters %} {% if filters %}
<div class="navbar filter"> <div class="navbar filter">
<form class="navbar-inner navbar-form form-inline text-center" method="get"> <form class="navbar-inner navbar-form form-inline text-center" method="get">
{% for filter in filters %} {% for filter in filters %}
<label for="filter-{{ filter.name }}" class="filter-icon filter-{{ filter.name }}">{{ filter.label }}</label> <div class="selectWrapper">
{% if filter.options %} <label for="filter-{{ filter.name }}" class="filter-icon filter-{{ filter.name }}">{{ filter.label }}</label>
<select id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}"> {% if filter.options %}
<option></option> <select id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}">
{% if filter.is_grouped %} <option></option>
{% for label, options in filter.options %} {% if filter.is_grouped %}
<optgroup label="{{ label }}"> {% for label, options in filter.options %}
{% for value, label in options %} <optgroup label="{{ label }}">
<option value="{{ value }}"{% if filter.selected == value %} selected="selected"{% endif %}>{{ label }}</option> {% for value, label in options %}
{% endfor %} <option value="{{ value }}"{% if filter.selected == value %} selected="selected"{% endif %}>{{ label }}</option>
</optgroup> {% endfor %}
{% endfor %} </optgroup>
{% else %} {% endfor %}
{% for item in filter.options %} {% else %}
<option value="{{ item.value }}"{% if filter.selected == item.value %} selected="selected"{% endif %}>{{ item.label }}</option> {% for item in filter.options %}
{% endfor %} <option value="{{ item.value }}"{% if filter.selected == item.value %} selected="selected"{% endif %}>{{ item.label }}</option>
{% endif %} {% endfor %}
</select> {% endif %}
{% else %} </select>
<input type="{{ filter.type | default('text') }}" id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}"{% if filter.value %} value="{{ filter.value }}"{% endif %}> {% else %}
{% endif %} <input type="{{ filter.type | default('text') }}" id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}"{% if filter.value %} value="{{ filter.value }}"{% endif %}>
{% endfor %} {% endif %}
<input type="submit" value="Update" class="btn"> </div>
{% endfor %}
<input type="submit" value="Update" class="btn">
</form> </form>
</div> </div>
{% endif %} {% endif %}