Merge branch 'stage5' of bitbucket.org:Bonus_05/expomap into stage5

Conflicts:
	templates/client/includes/events/filter_form.html
1461: Этап №5: Фильтрация событий
remotes/origin/stage5
Alexander Burdeiny 10 years ago
commit 13c6efd2b2
  1. 15
      events/forms.py
  2. 76
      static/client/css/main.css
  3. 2
      static/client/css_min/main.min.css
  4. BIN
      static/client/img/x3.png
  5. 2
      static/client/js/_modules/block.common.js
  6. 8
      static/client/js/scripts.js
  7. 9
      static/client/js/vendor.js
  8. 2
      static/client/js_min/_modules/block.common.min.js
  9. 2
      static/client/js_min/vendor.min.js
  10. 35
      templates/client/includes/events/filter_form.html

@ -258,18 +258,19 @@ class FilterForm(forms.Form):
order_by.append('-' + key) order_by.append('-' + key)
qs = qs.extra(select=select) qs = qs.extra(select=select)
self.fields[field].queryset = qs\ qs = qs.values(*values).order_by(*order_by)
.values(*values)\ # if 'count' in values:
.order_by(*order_by) # qs = qs.exclude(count=0)
self.fields[field].queryset = qs
print(self.fields[field].queryset.query) print(self.fields[field].queryset.query)
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)

@ -12992,3 +12992,79 @@ button.gray:hover {
.news_sharing .sharing_block { .news_sharing .sharing_block {
float: right; float: right;
} }
.filter_form{
background-color: #fff;
border-radius: 3px;
}
.filter_form_header{
background-color: #f60;
text-align: center;
color: #fff;
border-radius: 3px 3px 0px 0px;
line-height: 40px;
font-size: 13px;
font-weight: 700;
text-shadow: 1px 1px rgba(0,0,0,0.35);
text-transform: uppercase;
}
.filter_form_clear_all{
border-left: 1px solid #eee;
border-right: 1px solid #eee;
}
.filter_form_clear_all a{
display: block;
padding: 10px;
background: #f2f2f2;
}
.filter_form ul{
list-style: none;
padding-left: 0px;
}
.filter_form .filters{
border: 1px solid #eee;
border-top: 0px;
border-radius: 0px 0px 3px 3px;
}
.filter_form li label{
display: block;
padding: 5px 10px;
}
.filter_block_label{
padding: 5px 10px;
display: block;
color: #f60;
font-size: 16px;
font-weight: bold;
cursor: pointer;
}
.filter_block_label:after{
content: "";
display: block;
clear: both;
}
.filter_block_label + ul{
/* display: none; */
margin-top: 0px;
}
.filter_block_label i{
float: right;
color: #898989;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -371,7 +371,7 @@ if (EXPO.common){
}; };
$("input[type='checkbox'], input[type='radio']").customRadioCheck(); $("input[type='checkbox']:not(.default), input[type='radio']").customRadioCheck();
// add to calendar button click event functional // add to calendar button click event functional
//$.fancybox('#pw-reg-complete'); //$.fancybox('#pw-reg-complete');

@ -86,6 +86,14 @@ $(document).ready(function () {
//}); //});
$('.filter_block_label').on('click', function(event) {
event.preventDefault();
var $this = $(this);
$this.next('ul').slideToggle(300);
$this.find('.fa').toggleClass('fa-caret-down fa-caret-up');
});
$("div.ht-main_1").each(function () { $("div.ht-main_1").each(function () {

@ -5003,6 +5003,14 @@ $(document).ready(function () {
//}); //});
$('.filter_block_label').on('click', function(event) {
event.preventDefault();
var $this = $(this);
$this.next('ul').slideToggle(300);
$this.find('.fa').toggleClass('fa-caret-down fa-caret-up');
});
$("div.ht-main_1").each(function () { $("div.ht-main_1").each(function () {
@ -5069,6 +5077,7 @@ $(document).ready(function () {
}); });
var Base64 = { var Base64 = {
// private property // private property

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,15 +1,28 @@
{% load i18n %} {% load i18n static %}
<form action="{% url 'events:main' %}" method="get"> <form action="{% url 'events:main' %}" method="get" class="filter_form">
{# {% csrf_token %} #} <div class="filter_form_header">{% trans 'Выбрать по критериям:' %}</div>
{% for field in form %} <div class="filter_form_clear_all">
{% if field.errors %}error{% endif %} <a href="#">
<label for="{{ field.auto_id }}">{{ field.label }}</label> <img src="{% static 'client/img/x3.png' %}" alt="">
{{ field.help_text|safe }} {% trans 'Сбросить все фильтры' %}</a>
{{ field }} </div>
{{ field.errors }}
{% endfor %}
<button type="submit">{% trans "Применить" %}</button> <div class="filters">
{# {% csrf_token %} #}
{% for field in form %}
{% if field.errors %}error{% endif %}
<label for="{{ field.auto_id }}" class="filter_block_label">
{{ field.label }}
<i class="fa fa-caret-down"></i>
</label>
{{ field.help_text|safe }}
{{ field }}
{{ field.errors }}
{% endfor %}
<button type="submit">{% trans "Применить" %}</button>
</div>
</form> </form>

Loading…
Cancel
Save