commit
8c3253a427
31 changed files with 3767 additions and 1146 deletions
@ -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 = $('#contractorsBlock'); |
||||
|
||||
(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'), $('#contractorsBlock')); |
||||
}); |
||||
} |
||||
|
||||
exports.filterToggleInit = filterToggleInit; |
||||
|
||||
/***/ } |
||||
/******/ ]); |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,195 @@ |
||||
/******/ (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); |
||||
|
||||
function paginateTo(pageNum) { |
||||
var $form = $('#filter-form'); |
||||
var postfix = "&page=" + pageNum; |
||||
var $container = $('#projectsBlock'); |
||||
|
||||
(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)(); |
||||
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; |
||||
|
||||
/***/ } |
||||
/******/ ]); |
||||
@ -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 = $('#contractorsBlock'); |
||||
|
||||
sendData($form, $container, pageNum); |
||||
modUrl($form, postfix); |
||||
return false; |
||||
} |
||||
|
||||
$(function () { |
||||
customCheckInit(); |
||||
extendedFieldInit(); |
||||
filterToggleInit(); |
||||
window.sendFilterData = sendFilterData; |
||||
window.paginateTo = paginateTo; |
||||
}); |
||||
@ -0,0 +1,64 @@ |
||||
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, hasEditableContainer: true, visible: 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,20 @@ |
||||
import {customCheckInit} from './seeds/custom_check' |
||||
import {extendedFieldInit} from './seeds/extended_field' |
||||
import {sendFilterData, sendData, modUrl} from './seeds/ajax_set_filter' |
||||
|
||||
function paginateTo(pageNum) { |
||||
const $form = $('#filter-form'); |
||||
const postfix = "&page=" + pageNum; |
||||
const $container = $('#projectsBlock'); |
||||
|
||||
sendData($form, $container, pageNum); |
||||
modUrl($form, postfix); |
||||
return false; |
||||
} |
||||
|
||||
$(function () { |
||||
customCheckInit(); |
||||
extendedFieldInit(); |
||||
window.sendFilterData = sendFilterData; |
||||
window.paginateTo = paginateTo; |
||||
}); |
||||
@ -0,0 +1,49 @@ |
||||
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) { |
||||
let 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); |
||||
let 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 (xhr) { |
||||
xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken')); |
||||
}, |
||||
success: updateResults, |
||||
error: (data) => console.log("Error", data) |
||||
}); |
||||
} |
||||
|
||||
function sendFilterData($form, $update_container) { |
||||
sendData($form, $update_container); |
||||
modUrl($form); |
||||
return false; |
||||
} |
||||
|
||||
export {sendFilterData, sendData, modUrl} |
||||
@ -0,0 +1,20 @@ |
||||
function filterToggleInit() { |
||||
let $group = $('.btn-group.toggle'); |
||||
let $buttons = $group.find('a.btn').add('.link-sort a.btn'); |
||||
// let $input = $('input[name="party_types"]');
|
||||
|
||||
$buttons.on("click", function (e) { |
||||
e.preventDefault(); |
||||
let $target = $(e.target); |
||||
let $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'), $('#contractorsBlock')); |
||||
}) |
||||
} |
||||
|
||||
export {filterToggleInit} |
||||
@ -1,521 +1,34 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% load common_tags %} |
||||
{% load specializtions_tags %} |
||||
{% load thumbnail %} |
||||
{% load i18n %} |
||||
{% extends 'partials/_base.html' %} |
||||
{% load sass_tags %} |
||||
{% load static %} |
||||
{% block personal_css %} |
||||
<link rel='stylesheet' href='{% sass_src "sass/old_main.sass" %}'> |
||||
<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='{% static "css/project_filter.css" %}'> |
||||
{% endblock %} |
||||
|
||||
{% block content %} |
||||
{% include 'partials/modals/project_selection.html' %} |
||||
{% include 'partials/header.html' %} |
||||
|
||||
|
||||
<div class="container mainScore"> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<p class="titleScore">{% if display_msg %}{{ display_msg }}{% else %}Поиск исполнителей{% endif %}</p> |
||||
</div> |
||||
|
||||
|
||||
<form action="{% url 'users:contractor-filter' %}" method="GET" novalidate> |
||||
<div class="col-lg-12"> |
||||
<div class="filter clearfix -spec-work-type-combo-container"> |
||||
<div class="triangle1"></div> |
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-3">{% trans 'project_stage0' %}</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
{{ form.work_type }} |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage1' %} <span style="color: red">{{ form.specialization.errors.as_text }}</span></div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-1" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold"><span class="-dynamic-label">{% trans 'project_stage2' %}</span></div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-2" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage3' %}</div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-3" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage4' %}</div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-4" style="width: 100%"> |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.specialization.html_name }}" value="{{ form.specialization.value }}" class="-chosen-spec-id"> |
||||
</div> |
||||
|
||||
|
||||
<div class="searchF1 polsF1 polsFF polsF3 resSearchF1"> |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="findReal" onclick="$(this).closest('form').submit(); return false"> |
||||
найти исполнителя |
||||
</a> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<a href="{% url 'users:contractor-filter' %}" class="clearSearch"> |
||||
Очистить фильтр |
||||
</a> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="resSearchF1"> |
||||
<div class="col-lg-3"> |
||||
<p class="titleResF1">Расширенный поиск</p> |
||||
<button class="resButtonF1"> |
||||
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span> |
||||
</button> |
||||
</div> |
||||
<div class="col-lg-9"> |
||||
<div class="borderS1"></div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="slideRes disTab activeSlide"> |
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-12">Местоположение</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-country" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-region" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-city" style="width: 100%"> |
||||
</div> |
||||
|
||||
<input type="hidden" id="chosenLocationId" name="{{ form.location.html_name }}" value="{{ form.location.value }}"> |
||||
</div> |
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-3">Классификация здания</div> |
||||
<div class="col-lg-3">Вид строительства</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
{{ form.building_classification }} |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
{{ form.construction_type }} |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<label>{{ form.cro }}<span></span></label> |
||||
<p>Требуется допуск (СРО)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
</div> |
||||
<div class="old-main"> |
||||
<div class="container mainScore "> |
||||
<div class="row" style="padding: 0 15px"> |
||||
<div class="col-lg-12 "> |
||||
<p class="titleScore">Поиск Исполнителей</p> |
||||
</div> |
||||
|
||||
|
||||
|
||||
<div class="buttonGP disTab"> |
||||
<div class="btn-group valProject valProject2" role="group" aria-label="..."> |
||||
{% for val, text in form.party_types.field.choices %} |
||||
<button |
||||
type="submit" |
||||
name="{{ form.party_types.html_name }}" |
||||
value="{{ val }}" |
||||
class="{% if val == last_party_types or not last_party_types and val == 'all' %}active{% endif %} btn btn-default"> |
||||
{{ text }} |
||||
</button> |
||||
{% endfor %} |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.last_party_types.html_name }}" value="{{ last_party_types }}"> |
||||
|
||||
<div class="polsF1 disTab polsSearch"> |
||||
<div class="col-lg-3"> |
||||
<select name="{{ form.order_by.html_name }}" onchange="$(this).closest('form').submit()" class="selectpicker"> |
||||
{% for val, text in form.order_by.field.choices %} |
||||
<option value="{{ val }}">{{ text }}</option> |
||||
{% endfor %} |
||||
</select> |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.last_order_by.html_name }}" value="{{ last_order_by }}"> |
||||
<input type="checkbox" name="{{ form.reverse_order.html_name }}" {% if reverse_order %}checked{% endif %} style="display: none"> |
||||
{% include 'partials/inc-contractors-filter.html' %} |
||||
|
||||
<div class="col-lg-12 "> |
||||
<div id="contractorsBlock"> |
||||
{% include 'partials/inc-contractors-results.html' %} |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
|
||||
|
||||
{% for obj in coll %} |
||||
{% if obj|class_name == 'Team' %} |
||||
{% with team=obj %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if team.owner.avatar %} |
||||
{% thumbnail team.owner.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if team.owner.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}">{{ team.name }}</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ team.created|date:"d M Y"}}</p> |
||||
<div class="statusUser">Свободен</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
<li> |
||||
{% if request.user.is_customer %} |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ team.owner.pk }}" |
||||
data-team-id="{{ team.pk }}" |
||||
data-is-team-offer="true" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
{% endif %} |
||||
</li> |
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ team.owner.pk }}#user{{ team.owner.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_team_widget team_id=team.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_team_widget team.pk 'restList2' %} |
||||
|
||||
<!-- TODO --> |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
{% if TEMPLATE_DEBUG %} |
||||
<div class="col-lg-12" style="margin-bottom: 20px"> |
||||
<pre><!-- |
||||
--><b>######## Team owner #########</b><br><!-- |
||||
--><br><!-- |
||||
--><b>Specializations:</b> {{ team.owner.contractor_specializations.all }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {{ team.owner.location }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for o in team.owner.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for o in team.owner.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {{ team.owner.cro }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for o in team.owner.orders.all %}{{ o.project.work_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><br><!-- |
||||
--><br><!-- |
||||
--><b>######## Team users #########</b><br><!-- |
||||
--><br><!-- |
||||
--><b>Specializations:</b> {% for u in team.users.all %}{{ u.contractor_specializations.all }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {% for u in team.users.all %}{{ u.location }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {% for u in team.users.all %}{{ u.cro }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.work_type }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--></pre> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
|
||||
<div class="gallMini disTab"> |
||||
{% for portf in team.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% elif obj|class_name == 'User' %} |
||||
{% with contractor=obj %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if contractor.avatar %} |
||||
{% thumbnail contractor.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if contractor.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}">{{ contractor.get_full_name }} [{{ contractor.username }}]</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ contractor.created|date:"d M Y"}}</p> |
||||
|
||||
{% if contractor.contractor_status == 'free' %} |
||||
<div class="statusUser">Свободен</div> |
||||
{% else %} |
||||
<div class="statusUser busy">Занят</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
|
||||
{% if request.user.is_customer %} |
||||
<li> |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ contractor.pk }}" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
</li> |
||||
{% endif %} |
||||
|
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ contractor.pk }}#user{{ contractor.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_widget user_id=contractor.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_widget contractor.pk 'restList2' %} |
||||
|
||||
{% if contractor.cro %} |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
{% if TEMPLATE_DEBUG %} |
||||
<div class="col-lg-12"> |
||||
<pre><!-- |
||||
--><b>Specializations:</b> {{ contractor.contractor_specializations.all }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {{ contractor.location }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for o in contractor.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for o in contractor.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {{ contractor.cro }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for o in contractor.orders.all %}{{ o.project.work_type }}, {% endfor %}<br><!-- |
||||
--></pre> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="gallMini disTab"> |
||||
{% for portf in contractor.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% endif %} |
||||
{% endfor %} |
||||
|
||||
|
||||
<div class="col-lg-12 pagin"> |
||||
{% include 'partials/pagination.html' %} |
||||
</div> |
||||
|
||||
|
||||
{% include 'partials/footer.html' %} |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block js_block %} |
||||
<script> |
||||
{% if request.user.is_customer %} |
||||
var customerId = {{ request.user.pk }} |
||||
var $projectSelectionModal = $('#projectSelectionModal') |
||||
var projectUrl_ = '/projects/%id%/' |
||||
var projectOrderChatUrl_ = '/chat/#order%orderId%' |
||||
|
||||
|
||||
$projectSelectionModal.on('shown.bs.modal', function($evt) { |
||||
var $that = $(this) |
||||
|
||||
var $modalOpenButton = $($evt.relatedTarget) |
||||
var $projectSelect = $that.find('.-project-select').first() |
||||
|
||||
$that.data('modalOpenButton', $modalOpenButton) |
||||
|
||||
initProjectSelect($projectSelect, customerId) |
||||
}) |
||||
|
||||
|
||||
$projectSelectionModal.find('.-action-button').first().on('click', function($evt) { |
||||
var $projectSelect = $projectSelectionModal.find('.-project-select').first() |
||||
var $modalOpenButton = $projectSelectionModal.data('modalOpenButton') |
||||
var isTeamOffer = $modalOpenButton.data('isTeamOffer') |
||||
var project = $projectSelect.select2('data').origItem |
||||
var projectUrl = _.replace('%id%', project.id, projectUrl_) |
||||
var projectOrderChatUrl = _.replace('%orderId%', project.order.id, projectOrderChatUrl_) |
||||
|
||||
$projectSelectionModal.modal('hide') |
||||
|
||||
if (isTeamOffer) { |
||||
var contractorId = $modalOpenButton.data('contractorId') |
||||
var teamId = $modalOpenButton.data('teamId') |
||||
|
||||
if (project.order.team && project.order.team.id === teamId) { |
||||
window.location.href = projectOrderChatUrl |
||||
} else { |
||||
var msg = 'Вашей команде предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl + '">Перейти к проекту</a>' |
||||
|
||||
socketMain.add_message({ |
||||
format_type: 'add_message_contact', |
||||
message_type: 'invite_order', |
||||
data: { |
||||
sender_id: String(customerId), |
||||
recipent_id: String(contractorId), |
||||
chat_message: msg, |
||||
}, |
||||
}) |
||||
} |
||||
|
||||
$.jGrowl('Предложение успешно отправлено') |
||||
$modalOpenButton.fadeOut() |
||||
} else { |
||||
var contractorId = $modalOpenButton.data('contractorId') |
||||
|
||||
if (project.order.contractor && project.order.contractor.id === contractorId) { |
||||
window.location.href = projectOrderChatUrl |
||||
} else { |
||||
var msg = 'Вам предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl + '">Перейти к проекту</a>' |
||||
|
||||
socketMain.add_message({ |
||||
format_type: 'add_message_contact', |
||||
message_type: 'invite_order', |
||||
data: { |
||||
sender_id: String(customerId), |
||||
recipent_id: String(contractorId), |
||||
chat_message: msg, |
||||
}, |
||||
}) |
||||
} |
||||
|
||||
$.jGrowl('Предложение успешно отправлено') |
||||
$modalOpenButton.fadeOut() |
||||
} |
||||
}) |
||||
|
||||
|
||||
$projectSelectionModal.on('hidden.bs.modal', function($evt) { |
||||
$(this).find('.-project-select').first().select2('destroy') |
||||
}) |
||||
{% endif %} |
||||
</script> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block personal_js %} |
||||
<script src='{% static "js/build/init_contractor_filter.js" %}'></script> |
||||
<script src='{% static "js/build/contractor_filter.js" %}'></script> |
||||
{% endblock %} |
||||
@ -0,0 +1,154 @@ |
||||
<form id="filter-form" action="{% url 'users:contractor-filter' %}" method="POST" novalidate |
||||
xmlns="http://www.w3.org/1999/html"> |
||||
<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="border"></div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-3"> |
||||
{# $(this).closest('form').submit(); return false#} |
||||
<a href="" class="findReal" |
||||
onclick="sendFilterData($('#filter-form'), $('#contractorsBlock')); return false"> |
||||
найти исполнителя |
||||
</a> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<a href="{% url 'users:contractor-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 mod-row-eq-height"> |
||||
<div class="col-lg-6" style="border-left: 1px solid #CFCFCF; border-right: 1px solid #CFCFCF;"> |
||||
<div class="row"> |
||||
<div class="col-lg-12" style="font-size: 10.5pt"> |
||||
Опыт работы исполнителей по классификации зданий и виду строительства |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-6"> |
||||
<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-6"> |
||||
<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> |
||||
|
||||
</div> |
||||
<div class="col-lg-6"> |
||||
<div class="row"> |
||||
<div class="col-lg-12" style="font-size: 10.5pt"> |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-lg-6"> |
||||
<div class="select-box-header vertical-child"> |
||||
<span style="width: 210px" 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="cro" type="checkbox" hidden {% if cro %} checked{% endif %}> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-6"> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row"> |
||||
<div class="col-lg-12" style="margin-left: 20px; padding-top: 20px"> |
||||
<div class="btn-group btn-round toggle" role="group" aria-label="..."> |
||||
<a class="btn btn-default active" role="button" data-type="all">Все</a> |
||||
<a class="btn btn-default" role="button" data-type="teams">Группы</a> |
||||
<input type="hidden" name="party_types" value="all"> |
||||
<a class="btn btn-default" role="button" data-type="contractors">Исполнители</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p class="titleScore search-num"> |
||||
{{ display_msg }} |
||||
</p> |
||||
<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,196 @@ |
||||
{% load common_tags %} |
||||
{% load specializtions_tags %} |
||||
{% load thumbnail %} |
||||
{% load i18n %} |
||||
|
||||
<input id="titleScore" type="hidden" value="{{ display_msg }}"> |
||||
|
||||
{% for object in objects %} |
||||
{% if object|class_name == 'Team' %} |
||||
{% with team=object %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if team.owner.avatar %} |
||||
{% thumbnail team.owner.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if team.owner.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}">{{ team.name }}</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ team.created|date:"d M Y" }}</p> |
||||
<div class="statusUser">Свободен</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
<li> |
||||
{% if request.user.is_customer %} |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ team.owner.pk }}" |
||||
data-team-id="{{ team.pk }}" |
||||
data-is-team-offer="true" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
{% endif %} |
||||
</li> |
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ team.owner.pk }}#user{{ team.owner.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_team_widget team_id=team.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_team_widget team.pk 'restList2' %} |
||||
|
||||
<!-- TODO --> |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
</div> |
||||
<div class="gallMini disTab"> |
||||
{% for portf in team.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" |
||||
style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% elif object|class_name == 'User' %} |
||||
{% with contractor=object %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if contractor.avatar %} |
||||
{% thumbnail contractor.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if contractor.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}">{{ contractor.get_full_name }} |
||||
[{{ contractor.username }}]</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ contractor.created|date:"d M Y" }}</p> |
||||
|
||||
{% if contractor.contractor_status == 'free' %} |
||||
<div class="statusUser">Свободен</div> |
||||
{% else %} |
||||
<div class="statusUser busy">Занят</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
|
||||
{% if request.user.is_customer %} |
||||
<li> |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ contractor.pk }}" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
</li> |
||||
{% endif %} |
||||
|
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ contractor.pk }}#user{{ contractor.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_widget user_id=contractor.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_widget contractor.pk 'restList2' %} |
||||
|
||||
{% if contractor.cro %} |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="gallMini disTab"> |
||||
{% for portf in contractor.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" |
||||
style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% endif %} |
||||
{% endfor %} |
||||
<div class="row"> |
||||
<div class="col-lg-12 pagin"> |
||||
{% include 'partials/ajax_pagination.html' %} |
||||
</div> |
||||
</div> |
||||
@ -0,0 +1,521 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% load common_tags %} |
||||
{% load specializtions_tags %} |
||||
{% load thumbnail %} |
||||
{% load i18n %} |
||||
|
||||
{% block content %} |
||||
{% include 'partials/modals/project_selection.html' %} |
||||
{% include 'partials/header.html' %} |
||||
|
||||
|
||||
<div class="container mainScore"> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<p class="titleScore">{% if display_msg %}{{ display_msg }}{% else %}Поиск исполнителей{% endif %}</p> |
||||
</div> |
||||
|
||||
|
||||
<form action="{% url 'users:contractor-filter' %}" method="GET" novalidate> |
||||
<div class="col-lg-12"> |
||||
<div class="filter clearfix -spec-work-type-combo-container"> |
||||
<div class="triangle1"></div> |
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-3">{% trans 'project_stage0' %}</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
{{ form.work_type }} |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage1' %} <span style="color: red">{{ form.specialization.errors.as_text }}</span></div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-1" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold"><span class="-dynamic-label">{% trans 'project_stage2' %}</span></div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-2" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage3' %}</div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-3" style="width: 100%"> |
||||
</div> |
||||
<div class="col-lg-3 -single-spec-select"> |
||||
<div class="-bold">{% trans 'project_stage4' %}</div> |
||||
<input type="hidden" class="-spec-select -spec-select-level-4" style="width: 100%"> |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.specialization.html_name }}" value="{{ form.specialization.value }}" class="-chosen-spec-id"> |
||||
</div> |
||||
|
||||
|
||||
<div class="searchF1 polsF1 polsFF polsF3 resSearchF1"> |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="findReal" onclick="$(this).closest('form').submit(); return false"> |
||||
найти исполнителя |
||||
</a> |
||||
</div> |
||||
<div class="col-lg-3"> |
||||
<a href="{% url 'users:contractor-filter' %}" class="clearSearch"> |
||||
Очистить фильтр |
||||
</a> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="resSearchF1"> |
||||
<div class="col-lg-3"> |
||||
<p class="titleResF1">Расширенный поиск</p> |
||||
<button class="resButtonF1"> |
||||
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span> |
||||
</button> |
||||
</div> |
||||
<div class="col-lg-9"> |
||||
<div class="borderS1"></div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="slideRes disTab activeSlide"> |
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-12">Местоположение</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-country" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-region" style="width: 100%"> |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<input type="hidden" class="-location-select -location-select-city" style="width: 100%"> |
||||
</div> |
||||
|
||||
<input type="hidden" id="chosenLocationId" name="{{ form.location.html_name }}" value="{{ form.location.value }}"> |
||||
</div> |
||||
|
||||
|
||||
<div class="titleF1 disTab"> |
||||
<div class="col-lg-3">Классификация здания</div> |
||||
<div class="col-lg-3">Вид строительства</div> |
||||
</div> |
||||
|
||||
<div class="polsF1 disTab"> |
||||
<div class="col-lg-3"> |
||||
{{ form.building_classification }} |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
{{ form.construction_type }} |
||||
</div> |
||||
|
||||
<div class="col-lg-3"> |
||||
<label>{{ form.cro }}<span></span></label> |
||||
<p>Требуется допуск (СРО)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
<div class="buttonGP disTab"> |
||||
<div class="btn-group valProject valProject2" role="group" aria-label="..."> |
||||
{% for val, text in form.party_types.field.choices %} |
||||
<button |
||||
type="submit" |
||||
name="{{ form.party_types.html_name }}" |
||||
value="{{ val }}" |
||||
class="{% if val == last_party_types or not last_party_types and val == 'all' %}active{% endif %} btn btn-default"> |
||||
{{ text }} |
||||
</button> |
||||
{% endfor %} |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.last_party_types.html_name }}" value="{{ last_party_types }}"> |
||||
|
||||
<div class="polsF1 disTab polsSearch"> |
||||
<div class="col-lg-3"> |
||||
<select name="{{ form.order_by.html_name }}" onchange="$(this).closest('form').submit()" class="selectpicker"> |
||||
{% for val, text in form.order_by.field.choices %} |
||||
<option value="{{ val }}">{{ text }}</option> |
||||
{% endfor %} |
||||
</select> |
||||
</div> |
||||
|
||||
<input type="hidden" name="{{ form.last_order_by.html_name }}" value="{{ last_order_by }}"> |
||||
<input type="checkbox" name="{{ form.reverse_order.html_name }}" {% if reverse_order %}checked{% endif %} style="display: none"> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
|
||||
|
||||
{% for obj in coll %} |
||||
{% if obj|class_name == 'Team' %} |
||||
{% with team=obj %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if team.owner.avatar %} |
||||
{% thumbnail team.owner.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if team.owner.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}">{{ team.name }}</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ team.created|date:"d M Y"}}</p> |
||||
<div class="statusUser">Свободен</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:team-profile' pk=team.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
<li> |
||||
{% if request.user.is_customer %} |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ team.owner.pk }}" |
||||
data-team-id="{{ team.pk }}" |
||||
data-is-team-offer="true" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
{% endif %} |
||||
</li> |
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ team.owner.pk }}#user{{ team.owner.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_team_widget team_id=team.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_team_widget team.pk 'restList2' %} |
||||
|
||||
<!-- TODO --> |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
{% if TEMPLATE_DEBUG %} |
||||
<div class="col-lg-12" style="margin-bottom: 20px"> |
||||
<pre><!-- |
||||
--><b>######## Team owner #########</b><br><!-- |
||||
--><br><!-- |
||||
--><b>Specializations:</b> {{ team.owner.contractor_specializations.all }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {{ team.owner.location }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for o in team.owner.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for o in team.owner.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {{ team.owner.cro }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for o in team.owner.orders.all %}{{ o.project.work_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><br><!-- |
||||
--><br><!-- |
||||
--><b>######## Team users #########</b><br><!-- |
||||
--><br><!-- |
||||
--><b>Specializations:</b> {% for u in team.users.all %}{{ u.contractor_specializations.all }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {% for u in team.users.all %}{{ u.location }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {% for u in team.users.all %}{{ u.cro }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for u in team.users.all %}{% for o in u.orders.all %}{{ o.project.work_type }}, {% endfor %}; {% endfor %}<br><!-- |
||||
--></pre> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
|
||||
<div class="gallMini disTab"> |
||||
{% for portf in team.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% elif obj|class_name == 'User' %} |
||||
{% with contractor=obj %} |
||||
<div class="executorBlock clearfix"> |
||||
<div class="col-lg-4"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}" class="aLinkExe"> |
||||
<div class="imgExecutor"> |
||||
{% if contractor.avatar %} |
||||
{% thumbnail contractor.avatar "126x125" crop="center" as avatar %} |
||||
<img src="{{ avatar.url }}" alt="profile-image"> |
||||
{% endthumbnail %} |
||||
{% else %} |
||||
{% if contractor.gender == "female" %} |
||||
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image"> |
||||
{% else %} |
||||
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image"> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
</a> |
||||
<p class="nameExecutor"> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}">{{ contractor.get_full_name }} [{{ contractor.username }}]</a> |
||||
</p> |
||||
<p class="navv2">На сайте c {{ contractor.created|date:"d M Y"}}</p> |
||||
|
||||
{% if contractor.contractor_status == 'free' %} |
||||
<div class="statusUser">Свободен</div> |
||||
{% else %} |
||||
<div class="statusUser busy">Занят</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-2"> |
||||
<ul class="listExecutor"> |
||||
<li> |
||||
<a href="{% url 'users:contractor-profile' pk=contractor.pk %}"> |
||||
смотреть профиль |
||||
</a> |
||||
</li> |
||||
|
||||
{% if request.user.is_customer %} |
||||
<li> |
||||
<a |
||||
href="#" |
||||
onclick="return false" |
||||
data-contractor-id="{{ contractor.pk }}" |
||||
data-toggle="modal" |
||||
data-target="#projectSelectionModal"> |
||||
предложить проект |
||||
</a> |
||||
</li> |
||||
{% endif %} |
||||
|
||||
<li> |
||||
<a href="{% url 'chat:chat-user' %}?user_id={{ contractor.pk }}#user{{ contractor.pk }}"> |
||||
написать сообщение |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3"> |
||||
{% specialization_widget user_id=contractor.pk %} |
||||
</div> |
||||
|
||||
|
||||
<div class="col-lg-3 retts"> |
||||
{% ratings_widget contractor.pk 'restList2' %} |
||||
|
||||
{% if contractor.cro %} |
||||
<div class="sroUser sroExecutor"> |
||||
<div class="iconSRO"></div> |
||||
<p>Есть допуск СРО</p> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
{% if TEMPLATE_DEBUG %} |
||||
<div class="col-lg-12"> |
||||
<pre><!-- |
||||
--><b>Specializations:</b> {{ contractor.contractor_specializations.all }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Location:</b> {{ contractor.location }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Build. classif-s:</b> {% for o in contractor.orders.all %}{{ o.project.realty.building_classification }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>Constr. types:</b> {% for o in contractor.orders.all %}{{ o.project.realty.construction_type }}, {% endfor %}<br><!-- |
||||
--><br><!-- |
||||
--><b>CRO:</b> {{ contractor.cro }}<br><!-- |
||||
--><br><!-- |
||||
--><b>Work types:</b> {% for o in contractor.orders.all %}{{ o.project.work_type }}, {% endfor %}<br><!-- |
||||
--></pre> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="gallMini disTab"> |
||||
{% for portf in contractor.portfolios.all|slice:':4' %} |
||||
<div class="col-lg-3"> |
||||
<a href="#" class="linkInsetCol"> |
||||
<div class="insetCol box-sizing disTab"> |
||||
<div class="imgGal" style="background-image: url('{{ portf.photos.first.img.url }}')"> |
||||
<div class="imgFigure"></div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% endif %} |
||||
{% endfor %} |
||||
|
||||
|
||||
<div class="col-lg-12 pagin"> |
||||
{% include 'partials/pagination.html' %} |
||||
</div> |
||||
|
||||
|
||||
{% include 'partials/footer.html' %} |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block js_block %} |
||||
<script> |
||||
{% if request.user.is_customer %} |
||||
var customerId = {{ request.user.pk }} |
||||
var $projectSelectionModal = $('#projectSelectionModal') |
||||
var projectUrl_ = '/projects/%id%/' |
||||
var projectOrderChatUrl_ = '/chat/#order%orderId%' |
||||
|
||||
|
||||
$projectSelectionModal.on('shown.bs.modal', function($evt) { |
||||
var $that = $(this) |
||||
|
||||
var $modalOpenButton = $($evt.relatedTarget) |
||||
var $projectSelect = $that.find('.-project-select').first() |
||||
|
||||
$that.data('modalOpenButton', $modalOpenButton) |
||||
|
||||
initProjectSelect($projectSelect, customerId) |
||||
}) |
||||
|
||||
|
||||
$projectSelectionModal.find('.-action-button').first().on('click', function($evt) { |
||||
var $projectSelect = $projectSelectionModal.find('.-project-select').first() |
||||
var $modalOpenButton = $projectSelectionModal.data('modalOpenButton') |
||||
var isTeamOffer = $modalOpenButton.data('isTeamOffer') |
||||
var project = $projectSelect.select2('data').origItem |
||||
var projectUrl = _.replace('%id%', project.id, projectUrl_) |
||||
var projectOrderChatUrl = _.replace('%orderId%', project.order.id, projectOrderChatUrl_) |
||||
|
||||
$projectSelectionModal.modal('hide') |
||||
|
||||
if (isTeamOffer) { |
||||
var contractorId = $modalOpenButton.data('contractorId') |
||||
var teamId = $modalOpenButton.data('teamId') |
||||
|
||||
if (project.order.team && project.order.team.id === teamId) { |
||||
window.location.href = projectOrderChatUrl |
||||
} else { |
||||
var msg = 'Вашей команде предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl + '">Перейти к проекту</a>' |
||||
|
||||
socketMain.add_message({ |
||||
format_type: 'add_message_contact', |
||||
message_type: 'invite_order', |
||||
data: { |
||||
sender_id: String(customerId), |
||||
recipent_id: String(contractorId), |
||||
chat_message: msg, |
||||
}, |
||||
}) |
||||
} |
||||
|
||||
$.jGrowl('Предложение успешно отправлено') |
||||
$modalOpenButton.fadeOut() |
||||
} else { |
||||
var contractorId = $modalOpenButton.data('contractorId') |
||||
|
||||
if (project.order.contractor && project.order.contractor.id === contractorId) { |
||||
window.location.href = projectOrderChatUrl |
||||
} else { |
||||
var msg = 'Вам предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl + '">Перейти к проекту</a>' |
||||
|
||||
socketMain.add_message({ |
||||
format_type: 'add_message_contact', |
||||
message_type: 'invite_order', |
||||
data: { |
||||
sender_id: String(customerId), |
||||
recipent_id: String(contractorId), |
||||
chat_message: msg, |
||||
}, |
||||
}) |
||||
} |
||||
|
||||
$.jGrowl('Предложение успешно отправлено') |
||||
$modalOpenButton.fadeOut() |
||||
} |
||||
}) |
||||
|
||||
|
||||
$projectSelectionModal.on('hidden.bs.modal', function($evt) { |
||||
$(this).find('.-project-select').first().select2('destroy') |
||||
}) |
||||
{% endif %} |
||||
</script> |
||||
{% endblock %} |
||||
Loading…
Reference in new issue