зеркало из https://github.com/mozilla/CSOL-site.git
Родитель
e17a406ca6
Коммит
a9279eae49
|
@ -12,9 +12,6 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob
|
|||
var selectID = ($(this).attr('for'));
|
||||
var selectEle = $('#' + selectID);
|
||||
$('#' + 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 %}
|
||||
<div class="navbar filter">
|
||||
<form class="navbar-inner navbar-form form-inline text-center" method="get">
|
||||
{% for filter in filters %}
|
||||
<label for="filter-{{ filter.name }}" class="filter-icon filter-{{ filter.name }}">{{ filter.label }}</label>
|
||||
{% if filter.options %}
|
||||
<select id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}">
|
||||
<option></option>
|
||||
{% if filter.is_grouped %}
|
||||
{% for label, options in filter.options %}
|
||||
<optgroup label="{{ label }}">
|
||||
{% for value, label in options %}
|
||||
<option value="{{ value }}"{% if filter.selected == value %} selected="selected"{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for item in filter.options %}
|
||||
<option value="{{ item.value }}"{% if filter.selected == item.value %} selected="selected"{% endif %}>{{ item.label }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
{% else %}
|
||||
<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 %}>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<input type="submit" value="Update" class="btn">
|
||||
{% for filter in filters %}
|
||||
<div class="selectWrapper">
|
||||
<label for="filter-{{ filter.name }}" class="filter-icon filter-{{ filter.name }}">{{ filter.label }}</label>
|
||||
{% if filter.options %}
|
||||
<select id="filter-{{ filter.name }}" name="{{ filter.name }}" class="input-medium{% if filter.class %} {{ filter.class }}{% endif %}">
|
||||
<option></option>
|
||||
{% if filter.is_grouped %}
|
||||
{% for label, options in filter.options %}
|
||||
<optgroup label="{{ label }}">
|
||||
{% for value, label in options %}
|
||||
<option value="{{ value }}"{% if filter.selected == value %} selected="selected"{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for item in filter.options %}
|
||||
<option value="{{ item.value }}"{% if filter.selected == item.value %} selected="selected"{% endif %}>{{ item.label }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
{% else %}
|
||||
<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 %}>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<input type="submit" value="Update" class="btn">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче