parent
2c384c9a16
commit
5b5f2eaaca
28 changed files with 2318 additions and 69 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,228 @@ |
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {}; |
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) { |
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) |
||||
/******/ return installedModules[moduleId].exports; |
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = { |
||||
/******/ exports: {}, |
||||
/******/ id: moduleId, |
||||
/******/ loaded: false |
||||
/******/ }; |
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true; |
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports; |
||||
/******/ } |
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules; |
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules; |
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = ""; |
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0); |
||||
/******/ }) |
||||
/************************************************************************/ |
||||
/******/ ([ |
||||
/* 0 */ |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
var _custom_check = __webpack_require__(1); |
||||
|
||||
var _extended_field = __webpack_require__(2); |
||||
|
||||
var _ajax_set_filter = __webpack_require__(3); |
||||
|
||||
var _filter_toggle = __webpack_require__(4); |
||||
|
||||
function paginateTo(pageNum) { |
||||
var $form = $('#filter-form'); |
||||
var postfix = "&page=" + pageNum; |
||||
var $container = $('#resultsBlock'); |
||||
|
||||
(0, _ajax_set_filter.sendData)($form, $container, pageNum); |
||||
(0, _ajax_set_filter.modUrl)($form, postfix); |
||||
return false; |
||||
} |
||||
|
||||
$(function () { |
||||
(0, _custom_check.customCheckInit)(); |
||||
(0, _extended_field.extendedFieldInit)(); |
||||
(0, _filter_toggle.filterToggleInit)(); |
||||
window.sendFilterData = _ajax_set_filter.sendFilterData; |
||||
window.paginateTo = paginateTo; |
||||
}); |
||||
|
||||
/***/ }, |
||||
/* 1 */ |
||||
/***/ function(module, exports) { |
||||
|
||||
"use strict"; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function customCheckInit() { |
||||
function tuneCheckBoxes($boxes) { |
||||
var currentState = $boxes.find("input").prop("checked") ? 'checked' : 'not-checked'; |
||||
$boxes.find("div").hide(); |
||||
$boxes.find("div." + currentState).show(); |
||||
} |
||||
|
||||
var $boxes = $('.custom-check'); |
||||
tuneCheckBoxes($boxes); |
||||
$boxes.on("click", function (e) { |
||||
var inside_checkBox = $(e.target).parent().find("input"); |
||||
inside_checkBox.prop("checked", !inside_checkBox.prop("checked")); |
||||
tuneCheckBoxes($boxes); |
||||
e.preventDefault(); |
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
exports.customCheckInit = customCheckInit; |
||||
|
||||
/***/ }, |
||||
/* 2 */ |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function extendedFieldInit() { |
||||
|
||||
var $buttonF1 = $('.resButton'); |
||||
if ($('.slide').hasClass("active")) $buttonF1.css('transform', 'rotate(0deg)'); |
||||
|
||||
$buttonF1.on("click", function (e) { |
||||
e.preventDefault(); |
||||
var $slide = $('.slide'); |
||||
if ($slide.hasClass("active")) { |
||||
$buttonF1.css('transform', 'rotate(180deg)'); |
||||
$slide.slideUp(300); |
||||
} else { |
||||
$buttonF1.css('transform', 'rotate(0deg)'); |
||||
$slide.slideDown(300); |
||||
} |
||||
$slide.toggleClass("active"); |
||||
}); |
||||
} |
||||
|
||||
exports.extendedFieldInit = extendedFieldInit; |
||||
|
||||
/***/ }, |
||||
/* 3 */ |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function getFormData($form, pageNum) { |
||||
var unindexed_array = $form.serializeArray(); |
||||
var indexed_array = {}; |
||||
|
||||
$.map(unindexed_array, function (n, i) { |
||||
indexed_array[n['name']] = n['value']; |
||||
}); |
||||
indexed_array["page"] = pageNum || ""; |
||||
return indexed_array; |
||||
} |
||||
|
||||
// TODO: Восстановление фильтров из URL
|
||||
function modUrl($form, postfix) { |
||||
var curLoc = '?' + $form.serialize() + (postfix || ""); |
||||
try { |
||||
history.replaceState($form.serialize(), null, curLoc); |
||||
} catch (e) { |
||||
console.log("Error!"); |
||||
} |
||||
} |
||||
|
||||
function sendData($form, $update_container, pageNum) { |
||||
function updateResults(html) { |
||||
$update_container.html(html); |
||||
var title = $('#titleScore').val(); |
||||
$('.search-num').html(title); |
||||
} |
||||
|
||||
console.log("form method = ", $form.attr("method")); |
||||
$.ajax({ |
||||
url: $form.attr("action"), |
||||
type: $form.attr("method"), |
||||
dataType: 'html', |
||||
data: getFormData($form, pageNum), |
||||
beforeSend: function beforeSend(xhr) { |
||||
xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken')); |
||||
}, |
||||
success: updateResults, |
||||
error: function error(data) { |
||||
return console.log("Error", data); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
function sendFilterData($form, $update_container) { |
||||
sendData($form, $update_container); |
||||
modUrl($form); |
||||
return false; |
||||
} |
||||
|
||||
exports.sendFilterData = sendFilterData; |
||||
exports.sendData = sendData; |
||||
exports.modUrl = modUrl; |
||||
|
||||
/***/ }, |
||||
/* 4 */ |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function filterToggleInit() { |
||||
var $group = $('.btn-group.toggle'); |
||||
var $buttons = $group.find('a.btn').add('.link-sort a.btn'); |
||||
// let $input = $('input[name="party_types"]');
|
||||
|
||||
$buttons.on("click", function (e) { |
||||
e.preventDefault(); |
||||
var $target = $(e.target); |
||||
var $parent = $target.parent(); |
||||
// console.log('parent class = ', $parent.attr("class"));
|
||||
$parent.children().removeClass('active'); |
||||
$target.addClass('active'); |
||||
// console.log('type = ', $target.data("type"));
|
||||
$parent.find('input').val($target.data("type")); |
||||
// console.log('click');
|
||||
sendFilterData($('#filter-form'), $('#resultsBlock')); |
||||
}); |
||||
} |
||||
|
||||
exports.filterToggleInit = filterToggleInit; |
||||
|
||||
/***/ } |
||||
/******/ ]); |
||||
@ -0,0 +1,65 @@ |
||||
// `
|
||||
import SelectedContainer from 'components/SelectedContainer'; |
||||
import NoTreeSelect from 'components/NoTreeSelect'; |
||||
import TreeSelect from 'components/TreeSelect'; |
||||
|
||||
$(function () { |
||||
function createFilterSpecs(url) { |
||||
// SPECIALIZATIONS FILTER
|
||||
let sb_main = new TreeSelect($('#select-box-1'), {url, visible: true, hasEditableContainer: true}); |
||||
sb_main.setHeader("Тип готовой работы"); |
||||
let select_container = new SelectedContainer($('#selected-spec'), {obj: sb_main}); |
||||
sb_main.connectSelectedContainer(select_container); |
||||
let sb_1 = new TreeSelect($('#select-box-2'), {obj: sb_main}); |
||||
let sb_2 = new TreeSelect($('#select-box-3'), {obj: sb_main}); |
||||
let sb_3 = new TreeSelect($('#select-box-4'), {obj: sb_main}); |
||||
let sb_4 = new TreeSelect($('#select-box-5'), {obj: sb_main}); |
||||
|
||||
sb_main.setNearbySelectBox(sb_1); |
||||
sb_1.setNearbySelectBox(sb_2, sb_main); |
||||
sb_2.setNearbySelectBox(sb_3, sb_1); |
||||
sb_3.setNearbySelectBox(sb_4, sb_2); |
||||
sb_4.setNearbySelectBox("", sb_3); |
||||
|
||||
} |
||||
|
||||
function createFilterBuildingClass(url) { |
||||
// BUILDING-CLASSIFICATION FILTER
|
||||
let sb_build_main = new TreeSelect($('#sb-building-classification'), {url, visible:true}); |
||||
sb_build_main.setHeader("Классификация здания"); |
||||
|
||||
let sb_build_1 = new TreeSelect($('#sb-building-sub-classification'), {obj: sb_build_main}); |
||||
|
||||
let select_build_container = new SelectedContainer($('#selected-building-classification'), {obj: sb_build_main}); |
||||
sb_build_main.connectSelectedContainer(select_build_container); |
||||
|
||||
sb_build_main.setNearbySelectBox(sb_build_1); |
||||
sb_build_1.setNearbySelectBox("", sb_build_main); |
||||
} |
||||
|
||||
function createFilterConstructionType(url) { |
||||
let sb_constr_main = new NoTreeSelect($('#sb-construction-type'), {url, visible:true}); |
||||
sb_constr_main.setHeader("Вид строительства"); |
||||
let select_constr_type = new SelectedContainer($('#selected-construction-type'), {obj:sb_constr_main, noTree: true}); |
||||
sb_constr_main.connectSelectedContainer(select_constr_type); |
||||
} |
||||
|
||||
function createFilerLocations(url) { |
||||
let sb_loc_main = new TreeSelect($('#sb-location-1'), {url, visible:true}); |
||||
sb_loc_main.setHeader("Проектное местоположение"); |
||||
let select_loc = new SelectedContainer($('#selected-location'), {obj: sb_loc_main}); |
||||
sb_loc_main.connectSelectedContainer(select_loc); |
||||
let sb_loc_1 = new TreeSelect($('#sb-location-2'), {obj: sb_loc_main}); |
||||
let sb_loc_2 = new TreeSelect($('#sb-location-3'), {obj: sb_loc_main}); |
||||
|
||||
sb_loc_main.setNearbySelectBox(sb_loc_1); |
||||
sb_loc_1.setNearbySelectBox(sb_loc_2, sb_loc_main); |
||||
sb_loc_2.setNearbySelectBox("", sb_loc_1); |
||||
|
||||
} |
||||
|
||||
createFilterSpecs('/api/specializations_flat'); |
||||
createFilterBuildingClass('/api/building_classifications'); |
||||
createFilterConstructionType('/api/construction_type'); |
||||
createFilerLocations('/api/locations_flat'); |
||||
}); |
||||
@ -0,0 +1,22 @@ |
||||
import {customCheckInit} from './seeds/custom_check' |
||||
import {extendedFieldInit} from './seeds/extended_field' |
||||
import {sendFilterData, sendData, modUrl} from './seeds/ajax_set_filter' |
||||
import {filterToggleInit} from './seeds/filter_toggle' |
||||
|
||||
function paginateTo(pageNum) { |
||||
const $form = $('#filter-form'); |
||||
const postfix = "&page=" + pageNum; |
||||
const $container = $('#resultsBlock'); |
||||
|
||||
sendData($form, $container, pageNum); |
||||
modUrl($form, postfix); |
||||
return false; |
||||
} |
||||
|
||||
$(function () { |
||||
customCheckInit(); |
||||
extendedFieldInit(); |
||||
filterToggleInit(); |
||||
window.sendFilterData = sendFilterData; |
||||
window.paginateTo = paginateTo; |
||||
}); |
||||
@ -0,0 +1,78 @@ |
||||
@import "base/variavles" |
||||
$size: 250px |
||||
$figure_size: 50px |
||||
.cards |
||||
display: flex |
||||
align-items: flex-start |
||||
flex-flow: row wrap |
||||
.worksell-card |
||||
//&:first-child |
||||
// margin-left: 0 |
||||
// margin-right: 0 |
||||
margin: 15px |
||||
display: inline-block |
||||
a |
||||
-webkit-transition: all 0.3s ease-out |
||||
-moz-transition: all 0.3s ease-out |
||||
transition: all 0.3s ease-out |
||||
display: inline-block |
||||
color: #235080 |
||||
a:hover, |
||||
a:visited |
||||
.img-figure |
||||
opacity: 1 |
||||
transform: scale(1.06) |
||||
text-decoration: none |
||||
color: #121880 |
||||
box-shadow: 0 0 10px rgba(0,0,0,0.7) |
||||
.img-block |
||||
width: $size |
||||
//border: 1px solid red |
||||
position: relative |
||||
.img |
||||
width: $size |
||||
height: $size |
||||
border: 10px solid #F2F2F2 |
||||
background: |
||||
repeat: no-repeat |
||||
position: center |
||||
size: cover |
||||
.cost-wrapper |
||||
position: absolute |
||||
bottom: 0 |
||||
width: 100% |
||||
text-align: center |
||||
.cost |
||||
color: #fb2c2d |
||||
font-size: 18px |
||||
display: inline-block |
||||
min-width: $size*0.8 |
||||
background-color: white |
||||
padding: 4px 8px |
||||
//border: 1px solid black |
||||
|
||||
.name-block |
||||
margin-top: 15px |
||||
max-width: $size |
||||
text-align: center |
||||
|
||||
.img-figure |
||||
width: $figure_size |
||||
height: $figure_size |
||||
-webkit-transition: all 0.3s ease-out |
||||
-moz-transition: all 0.3s ease-out |
||||
transition: all 0.3s ease-out |
||||
border-radius: 100% |
||||
background: |
||||
image: url("#{$static}/img/img.png") |
||||
repeat: no-repeat |
||||
position: center |
||||
//size: cover |
||||
color: rgba(211,211,211,0.8) |
||||
position: absolute |
||||
top: 50% |
||||
left: 50% |
||||
margin-left: -$figure_size/2 |
||||
margin-top: -$figure_size/2 |
||||
opacity: 0 |
||||
|
||||
@ -0,0 +1,147 @@ |
||||
<form id="filter-form" action="{% url 'work_sell:filter' %}" method="POST" novalidate> |
||||
|
||||
<div class="filter form-container"> |
||||
<div class="triangle1"></div> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<div id="select-box-1"></div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-2"></div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-3"></div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-4"></div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="select-box-5"></div> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<div class="selected-container horizontal" id="selected-spec"> |
||||
<input type="hidden" name="specialization" |
||||
value="{{ specialization }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row separator"> |
||||
<div class="col-lg-12"> |
||||
<div class="flex"> |
||||
<span class="header" style="margin-right: 10px"> |
||||
<span>Поиск по ключевым словам и фразам </span> |
||||
<i class="fa fa-question-circle-o" aria-hidden="true" title="bla-bla-bla..."></i> |
||||
</span> |
||||
<div class="border"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-6"> |
||||
<input |
||||
type="text" |
||||
name="keywords" |
||||
{# onkeydown="event.keyCode === 13 && $(this).closest('form').submit()"#} |
||||
value="{{ keywords }}" |
||||
class="select-box-search" |
||||
placeholder="Ключевые слова, фразы"> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
{# $(this).closest('form').submit(); return false#} |
||||
<a href="" class="findReal" |
||||
onclick="sendFilterData($('#filter-form'), $('#resultsBlock')); return false"> |
||||
найти проект |
||||
</a> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<a href="{% url 'work_sell:filter' %}" class="clearSearch"> |
||||
{# TODO: Сделать очистку, без перезагрузки#} |
||||
Очистить фильтр |
||||
</a> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="row separator"> |
||||
<div class="col-lg-12"> |
||||
<div class="flex"> |
||||
<span class="header">Расширенные поля</span> |
||||
<button class="resButton"> |
||||
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span> |
||||
</button> |
||||
<div class="border"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="slide {% if has_additional_fields %} active{% endif %}"> |
||||
<div class="row"> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-building-classification"></div> |
||||
<div class="vertical-child" id="sb-building-sub-classification"></div> |
||||
<div class="selected-container" id="selected-building-classification"> |
||||
<input type="hidden" name="building_classification" |
||||
value="{{ building_classification }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-construction-type"></div> |
||||
<div class="selected-container" id="selected-construction-type"> |
||||
<input type="hidden" name="construction_type" |
||||
value="{{ construction_type }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="vertical-child" id="sb-location-1"></div> |
||||
<div class="vertical-child" id="sb-location-2"></div> |
||||
<div class="vertical-child" id="sb-location-3"></div> |
||||
<div class="selected-container" id="selected-location"> |
||||
<input type="hidden" name="location" |
||||
value="{{ location }}"> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<div class="select-box-header vertical-child"> |
||||
<span style="font-size: 11pt" class="header">Требуется электронная версия</span> |
||||
<i class="fa fa-question-circle-o" aria-hidden="true" |
||||
title="bla-bla-bla..."></i> |
||||
</div> |
||||
|
||||
<div class="custom-check"> |
||||
<div class="checked"></div> |
||||
<div style="display: none" class="not-checked"></div> |
||||
<input name="el_format" type="checkbox" hidden {% if el_format %} checked{% endif %}> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{# <p class="title-scope search-num">#} |
||||
{# #} |
||||
{# </p>#} |
||||
<div class="row title-scope" style="border-bottom: none"> |
||||
<div class="col-lg-12"> |
||||
<p class="search-num"> |
||||
{{ display_msg }} |
||||
</p> |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="link-sort"> |
||||
<p>Сортировать по:</p> |
||||
{% for val, text in choices %} |
||||
<a class="btn btn-default" |
||||
data-type="{{ val }}" |
||||
onclick=""> |
||||
{{ text }} |
||||
</a> |
||||
{% endfor %} |
||||
<input type="hidden" name="order_by" value=""> |
||||
</div> |
||||
</form> |
||||
@ -0,0 +1,20 @@ |
||||
{% load sass_tags %} |
||||
|
||||
<input id="titleScore" type="hidden" value="{{ display_msg }}"> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-12 cards"> |
||||
{% for work in worksells %} |
||||
{# <div class="col-lg-3">#} |
||||
{% include 'partials/inc-worksell_card.html' %} |
||||
{# </div>#} |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-12 pagin"> |
||||
{% include 'partials/ajax_pagination.html' %} |
||||
</div> |
||||
</div> |
||||
@ -0,0 +1,19 @@ |
||||
{% load staticfiles %} |
||||
{% load thumbnail %} |
||||
{#/static/sass/elements/worksell_card.sass - стиль карточки отдельно#} |
||||
<div class="worksell-card"> |
||||
<a href="{% url 'work_sell:detail' work.pk %}"> |
||||
<div class="img-block"> |
||||
<div class="img" style="background-image: url('{{ work.get_cover.url }}')"></div> |
||||
<div class="img-figure"></div> |
||||
<div class="cost-wrapper"> |
||||
<span class="cost"> |
||||
{{ work.budget }}<i class="fa fa-rub"></i> |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div class="name-block"> |
||||
{{ work }} |
||||
</div> |
||||
</a> |
||||
</div> |
||||
@ -0,0 +1,39 @@ |
||||
{% extends 'partials/_base.html' %} |
||||
{% load sass_tags %} |
||||
{% load static %} |
||||
{% block personal_css %} |
||||
<link rel='stylesheet' href='{% sass_src "sass/components/custom-components.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "lib/proekton-components/sass/components.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "sass/elements/worksell_card.sass" %}'> |
||||
{% endblock %} |
||||
|
||||
{% block content %} |
||||
<div class="container main-scope"> |
||||
<div class="row title-scope" style="border-bottom: none"> |
||||
<div class="col-lg-12"> |
||||
<p> |
||||
Поиск готовых проектов |
||||
</p> |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
{% include 'partials/inc-worksell-filter.html' %} |
||||
</div> |
||||
</div> |
||||
|
||||
<div id="resultsBlock"> |
||||
{% include 'partials/inc-worksell-results.html' %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block personal_js %} |
||||
<script src='{% static "js/build/init_worksell_filter.js" %}'></script> |
||||
<script src='{% static "js/build/worksell_filter.js" %}'></script> |
||||
{% endblock %} |
||||
Loading…
Reference in new issue