|
|
|
|
@ -4946,69 +4946,133 @@ function set_filter_block_height () { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
function build_filters_period () { |
|
|
|
|
// работа с ссылкой "уточнить дату в боковом фильтре"
|
|
|
|
|
var $period_link = $('#filter_period_trigger'), |
|
|
|
|
$filters = $('#filter_form_wraper'), |
|
|
|
|
$month_block = $filters.find('#id_month'); |
|
|
|
|
|
|
|
|
|
set_filter_block_height(); |
|
|
|
|
$period_link.insertAfter('#id_date_to').wrap($('<div></div>', {class: 'period_block'})); |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').on('click', '.show_more_link', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var $block = $(this).parents('.filter_block'), |
|
|
|
|
li_length = $block.find('li').length, |
|
|
|
|
visible_length = $block.find('li:visible').length; |
|
|
|
|
|
|
|
|
|
for (var i = 0; i < 10; i++){ |
|
|
|
|
if (visible_length + i != li_length) { |
|
|
|
|
$block.find('li').eq(visible_length + i).fadeIn(200); |
|
|
|
|
} else { |
|
|
|
|
$(this).parent().hide(); |
|
|
|
|
} |
|
|
|
|
if ($filters.find('#dateFrom').val() || $filters.find('#dateTo').val()){ |
|
|
|
|
$month_block.hide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('#filterPeriod').on('click', '.modal-approve', function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
if ($('#filterPeriod input[name="from"]').val().length || $('#filterPeriod input[name="to"]').val().length) { |
|
|
|
|
|
|
|
|
|
var new_from_val = $('#filterPeriod input[name="from"]').val(), |
|
|
|
|
new_to_val = $('#filterPeriod input[name="to"]').val(); |
|
|
|
|
|
|
|
|
|
$filters.find('#id_date_from input').val(new_from_val); |
|
|
|
|
$filters.find('#id_date_to input').val(new_to_val); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.fancybox.close(); |
|
|
|
|
submit_search_form (); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').on('click', '.show_all_link', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var $block = $(this).parents('.filter_block'); |
|
|
|
|
$block.find('li').fadeIn(200); |
|
|
|
|
$block.find('.links_block').hide(); |
|
|
|
|
function submit_search_form () { |
|
|
|
|
var $form = $('.filter_form'), |
|
|
|
|
params = $form.serialize(), |
|
|
|
|
filters_url = $form.data('formurl'), |
|
|
|
|
results_url = $form.data('resultsurl'), |
|
|
|
|
$loader = $('#wait-ajax'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$loader.show(); |
|
|
|
|
|
|
|
|
|
$('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500); |
|
|
|
|
|
|
|
|
|
$.getJSON(results_url, params, function(data) { |
|
|
|
|
if (data.success) { |
|
|
|
|
|
|
|
|
|
$('.page-body').html(data.results); |
|
|
|
|
$loader.hide(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$.getJSON(filters_url, params, function (data) { |
|
|
|
|
if (data.success){ |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').html(data.form); |
|
|
|
|
set_filter_block_height(); |
|
|
|
|
build_filters_period(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').on('click', '#get_filters', function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var search_string = '', |
|
|
|
|
$link = $(this); |
|
|
|
|
$(document).ready(function () { |
|
|
|
|
|
|
|
|
|
set_filter_block_height(); |
|
|
|
|
|
|
|
|
|
$link.html('<img src="/static/client/img/wait.gif">'); |
|
|
|
|
$('#filter_form_wraper') |
|
|
|
|
.on('click', '.show_more_link', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var $block = $(this).parents('.filter_block'), |
|
|
|
|
li_length = $block.find('li').length, |
|
|
|
|
visible_length = $block.find('li:visible').length; |
|
|
|
|
|
|
|
|
|
for (var i = 0; i < 10; i++){ |
|
|
|
|
if (visible_length + i != li_length) { |
|
|
|
|
$block.find('li').eq(visible_length + i).fadeIn(200); |
|
|
|
|
} else { |
|
|
|
|
$(this).parent().hide(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.on('click', '.show_all_link', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var $block = $(this).parents('.filter_block'); |
|
|
|
|
$block.find('li').fadeIn(200); |
|
|
|
|
$block.find('.links_block').hide(); |
|
|
|
|
}) |
|
|
|
|
.on('click', '#get_filters', function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var search_string = '', |
|
|
|
|
$link = $(this); |
|
|
|
|
|
|
|
|
|
$.each(window.sendData, function(i, val) { |
|
|
|
|
var key = i; |
|
|
|
|
$link.html('<img src="/static/client/img/wait.gif">'); |
|
|
|
|
|
|
|
|
|
$.each(window.sendData, function(i, val) { |
|
|
|
|
var key = i; |
|
|
|
|
|
|
|
|
|
if ( val.length ) { |
|
|
|
|
if ( $.type(val) == 'array' ){ |
|
|
|
|
for(var j = 0; j < val.length; j++){ |
|
|
|
|
search_string += key + '=' + val[j] + '&'; |
|
|
|
|
|
|
|
|
|
if ( val.length ) { |
|
|
|
|
if ( $.type(val) == 'array' ){ |
|
|
|
|
for(var j = 0; j < val.length; j++){ |
|
|
|
|
search_string += key + '=' + val[j] + '&'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( $.type(val) == 'string'){ |
|
|
|
|
search_string += key + '=' + val + '&'; |
|
|
|
|
if ( $.type(val) == 'string'){ |
|
|
|
|
search_string += key + '=' + val + '&'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: $link.attr('href'), |
|
|
|
|
data: search_string |
|
|
|
|
}) |
|
|
|
|
.done(function(data) { |
|
|
|
|
if (data.success) { |
|
|
|
|
$('#filter_form_wraper').html(data.form); |
|
|
|
|
set_filter_block_height(); |
|
|
|
|
build_filters_period(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: $link.attr('href'), |
|
|
|
|
data: search_string |
|
|
|
|
}) |
|
|
|
|
.done(function(data) { |
|
|
|
|
if (data.success) { |
|
|
|
|
$('#filter_form_wraper').html(data.form); |
|
|
|
|
set_filter_block_height(); |
|
|
|
|
} |
|
|
|
|
.on('click', '#filter_period_trigger', function (event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
// $('#pwPeriod').fadeIn();
|
|
|
|
|
$.fancybox.open('#filterPeriod') |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#get_filters').trigger('click'); |
|
|
|
|
|
|
|
|
|
$('.page-body').on('click', '.ajax-paginator a:not(.disabled)', function(e) { |
|
|
|
|
@ -5032,90 +5096,15 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('body').on('click', '#clearPeriod', function (event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper #id_date_from input').val(''); |
|
|
|
|
$('#filter_form_wraper #id_date_to input').val(''); |
|
|
|
|
|
|
|
|
|
//$('ul.about_block_menu li.m_01').click(function () {
|
|
|
|
|
// $(this).parents('ul').find('li').removeClass('active');
|
|
|
|
|
//$(this).addClass('active');
|
|
|
|
|
//$(this).parents('ul').removeClass('about_active');
|
|
|
|
|
//$('div.about_block').removeClass('about_show');
|
|
|
|
|
//$('div.team_about_block').addClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block').removeClass('about_show');
|
|
|
|
|
//
|
|
|
|
|
//$('div.team_about_block_text').addClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block_text').removeClass('about_show');
|
|
|
|
|
// return false;
|
|
|
|
|
//});
|
|
|
|
|
//
|
|
|
|
|
//$('ul.about_block_menu li.m_02').click(function () {
|
|
|
|
|
// $(this).parents('ul').find('li').removeClass('active');
|
|
|
|
|
//$(this).addClass('active');
|
|
|
|
|
//$(this).parents('ul').removeClass('about_active');
|
|
|
|
|
//$('div.about_block').removeClass('about_show');
|
|
|
|
|
//$('div.team_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block').addClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block').removeClass('about_show');
|
|
|
|
|
//
|
|
|
|
|
//$('div.team_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block_text').addClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block_text').removeClass('about_show');
|
|
|
|
|
// return false;
|
|
|
|
|
//});
|
|
|
|
|
//
|
|
|
|
|
//$('ul.about_block_menu li.m_03').click(function () {
|
|
|
|
|
// $(this).parents('ul').find('li').removeClass('active');
|
|
|
|
|
//$(this).addClass('active');
|
|
|
|
|
//$(this).parents('ul').removeClass('about_active');
|
|
|
|
|
//$('div.about_block').removeClass('about_show');
|
|
|
|
|
//$('div.team_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block').addClass('about_show');
|
|
|
|
|
//$('div.review_about_block').removeClass('about_show');
|
|
|
|
|
//
|
|
|
|
|
//$('div.team_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block_text').addClass('about_show');
|
|
|
|
|
//$('div.review_about_block_text').removeClass('about_show');
|
|
|
|
|
// return false;
|
|
|
|
|
//});
|
|
|
|
|
//
|
|
|
|
|
//$('ul.about_block_menu li.m_04').click(function () {
|
|
|
|
|
// $(this).parents('ul').find('li').removeClass('active');
|
|
|
|
|
//$(this).addClass('active');
|
|
|
|
|
//$(this).parents('ul').removeClass('about_active');
|
|
|
|
|
//$('div.about_block').removeClass('about_show');
|
|
|
|
|
//$('div.team_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block').addClass('about_show');
|
|
|
|
|
//
|
|
|
|
|
//$('div.team_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block_text').addClass('about_show');
|
|
|
|
|
// return false;
|
|
|
|
|
//});
|
|
|
|
|
//
|
|
|
|
|
//$('ul.about_block_menu li.m_05').click(function () {
|
|
|
|
|
// $(this).parents('ul').find('li').removeClass('active');
|
|
|
|
|
//$(this).parents('ul').addClass('about_active');
|
|
|
|
|
//$('div.about_block').addClass('about_show');
|
|
|
|
|
//$('div.team_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block').removeClass('about_show');
|
|
|
|
|
//
|
|
|
|
|
//$('div.team_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.parnters_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.contacts_about_block_text').removeClass('about_show');
|
|
|
|
|
//$('div.review_about_block_text').removeClass('about_show');
|
|
|
|
|
// return false;
|
|
|
|
|
//});
|
|
|
|
|
$.fancybox.close(); |
|
|
|
|
submit_search_form(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').on('click', '.filter_block_label', function(event) { |
|
|
|
|
@ -5129,43 +5118,7 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').on('change', 'input[type="checkbox"]', function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var $form = $('.filter_form'), |
|
|
|
|
params = $form.serialize(), |
|
|
|
|
filters_url = $form.data('formurl'), |
|
|
|
|
results_url = $form.data('resultsurl'), |
|
|
|
|
$loader = $('#wait-ajax'); |
|
|
|
|
// form_done = false,
|
|
|
|
|
// results_done = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$loader.show(); |
|
|
|
|
|
|
|
|
|
$('html, body').animate({scrollTop: $('.page-body').offset().top - 50}, 500); |
|
|
|
|
|
|
|
|
|
$.getJSON(results_url, params, function(data) { |
|
|
|
|
if (data.success) { |
|
|
|
|
//results_done = true;
|
|
|
|
|
$('.page-body').html(data.results); |
|
|
|
|
|
|
|
|
|
// if (results_done && form_done){
|
|
|
|
|
// $loader.hide();
|
|
|
|
|
// }
|
|
|
|
|
$loader.hide(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$.getJSON(filters_url, params, function (data) { |
|
|
|
|
if (data.success){ |
|
|
|
|
//form_done = true;
|
|
|
|
|
|
|
|
|
|
$('#filter_form_wraper').html(data.form); |
|
|
|
|
set_filter_block_height(); |
|
|
|
|
|
|
|
|
|
// if (results_done && form_done){
|
|
|
|
|
// $loader.hide();
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
submit_search_form(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|