styling filter aside

remotes/origin/stage5
ya_dim4ik 10 years ago
parent 13c6efd2b2
commit efafafa08c
  1. 8
      events/forms.py
  2. 47
      static/client/css/main.css
  3. 2
      static/client/css_min/main.min.css
  4. BIN
      static/client/img/cc.png
  5. 22
      static/client/js/scripts.js
  6. 22
      static/client/js/vendor.js
  7. 2
      static/client/js_min/vendor.min.js
  8. 8
      templates/client/includes/events/filter_form.html

@ -267,10 +267,10 @@ class FilterForm(forms.Form):
for field in ['members', 'visitors', 'price']: for field in ['members', 'visitors', 'price']:
self.fields[field].choices = self.make_local_field_count(field) or self.fields[field].choices self.fields[field].choices = self.make_local_field_count(field) or self.fields[field].choices
# for field in self.fields: for field in self.fields:
# field = self.fields[field] field = self.fields[field]
# if hasattr(field, 'queryset'): if hasattr(field, 'queryset'):
# field.queryset = field.queryset[:15] field.queryset = field.queryset[:15]
def make_ids_in_sql_format(self, values): def make_ids_in_sql_format(self, values):
return tuple(values) if len(values) > 1 else '({})'.format(*values) return tuple(values) if len(values) > 1 else '({})'.format(*values)

@ -13019,6 +13019,15 @@ button.gray:hover {
display: block; display: block;
padding: 10px; padding: 10px;
background: #f2f2f2; background: #f2f2f2;
text-decoration: none;
}
.filter_form_clear_all span{
display: inline-block;
vertical-align: middle;
margin-left: 5px;
color: #464646;
border-bottom: 1px dotted #464646;
} }
.filter_form ul{ .filter_form ul{
@ -13062,6 +13071,44 @@ button.gray:hover {
color: #898989; color: #898989;
} }
.filters input[type=checkbox]{
display: none;
}
.filters input[type=checkbox] + label{
cursor: pointer;
}
.filters input[type=checkbox] + label:hover{
background: #eee;
}
.filters input[type=checkbox]:checked + label{
background: #ffbc88;
}
.filters input[type=checkbox] + label:before{
content: "";
display: inline-block;
vertical-align: middle;
margin-right: 5px;
width: 10px;
height: 10px;
border: 1px solid #c2c2c2;
border-radius: 2px;
background: #fff;
}
.filters input[type=checkbox]:checked + label:before{
background: #fff url(../img/cc.png) no-repeat 1px 1px;
}
.filter_help_text{
display: block;
color: #a3a3a3;
line-height: 1.2;
padding: 0px 10px;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -88,12 +88,30 @@ $(document).ready(function () {
$('.filter_block_label').on('click', function(event) { $('.filter_block_label').on('click', function(event) {
event.preventDefault(); event.preventDefault();
var $this = $(this); var $this = $(this),
target = '#' + $this.attr('for');
$this.next('ul').slideToggle(300); $(target).slideToggle(300);
$this.find('.fa').toggleClass('fa-caret-down fa-caret-up'); $this.find('.fa').toggleClass('fa-caret-down fa-caret-up');
}); });
$('.filter_form').on('change', 'input[type="checkbox"]', function(event) {
event.preventDefault();
var params = $('.filter_form').serialize();
console.log(params)
console.log(window.location);
console.log('------')
window.location.search = params;
});
$('.filter_form_clear_all').on('click', function(event) {
event.preventDefault();
$('.filter_form input').prop('checked', false);
});
$("div.ht-main_1").each(function () { $("div.ht-main_1").each(function () {

@ -5005,12 +5005,30 @@ $(document).ready(function () {
$('.filter_block_label').on('click', function(event) { $('.filter_block_label').on('click', function(event) {
event.preventDefault(); event.preventDefault();
var $this = $(this); var $this = $(this),
target = '#' + $this.attr('for');
$this.next('ul').slideToggle(300); $(target).slideToggle(300);
$this.find('.fa').toggleClass('fa-caret-down fa-caret-up'); $this.find('.fa').toggleClass('fa-caret-down fa-caret-up');
}); });
$('.filter_form').on('change', 'input[type="checkbox"]', function(event) {
event.preventDefault();
var params = $('.filter_form').serialize();
console.log(params)
console.log(window.location);
console.log('------')
window.location.search = params;
});
$('.filter_form_clear_all').on('click', function(event) {
event.preventDefault();
$('.filter_form input').prop('checked', false);
});
$("div.ht-main_1").each(function () { $("div.ht-main_1").each(function () {

File diff suppressed because one or more lines are too long

@ -6,7 +6,7 @@
<div class="filter_form_clear_all"> <div class="filter_form_clear_all">
<a href="#"> <a href="#">
<img src="{% static 'client/img/x3.png' %}" alt=""> <img src="{% static 'client/img/x3.png' %}" alt="">
{% trans 'Сбросить все фильтры' %}</a> <span>{% trans 'Сбросить все фильтры' %}</a></span>
</div> </div>
<div class="filters"> <div class="filters">
@ -18,8 +18,10 @@
{{ field.label }} {{ field.label }}
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</label> </label>
{{ field.help_text|safe }} <span class="filter_help_text">{{ field.help_text|safe }}</span>
{{ field }} <div id="{{ field.auto_id }}">
{{ field }}
</div>
{{ field.errors }} {{ field.errors }}
{% endfor %} {% endfor %}

Loading…
Cancel
Save