diff --git a/README.md b/README.md
index ca57e28..6575a86 100644
--- a/README.md
+++ b/README.md
@@ -101,3 +101,8 @@ python manage.py generate_reviews
```
----------------------------------------
+
+## Local smtp debug server
+```
+sudo python3 -m smtpd -n -c DebuggingServer localhost:25
+```
\ No newline at end of file
diff --git a/api/views.py b/api/views.py
index 0a6c00f..bb9ab28 100755
--- a/api/views.py
+++ b/api/views.py
@@ -169,9 +169,11 @@ class RealtyViewSet(ModelViewSet):
@list_route(methods=['get'])
def current_user(self, request, *args, **kwargs):
- queryset = self.queryset.filter(user=self.request.user)
- serialiser = self.serializer_class(queryset, many=True)
- return Response(serialiser.data)
+ if self.request.user.__dict__:
+ queryset = self.queryset.filter(user=self.request.user)
+ serialiser = self.serializer_class(queryset, many=True)
+ return Response(serialiser.data)
+ return Response([])
class BuildingClassificationViewSet(ModelViewSet):
diff --git a/archilance/local.py b/archilance/local.py
deleted file mode 100644
index b26e8e8..0000000
--- a/archilance/local.py
+++ /dev/null
@@ -1,12 +0,0 @@
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'proekton2',
- 'USER': 'postgres',
- 'PASSWORD': 'gum1756',
- 'HOST': 'localhost',
- 'PORT': '',
- }
-}
-
-TEMPLATE_DEBUG = True
diff --git a/archilance/settings/base.py b/archilance/settings/base.py
index 6b27c14..c00f3be 100644
--- a/archilance/settings/base.py
+++ b/archilance/settings/base.py
@@ -339,6 +339,7 @@ SITE_ID = 1
# else:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
+# sudo python3 -m smtpd -n -c DebuggingServer localhost:25
EMAIL_HOST = 'localhost'
EMAIL_HOST_PASSWORD = ''
EMAIL_HOST_USER = ''
@@ -377,4 +378,5 @@ DEFAULT_FILE_STORAGE = 'archilance.util.ASCIIFileSystemStorage'
RECAPTCHA_PUBLIC_KEY = '6LftaQgUAAAAAG0oKrt1ORtop1jfIEzkTnCL4S3Q'
RECAPTCHA_PRIVATE_KEY = '6LftaQgUAAAAAMaIK-YCL1u1AfakVXjblULQCvfa'
+# CAPTCHA_AJAX = True
NOCAPTCHA = True
\ No newline at end of file
diff --git a/archilance/views.py b/archilance/views.py
index 2dab7fb..d80b2c8 100644
--- a/archilance/views.py
+++ b/archilance/views.py
@@ -1,17 +1,16 @@
-import pydash as _;
from django.core.files.base import ContentFile
from django.shortcuts import render
from django.views.generic import View
-_.map = _.map_;
-_.filter = _.filter_
-
from .mixins import BaseMixin
from chat.models import Documents
from common.models import MainPage
from users.models import User
from work_sell.models import Picture
+import pydash as _;
+_.map = _.map_;
+_.filter = _.filter_
class HomeTemplateView(BaseMixin, View):
diff --git a/assets/fonts/MyriadPro/MyriadPro-Bold.otf b/assets/fonts/MyriadPro/MyriadPro-Bold.otf
new file mode 100644
index 0000000..e80b807
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-Bold.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-BoldCond.otf b/assets/fonts/MyriadPro/MyriadPro-BoldCond.otf
new file mode 100644
index 0000000..c6864bd
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-BoldCond.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-BoldCondIt.otf b/assets/fonts/MyriadPro/MyriadPro-BoldCondIt.otf
new file mode 100644
index 0000000..2179333
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-BoldCondIt.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-BoldIt.otf b/assets/fonts/MyriadPro/MyriadPro-BoldIt.otf
new file mode 100644
index 0000000..9c37583
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-BoldIt.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-Cond.otf b/assets/fonts/MyriadPro/MyriadPro-Cond.otf
new file mode 100644
index 0000000..fe187b8
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-Cond.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-CondIt.otf b/assets/fonts/MyriadPro/MyriadPro-CondIt.otf
new file mode 100644
index 0000000..bbf4de8
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-CondIt.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-It.otf b/assets/fonts/MyriadPro/MyriadPro-It.otf
new file mode 100644
index 0000000..0b74757
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-It.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-Regular.otf b/assets/fonts/MyriadPro/MyriadPro-Regular.otf
new file mode 100644
index 0000000..f686221
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-Regular.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-Semibold.otf b/assets/fonts/MyriadPro/MyriadPro-Semibold.otf
new file mode 100644
index 0000000..1b33d74
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-Semibold.otf differ
diff --git a/assets/fonts/MyriadPro/MyriadPro-SemiboldIt.otf b/assets/fonts/MyriadPro/MyriadPro-SemiboldIt.otf
new file mode 100644
index 0000000..e92ba39
Binary files /dev/null and b/assets/fonts/MyriadPro/MyriadPro-SemiboldIt.otf differ
diff --git a/assets/images/Thumbs.db b/assets/images/Thumbs.db
deleted file mode 100644
index b7d1473..0000000
Binary files a/assets/images/Thumbs.db and /dev/null differ
diff --git a/assets/img/main.jpg b/assets/img/main.jpg
new file mode 100644
index 0000000..8cdd632
Binary files /dev/null and b/assets/img/main.jpg differ
diff --git a/assets/img/main.png b/assets/img/main.png
new file mode 100644
index 0000000..956d20d
Binary files /dev/null and b/assets/img/main.png differ
diff --git a/assets/images/main.jpg b/assets/img/old_main.jpg
similarity index 100%
rename from assets/images/main.jpg
rename to assets/img/old_main.jpg
diff --git a/assets/img/sprite.png b/assets/img/sprite.png
new file mode 100644
index 0000000..be0fcf3
Binary files /dev/null and b/assets/img/sprite.png differ
diff --git a/assets/img/youtube.png b/assets/img/youtube.png
index 8d96412..e2de634 100644
Binary files a/assets/img/youtube.png and b/assets/img/youtube.png differ
diff --git a/assets/js/build/create_project.js b/assets/js/build/create_project.js
index 32a9589..dec3dd1 100644
--- a/assets/js/build/create_project.js
+++ b/assets/js/build/create_project.js
@@ -60,7 +60,9 @@
var _scroll_on_required = __webpack_require__(8);
- var _test_seeds = __webpack_require__(9);
+ var _ajax_registration = __webpack_require__(9);
+
+ var _test_seeds = __webpack_require__(10);
function showHideRealry() {
var check = $('#checkbox-sb-realty');
@@ -83,6 +85,7 @@
(0, _only_one_checkbox.onlyOneCheckboxInit)('#safe', '#by_agreement');
(0, _scroll_on_required.scrollOnRequiredInit)();
(0, _popups.showPopupsInit)();
+ (0, _ajax_registration.ajaxRegistrationInit)('customer');
window.addMessage = _popups.addMessage;
});
@@ -369,6 +372,104 @@
/***/ },
/* 9 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ var $form = $('#form-registration');
+
+ function clearErrors() {
+ var $error_tags = $form.find('.errorlist');
+ if ($error_tags.length > 0) $error_tags.remove();
+ }
+
+ function sendData(form_data) {
+ // console.log("form_data = ", form_data);
+ $.ajax({
+ url: '/users/register/',
+ type: 'post',
+ data: form_data,
+ success: function success(data) {
+ // console.log("success data -->", data);
+ $('#registrationFormModal').modal('toggle');
+ $('input[name=not_auth_user_id]').val(data.pk);
+ $('#not_customer').hide();
+ $('#is_customer').show();
+ },
+ error: function error(xhr, ajaxOptions, thrownError) {
+ var status = xhr.status;
+ if (status == 400) {
+ var data = JSON.parse(xhr.responseText);
+ $.each(data, function (key, value) {
+ var ul = $("
");
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = undefined;
+
+ try {
+ for (var _iterator = value[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var error = _step.value;
+
+ ul.append('' + error + ' ');
+ }
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
+ }
+ }
+
+ var $field = void 0;
+ if (key == 'captcha_html') {
+ // console.log("captcha html = ", key, '/', value);
+ $form.find('.captcha').html(value);
+ return;
+ } else if (key == 'captcha') {
+ $field = $form.find('.g-recaptcha');
+ } else if (key == 'tos') {
+ $field = $form.find('input[name=' + key + ']').parent();
+ } else {
+ $field = $form.find('input[name=' + key + ']');
+ if ($field.length == 0) console.log('!!!field ' + key + ' not found');
+ }
+ if ($field.length > 0) $field.parent().append(ul);
+ });
+ // console.log('captcha error = ', data.captcha);
+ // console.log('data type = ', typeof data);
+ }
+ // console.log("data = ", xhr.responseText);
+ // console.log(ajaxOptions);
+ // console.log(thrownError);
+ }
+ });
+ }
+
+ function ajaxRegistrationInit(user_type) {
+ // const $form = $('#form-registration');
+ $form.on("submit", function (e) {
+ e.preventDefault();
+ // get form data and add user_type
+ clearErrors();
+ var form_data = $form.serialize() + "&user_type=" + encodeURIComponent(user_type);
+ sendData(form_data);
+ });
+ }
+
+ exports.ajaxRegistrationInit = ajaxRegistrationInit;
+
+/***/ },
+/* 10 */
/***/ function(module, exports) {
"use strict";
diff --git a/assets/js/build/create_worksell.js b/assets/js/build/create_worksell.js
index 49f7100..b66a6ff 100644
--- a/assets/js/build/create_worksell.js
+++ b/assets/js/build/create_worksell.js
@@ -48,18 +48,21 @@
var _file_upload = __webpack_require__(1);
- var _image_upload = __webpack_require__(10);
+ var _image_upload = __webpack_require__(11);
var _scroll_on_required = __webpack_require__(8);
var _popups = __webpack_require__(7);
+ var _ajax_registration = __webpack_require__(9);
+
$(function () {
// fileUploadInit();
// previewImg();
(0, _image_upload.imageUploadInit)();
(0, _scroll_on_required.scrollOnRequiredInit)();
(0, _popups.showPopupsInit)();
+ (0, _ajax_registration.ajaxRegistrationInit)('contractor');
window.addMessage = _popups.addMessage;
});
@@ -233,8 +236,106 @@
exports.scrollOnRequiredInit = scrollOnRequiredInit;
/***/ },
-/* 9 */,
-/* 10 */
+/* 9 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ var $form = $('#form-registration');
+
+ function clearErrors() {
+ var $error_tags = $form.find('.errorlist');
+ if ($error_tags.length > 0) $error_tags.remove();
+ }
+
+ function sendData(form_data) {
+ // console.log("form_data = ", form_data);
+ $.ajax({
+ url: '/users/register/',
+ type: 'post',
+ data: form_data,
+ success: function success(data) {
+ // console.log("success data -->", data);
+ $('#registrationFormModal').modal('toggle');
+ $('input[name=not_auth_user_id]').val(data.pk);
+ $('#not_customer').hide();
+ $('#is_customer').show();
+ },
+ error: function error(xhr, ajaxOptions, thrownError) {
+ var status = xhr.status;
+ if (status == 400) {
+ var data = JSON.parse(xhr.responseText);
+ $.each(data, function (key, value) {
+ var ul = $("");
+ var _iteratorNormalCompletion = true;
+ var _didIteratorError = false;
+ var _iteratorError = undefined;
+
+ try {
+ for (var _iterator = value[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+ var error = _step.value;
+
+ ul.append('' + error + ' ');
+ }
+ } catch (err) {
+ _didIteratorError = true;
+ _iteratorError = err;
+ } finally {
+ try {
+ if (!_iteratorNormalCompletion && _iterator.return) {
+ _iterator.return();
+ }
+ } finally {
+ if (_didIteratorError) {
+ throw _iteratorError;
+ }
+ }
+ }
+
+ var $field = void 0;
+ if (key == 'captcha_html') {
+ // console.log("captcha html = ", key, '/', value);
+ $form.find('.captcha').html(value);
+ return;
+ } else if (key == 'captcha') {
+ $field = $form.find('.g-recaptcha');
+ } else if (key == 'tos') {
+ $field = $form.find('input[name=' + key + ']').parent();
+ } else {
+ $field = $form.find('input[name=' + key + ']');
+ if ($field.length == 0) console.log('!!!field ' + key + ' not found');
+ }
+ if ($field.length > 0) $field.parent().append(ul);
+ });
+ // console.log('captcha error = ', data.captcha);
+ // console.log('data type = ', typeof data);
+ }
+ // console.log("data = ", xhr.responseText);
+ // console.log(ajaxOptions);
+ // console.log(thrownError);
+ }
+ });
+ }
+
+ function ajaxRegistrationInit(user_type) {
+ // const $form = $('#form-registration');
+ $form.on("submit", function (e) {
+ e.preventDefault();
+ // get form data and add user_type
+ clearErrors();
+ var form_data = $form.serialize() + "&user_type=" + encodeURIComponent(user_type);
+ sendData(form_data);
+ });
+ }
+
+ exports.ajaxRegistrationInit = ajaxRegistrationInit;
+
+/***/ },
+/* 10 */,
+/* 11 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -293,12 +394,9 @@
$fileUploadWidget.css('display', 'block');
if ($fileImg.length) {
- console.log('+');
var reader = new FileReader();
reader.onload = function (e) {
- // document.getElementById('clock').style.backgroundImage = "url(" + reader.result + ")";
$fileImg.css('background-image', 'url(' + e.target.result + ')');
- // $fileImg.attr('src', e.target.result);
};
reader.readAsDataURL($fileInput[0].files[0]);
diff --git a/assets/js/build/home_page.js b/assets/js/build/home_page.js
new file mode 100644
index 0000000..c3b82b6
--- /dev/null
+++ b/assets/js/build/home_page.js
@@ -0,0 +1,81 @@
+/******/ (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 _popupYoutube = __webpack_require__(12);
+
+ $(function () {
+ (0, _popupYoutube.popupYoutubeInit)();
+ });
+
+/***/ },
+
+/***/ 12:
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ function popupYoutubeInit() {
+ $('.popup-youtube').magnificPopup({
+ disableOn: 700,
+ type: 'iframe',
+ mainClass: 'mfp-fade',
+ removalDelay: 160,
+ preloader: false,
+ fixedContentPos: false
+ });
+ }
+
+ exports.popupYoutubeInit = popupYoutubeInit;
+
+/***/ }
+
+/******/ });
\ No newline at end of file
diff --git a/assets/js/build/init_create_worksell.js b/assets/js/build/init_create_worksell.js
index 6f48517..6dd5766 100644
--- a/assets/js/build/init_create_worksell.js
+++ b/assets/js/build/init_create_worksell.js
@@ -46,27 +46,27 @@
'use strict';
- var _SelectedContainer = __webpack_require__(11);
+ var _SelectedContainer = __webpack_require__(13);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(15);
+ var _SelectedContainerCreate = __webpack_require__(17);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(16);
+ var _NoTreeSelect = __webpack_require__(18);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(18);
+ var _TreeSelect = __webpack_require__(20);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SingleTreeSelect = __webpack_require__(19);
+ var _SingleTreeSelect = __webpack_require__(21);
var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect);
- var _SelectOrCreate = __webpack_require__(20);
+ var _SelectOrCreate = __webpack_require__(22);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -177,7 +177,9 @@
/* 8 */,
/* 9 */,
/* 10 */,
-/* 11 */
+/* 11 */,
+/* 12 */,
+/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -192,15 +194,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(12);
+ var _DataTree = __webpack_require__(14);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(14);
+ var _decorators = __webpack_require__(16);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -431,7 +433,7 @@
exports.default = SelectedContainer;
/***/ },
-/* 12 */
+/* 14 */
/***/ function(module, exports) {
"use strict";
@@ -586,7 +588,7 @@
exports.default = DataTree;
/***/ },
-/* 13 */
+/* 15 */
/***/ function(module, exports) {
"use strict";
@@ -642,7 +644,7 @@
exports.default = NoTreeData;
/***/ },
-/* 14 */
+/* 16 */
/***/ function(module, exports) {
"use strict";
@@ -726,7 +728,7 @@
// export {onBind};
/***/ },
-/* 15 */
+/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -742,11 +744,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(11);
+ var _SelectedContainer2 = __webpack_require__(13);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(14);
+ var _decorators = __webpack_require__(16);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -827,7 +829,7 @@
exports.default = SelectedContainerCreate;
/***/ },
-/* 16 */
+/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -841,9 +843,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -910,7 +912,7 @@
exports.default = NoTreeSelect;
/***/ },
-/* 17 */
+/* 19 */
/***/ function(module, exports) {
"use strict";
@@ -1454,7 +1456,7 @@
exports.AbsBaseSelect = AbsBaseSelect;
/***/ },
-/* 18 */
+/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1468,9 +1470,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _DataTree = __webpack_require__(12);
+ var _DataTree = __webpack_require__(14);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1579,7 +1581,7 @@
exports.default = TreeSelect;
/***/ },
-/* 19 */
+/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1591,9 +1593,9 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _AbsBaseSelect = __webpack_require__(17);
+ var _AbsBaseSelect = __webpack_require__(19);
- var _TreeSelect2 = __webpack_require__(18);
+ var _TreeSelect2 = __webpack_require__(20);
var _TreeSelect3 = _interopRequireDefault(_TreeSelect2);
@@ -1674,7 +1676,7 @@
exports.default = SingleTreeSelect;
/***/ },
-/* 20 */
+/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1688,9 +1690,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/build/init_customer_project_create.js b/assets/js/build/init_customer_project_create.js
index db7b9c4..39cfa5d 100644
--- a/assets/js/build/init_customer_project_create.js
+++ b/assets/js/build/init_customer_project_create.js
@@ -46,27 +46,27 @@
'use strict';
- var _SelectedContainer = __webpack_require__(11);
+ var _SelectedContainer = __webpack_require__(13);
var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer);
- var _SelectedContainerCreate = __webpack_require__(15);
+ var _SelectedContainerCreate = __webpack_require__(17);
var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate);
- var _NoTreeSelect = __webpack_require__(16);
+ var _NoTreeSelect = __webpack_require__(18);
var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect);
- var _TreeSelect = __webpack_require__(18);
+ var _TreeSelect = __webpack_require__(20);
var _TreeSelect2 = _interopRequireDefault(_TreeSelect);
- var _SingleTreeSelect = __webpack_require__(19);
+ var _SingleTreeSelect = __webpack_require__(21);
var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect);
- var _SelectOrCreate = __webpack_require__(20);
+ var _SelectOrCreate = __webpack_require__(22);
var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate);
@@ -212,7 +212,9 @@
/* 8 */,
/* 9 */,
/* 10 */,
-/* 11 */
+/* 11 */,
+/* 12 */,
+/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -227,15 +229,15 @@
var _desc, _value, _class; // `
- var _DataTree = __webpack_require__(12);
+ var _DataTree = __webpack_require__(14);
var _DataTree2 = _interopRequireDefault(_DataTree);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
- var _decorators = __webpack_require__(14);
+ var _decorators = __webpack_require__(16);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -466,7 +468,7 @@
exports.default = SelectedContainer;
/***/ },
-/* 12 */
+/* 14 */
/***/ function(module, exports) {
"use strict";
@@ -621,7 +623,7 @@
exports.default = DataTree;
/***/ },
-/* 13 */
+/* 15 */
/***/ function(module, exports) {
"use strict";
@@ -677,7 +679,7 @@
exports.default = NoTreeData;
/***/ },
-/* 14 */
+/* 16 */
/***/ function(module, exports) {
"use strict";
@@ -761,7 +763,7 @@
// export {onBind};
/***/ },
-/* 15 */
+/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -777,11 +779,11 @@
var _desc, _value, _class;
- var _SelectedContainer2 = __webpack_require__(11);
+ var _SelectedContainer2 = __webpack_require__(13);
var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2);
- var _decorators = __webpack_require__(14);
+ var _decorators = __webpack_require__(16);
var _decorators2 = _interopRequireDefault(_decorators);
@@ -862,7 +864,7 @@
exports.default = SelectedContainerCreate;
/***/ },
-/* 16 */
+/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -876,9 +878,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
@@ -945,7 +947,7 @@
exports.default = NoTreeSelect;
/***/ },
-/* 17 */
+/* 19 */
/***/ function(module, exports) {
"use strict";
@@ -1489,7 +1491,7 @@
exports.AbsBaseSelect = AbsBaseSelect;
/***/ },
-/* 18 */
+/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1503,9 +1505,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _DataTree = __webpack_require__(12);
+ var _DataTree = __webpack_require__(14);
var _DataTree2 = _interopRequireDefault(_DataTree);
@@ -1614,7 +1616,7 @@
exports.default = TreeSelect;
/***/ },
-/* 19 */
+/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1626,9 +1628,9 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var _AbsBaseSelect = __webpack_require__(17);
+ var _AbsBaseSelect = __webpack_require__(19);
- var _TreeSelect2 = __webpack_require__(18);
+ var _TreeSelect2 = __webpack_require__(20);
var _TreeSelect3 = _interopRequireDefault(_TreeSelect2);
@@ -1709,7 +1711,7 @@
exports.default = SingleTreeSelect;
/***/ },
-/* 20 */
+/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
@@ -1723,9 +1725,9 @@
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
- var _AbsBaseSelect2 = __webpack_require__(17);
+ var _AbsBaseSelect2 = __webpack_require__(19);
- var _NoTreeData = __webpack_require__(13);
+ var _NoTreeData = __webpack_require__(15);
var _NoTreeData2 = _interopRequireDefault(_NoTreeData);
diff --git a/assets/js/src/create_worksell.js b/assets/js/src/create_worksell.js
index e96f8e9..b16ce5e 100644
--- a/assets/js/src/create_worksell.js
+++ b/assets/js/src/create_worksell.js
@@ -2,6 +2,7 @@ import {fileUploadInit} from './seeds/file_upload'
import {imageUploadInit} from './seeds/image_upload'
import {scrollOnRequiredInit} from './seeds/scroll_on_required'
import {showPopupsInit, addMessage} from './seeds/popups'
+import {ajaxRegistrationInit} from './seeds/ajax_registration'
$(function () {
// fileUploadInit();
@@ -9,5 +10,6 @@ $(function () {
imageUploadInit();
scrollOnRequiredInit();
showPopupsInit();
+ ajaxRegistrationInit('contractor');
window.addMessage = addMessage;
});
\ No newline at end of file
diff --git a/assets/js/src/customer_project_create.js b/assets/js/src/customer_project_create.js
index 89fc83f..0ac65d6 100644
--- a/assets/js/src/customer_project_create.js
+++ b/assets/js/src/customer_project_create.js
@@ -5,6 +5,7 @@ import {readMoreInit} from './seeds/read_more'
import {onlyOneCheckboxInit} from './seeds/only_one_checkbox'
import {showPopupsInit, addMessage} from './seeds/popups'
import {scrollOnRequiredInit} from './seeds/scroll_on_required'
+import {ajaxRegistrationInit} from './seeds/ajax_registration'
import {print} from './seeds/test_seeds'
function showHideRealry() {
@@ -28,5 +29,6 @@ $(function () {
onlyOneCheckboxInit('#safe', '#by_agreement');
scrollOnRequiredInit();
showPopupsInit();
+ ajaxRegistrationInit('customer');
window.addMessage = addMessage;
});
\ No newline at end of file
diff --git a/assets/js/src/home_page.js b/assets/js/src/home_page.js
new file mode 100644
index 0000000..db16370
--- /dev/null
+++ b/assets/js/src/home_page.js
@@ -0,0 +1,5 @@
+import {popupYoutubeInit} from './seeds/popup-youtube'
+
+$(function () {
+ popupYoutubeInit()
+});
\ No newline at end of file
diff --git a/assets/js/src/seeds/ajax_registration.js b/assets/js/src/seeds/ajax_registration.js
new file mode 100644
index 0000000..fe9e483
--- /dev/null
+++ b/assets/js/src/seeds/ajax_registration.js
@@ -0,0 +1,67 @@
+const $form = $('#form-registration');
+
+function clearErrors() {
+ let $error_tags = $form.find('.errorlist');
+ if ($error_tags.length > 0) $error_tags.remove();
+}
+
+function sendData(form_data) {
+ // console.log("form_data = ", form_data);
+ $.ajax({
+ url: '/users/register/',
+ type: 'post',
+ data: form_data,
+ success: function (data) {
+ // console.log("success data -->", data);
+ $('#registrationFormModal').modal('toggle');
+ $('input[name=not_auth_user_id]').val(data.pk);
+ $('#not_customer').hide();
+ $('#is_customer').show();
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ let status = xhr.status;
+ if (status == 400) {
+ let data = JSON.parse(xhr.responseText);
+ $.each(data, function (key, value) {
+ let ul = $("");
+ for (let error of value) {
+ ul.append(`${error} `)
+ }
+ let $field;
+ if (key == 'captcha_html') {
+ // console.log("captcha html = ", key, '/', value);
+ $form.find('.captcha').html(value);
+ return;
+ } else if (key == 'captcha') {
+ $field = $form.find('.g-recaptcha');
+ } else if (key == 'tos') {
+ $field = $form.find(`input[name=${key}]`).parent();
+ } else {
+ $field = $form.find(`input[name=${key}]`);
+ if ($field.length == 0) console.log(`!!!field ${key} not found`);
+ }
+ if ($field.length > 0) $field.parent().append(ul);
+
+ });
+ // console.log('captcha error = ', data.captcha);
+ // console.log('data type = ', typeof data);
+ }
+ // console.log("data = ", xhr.responseText);
+ // console.log(ajaxOptions);
+ // console.log(thrownError);
+ }
+ })
+}
+
+function ajaxRegistrationInit(user_type) {
+ // const $form = $('#form-registration');
+ $form.on("submit", function (e) {
+ e.preventDefault();
+ // get form data and add user_type
+ clearErrors();
+ let form_data = $form.serialize() + "&user_type=" + encodeURIComponent(user_type);
+ sendData(form_data);
+ })
+}
+
+export {ajaxRegistrationInit}
\ No newline at end of file
diff --git a/assets/js/src/seeds/popup-youtube.js b/assets/js/src/seeds/popup-youtube.js
new file mode 100644
index 0000000..22d759b
--- /dev/null
+++ b/assets/js/src/seeds/popup-youtube.js
@@ -0,0 +1,12 @@
+function popupYoutubeInit() {
+ $('.popup-youtube').magnificPopup({
+ disableOn: 700,
+ type: 'iframe',
+ mainClass: 'mfp-fade',
+ removalDelay: 160,
+ preloader: false,
+ fixedContentPos: false
+ });
+}
+
+export {popupYoutubeInit}
\ No newline at end of file
diff --git a/assets/js/src/seeds/send_data.js b/assets/js/src/seeds/send_data.js
index 29a9743..f069a4f 100644
--- a/assets/js/src/seeds/send_data.js
+++ b/assets/js/src/seeds/send_data.js
@@ -1,6 +1,17 @@
-function sendData(){
+function sendData(form_data) {
+ console.log("form_data = ", form_data);
$.ajax({
- url: '',
-
+ url: '/users/register/',
+ type: 'post',
+ data: form_data,
+ success: function (data) {
+ console.log("success data -->", data)
+ },
+ error: function (xhr, ajaxOptions, thrownError) {
+ console.log("status = ", xhr.status);
+ console.log("data = ", xhr.responseText);
+ console.log(ajaxOptions);
+ console.log(thrownError);
+ }
})
}
\ No newline at end of file
diff --git a/assets/lib/proekton-components/sass/parts/_selected-container.sass b/assets/lib/proekton-components/sass/parts/_selected-container.sass
index 07af5d8..fff89f4 100644
--- a/assets/lib/proekton-components/sass/parts/_selected-container.sass
+++ b/assets/lib/proekton-components/sass/parts/_selected-container.sass
@@ -4,7 +4,7 @@
min-height: 40px
//padding-bottom: 20px
.selected-element
- padding: 5px 35px 5px 10px
+ padding: 7px 35px 3px 10px
margin-top: 8px
min-height: 45px
background-color: #e3e3e3
@@ -19,6 +19,7 @@
text-overflow: ellipsis
overflow: hidden
width: 100%
+ display: block
.header
font-size: 7pt
color: #676363
@@ -39,9 +40,9 @@
.horizontal
&.selected-container
//display: inline-block
- .header, .name
+ //.header, .name
//max-width: 300px
- display: inline-block
+ //display: block
.selected-element
max-width: 300px
display: inline-block
\ No newline at end of file
diff --git a/assets/sass/base/_fonts.sass b/assets/sass/base/_fonts.sass
index be9d9e8..d740998 100644
--- a/assets/sass/base/_fonts.sass
+++ b/assets/sass/base/_fonts.sass
@@ -1,4 +1,4 @@
-$static : '/static'
+$static: '/static'
@font-face
font-family: 'pfbeausanspro-reg'
@@ -6,24 +6,39 @@ $static : '/static'
font-weight: normal
font-style: normal
-
@font-face
font-family: 'pfbeausanspro-thin'
src: url('#{$static}/fonts/PFBeauSansPro-Thin/PFBeauSansPro-Thin.eot?#iefix') format("embedded-opentype"), url('#{$static}/fonts/PFBeauSansPro-Thin/PFBeauSansPro-Thin.woff') format("woff"), url('#{$static}/fonts/PFBeauSansPro-Thin/PFBeauSansPro-Thin.ttf') format("truetype"), url('#{$static}/fonts/PFBeauSansPro-Thin/PFBeauSansPro-Thin.svg#PFBeauSansPro-Thin') format("svg")
font-weight: normal
font-style: normal
-
@font-face
font-family: 'pfdintextcomppro-regular'
src: url('#{$static}/fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.eot?#iefix') format("embedded-opentype"), url('#{$static}/fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.woff') format("woff"), url('#{$static}/fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.ttf') format("truetype"), url('#{$static}/fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.svg#PFDinTextCompPro-Regular') format("svg")
font-weight: normal
font-style: normal
-
@font-face
font-family: 'Arial-MT-Regular'
src: url('#{$static}/fonts/Arial-MT-Regular/Arial-MT-Regular.eot')
src: url('#{$static}/fonts/Arial-MT-Regular/Arial-MT-Regular.eot?#iefix') format("embedded-opentype"), url('#{$static}/fonts/Arial-MT-Regular/Arial-MT-Regular.woff') format("woff"), url('#{$static}/fonts/Arial-MT-Regular/Arial-MT-Regular.ttf') format("truetype"), url('#{$static}/fonts/Arial-MT-Regular/Arial-MT-Regular.svg#Arial-MT-Regular') format("svg")
font-weight: normal
- font-style: normal
\ No newline at end of file
+ font-style: normal
+
+@font-face
+ font-family: "Myriad"
+ src: url('#{$static}/fonts/MyriadPro/MyriadPro-Cond.otf')
+ font-weight: normal
+ font-style: normal
+
+@font-face
+ font-family: "Myriad"
+ src: url("#{$static}/fonts/MyriadPro/MyriadPro-BoldCond.otf")
+ font-weight: bold
+ font-style: normal
+
+@font-face
+ font-family: "Myriad"
+ src: url("#{$static}/fonts/MyriadPro/MyriadPro-CondIt.otf")
+ font-weight: normal
+ font-style: italic
\ No newline at end of file
diff --git a/assets/sass/components/custom-components.sass b/assets/sass/components/custom-components.sass
index 7141ac2..ac10e7e 100644
--- a/assets/sass/components/custom-components.sass
+++ b/assets/sass/components/custom-components.sass
@@ -73,7 +73,11 @@ textarea.description
font-weight: normal
font-style: normal
font-size: 14pt
+ display: inline-block
+ color: #000
&:hover
+ color: #000
+ text-decoration: none
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2)
-webkit-transform: scale(1.04)
-moz-transform: scale(1.04)
diff --git a/assets/sass/main.sass b/assets/sass/main.sass
index bbd97df..213b2c6 100644
--- a/assets/sass/main.sass
+++ b/assets/sass/main.sass
@@ -1,6 +1,8 @@
-@import "base/fonts.sass"
-@import "base/colors.sass"
+@import "base/fonts"
+@import "base/colors"
+@import "base/variavles"
@import "common/parts"
+@import "modules/mods"
body
font-size: 11pt
@@ -39,21 +41,6 @@ body
@extend %header
max-width: 100%
-// TODO: move to modules/_mods.sass
-.mod-align-bottom
- display: flex
- //-ms-flex-align: center
- //-webkit-align-items: center
- //-webkit-box-align: center
- align-items: flex-end
-
-.mod-align-center
- display: flex
- //-ms-flex-align: center
- //-webkit-align-items: center
- //-webkit-box-align: center
- align-items: center
-
.logical-block
$pad: 30px
padding-top: $pad
@@ -67,6 +54,7 @@ body
.slide
display: none
+ margin-bottom: 20px
.slide.active
display: block
diff --git a/assets/sass/modules/_mods.sass b/assets/sass/modules/_mods.sass
index 261ac62..496a121 100644
--- a/assets/sass/modules/_mods.sass
+++ b/assets/sass/modules/_mods.sass
@@ -1,6 +1,24 @@
+.mod-align-bottom,
.vertical-bottom
+ //deprecated
+ display: flex
+ -ms-flex-align: end
+ -webkit-align-items: flex-end
+ -webkit-box-align: end
+ align-items: flex-end
+
+.mod-align-center
display: flex
-ms-flex-align: center
-webkit-align-items: center
-webkit-box-align: center
- align-items: flex-end
\ No newline at end of file
+ align-items: center
+
+.mod-no-padding
+ padding: 0 !important
+
+.mod-row-eq-height
+ display: -webkit-box
+ display: -webkit-flex
+ display: -ms-flexbox
+ display: flex
diff --git a/common/forms.py b/common/forms.py
index 4d93dc2..3cff870 100644
--- a/common/forms.py
+++ b/common/forms.py
@@ -46,13 +46,15 @@ class CustomRegistrationForm(RegistrationFormTermsOfService):
captcha = ReCaptchaField()
def __init__(self, *args, **kwargs):
- self.request = kwargs.pop('request')
- super().__init__(*args, **kwargs)
-
- if self.request.GET.get('type') == 'customer':
- self.fields['user_type'].initial = 'customer'
- elif self.request.GET.get('type') == 'contractor':
- self.fields['user_type'].initial = 'contractor'
+ try:
+ self.request = kwargs.pop('request')
+ super().__init__(*args, **kwargs)
+ if self.request.GET.get('type') == 'customer':
+ self.fields['user_type'].initial = 'customer'
+ elif self.request.GET.get('type') == 'contractor':
+ self.fields['user_type'].initial = 'contractor'
+ except KeyError:
+ super().__init__(*args, **kwargs)
attrs = self.fields['user_type'].widget.attrs
attrs['class'] = _.join(_.compact((attrs.get('class'), 'selectpicker3')), ' ')
diff --git a/common/mixins.py b/common/mixins.py
index f3b0433..f3aa9ab 100644
--- a/common/mixins.py
+++ b/common/mixins.py
@@ -1,8 +1,13 @@
+import json
+
+from django.http import HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
+from django.contrib.auth import login
from django.core.exceptions import PermissionDenied
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
+from django.template import RequestContext, loader
class NoCsrfMixin(View):
@@ -25,3 +30,37 @@ class ContractorRequiredMixin(LoginRequiredMixin, View):
return super().dispatch(request, *args, **kwargs)
else:
raise PermissionDenied
+
+
+class AjaxUserAuthMixin:
+ """
+ Mixin to add AJAX support to a form.
+ Must be used with an object-based FormView (e.g. CreateView)
+ """
+
+ def render_to_json_response(self, context, **response_kwargs):
+ user_form = self.form_class()
+ captcha_html = loader.render_to_string('partials/inc-captcha.html', {"user_form": user_form})
+ context.update({"captcha_html": captcha_html})
+ data = json.dumps(context, ensure_ascii=False)
+ response_kwargs['content_type'] = 'application/json'
+ return HttpResponse(data, **response_kwargs)
+
+ def form_invalid(self, form):
+ response = super().form_invalid(form)
+ if self.request.is_ajax():
+ return self.render_to_json_response(form.errors, status=400)
+ else:
+ return response
+
+ def form_valid(self, form):
+ if self.request.is_ajax():
+ new_user = self.register(form)
+ data = {
+ 'pk': new_user.pk,
+ }
+
+ return self.render_to_json_response(data)
+ else:
+ response = super().form_valid(form)
+ return response
diff --git a/common/views.py b/common/views.py
index bc66f7d..d7de626 100644
--- a/common/views.py
+++ b/common/views.py
@@ -12,7 +12,7 @@ from sorl.thumbnail import get_thumbnail
from archilance import util
from archilance.mixins import BaseMixin
-from common.mixins import NoCsrfMixin
+from common.mixins import NoCsrfMixin, AjaxUserAuthMixin
from users.models import ContractorResume
from .forms import PrintOrderForm, CustomRegistrationForm
from .models import PrintDocuments, PrintOrder, Settings, LiveImageUpload
@@ -110,7 +110,7 @@ class LiveImageUploadDeleteView(NoCsrfMixin, LoginRequiredMixin, View):
return JsonResponse({'status': 'error'})
-class CustomRegistrationView(RegistrationView):
+class CustomRegistrationView(AjaxUserAuthMixin, RegistrationView):
form_class = CustomRegistrationForm
template_name = 'registration/registration_form.html'
success_url = reverse_lazy('registration_complete')
diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html
index 16ec958..aabeda2 100644
--- a/projects/templates/customer_project_create.html
+++ b/projects/templates/customer_project_create.html
@@ -9,11 +9,11 @@
-
{% endblock %}
{% block content %}
{% include 'partials/modals/project_work_type_suggestion.html' %}
+ {% include 'partials/modals/modal-registration_form.html' %}
{% include 'partials/header.html' %}
+
-
diff --git a/projects/views.py b/projects/views.py
index 9d4bbe6..626eaa0 100644
--- a/projects/views.py
+++ b/projects/views.py
@@ -62,6 +62,7 @@ from .forms import (
from specializations.models import Specialization
from common.models import Location
+from common.forms import CustomRegistrationForm
_.map = _.map_
_.filter = _.filter_
@@ -490,11 +491,18 @@ class CustomerProjectCreateView(BaseMixin, View):
work_type_suggestion_form = ProjectWorkTypeSuggestionForm
template_name = 'customer_project_create.html'
- def dispatch(self, request, *args, **kwargs):
- if request.user.is_authenticated() and request.user.is_customer():
- return super().dispatch(request, *args, **kwargs)
- else:
- raise PermissionDenied
+ # def dispatch(self, request, *args, **kwargs):
+ # if request.user.is_authenticated() and request.user.is_customer():
+ # return super().dispatch(request, *args, **kwargs)
+ # else:
+ # raise PermissionDenied
+
+ def get_context_data(self, **kwargs):
+ ctx = super().get_context_data()
+ # ctx['hide_user_type'] = False
+ user_form = CustomRegistrationForm()
+ ctx['user_form'] = user_form
+ return ctx
def get(self, request, *args, **kwargs):
context = self.get_context_data(**_.merge({}, request.GET, kwargs))
@@ -513,7 +521,7 @@ class CustomerProjectCreateView(BaseMixin, View):
def post(self, request, *args, **kwargs):
form = self.form_class(request.POST, request=request) # Passing `request.FILES` seems unnecessary here. Files are added manually below
- print('POST = ', request.POST)
+ # print('POST = ', request.POST)
form.is_valid()
realty = form.cleaned_data.get('realty')
@@ -524,7 +532,12 @@ class CustomerProjectCreateView(BaseMixin, View):
if form.is_valid() and realty_form.is_valid():
project = form.save(commit=False)
- project.customer = request.user
+ unregister_user = request.POST.get('not_auth_user_id')
+ if unregister_user:
+ user = get_object_or_404(User, pk=unregister_user)
+ else:
+ user = request.user
+ project.customer = user
project.save()
form.save_m2m()
@@ -537,8 +550,7 @@ class CustomerProjectCreateView(BaseMixin, View):
realty_form.save()
else:
realty = realty_form.save(commit=False)
- realty.user = request.user
- print('new_realty_name = ', request.POST.get('new_realty_name'))
+ realty.user = user
if not request.POST.get('new_realty_name'):
realty.is_virtual = True
realty.name = request.POST.get('new_realty_name')
@@ -566,6 +578,10 @@ class CustomerProjectCreateView(BaseMixin, View):
context = self.get_context_data(**kwargs)
context.update({'form': form, 'realty_form': realty_form})
+
+ unregister_user = request.POST.get('not_auth_user_id')
+ if unregister_user:
+ context.update({'unregister_user': unregister_user})
return render(request, self.template_name, context)
diff --git a/templates/home.html b/templates/home.html
index a0f08a1..20ae8e4 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -1,100 +1,145 @@
{% extends 'partials/base.html' %}
+{% load staticfiles %}
+{% load sass_tags %}
+{% load thumbnail %}
+{% block old_css %}{% endblock %}
+{% block head_css %}
+
+
+
+{% endblock %}
{% block content %}
-
- {% include 'partials/header.html' %}
-
-
-
-
{{ main_settings.heading }}
-
-
-
-
-
-
-
+ {% include 'partials/header.html' %}
+
+
+
+
+
{{ main_settings.heading }}
+
+
+
+
+
+
{% if request.user.is_authenticated and request.user.is_customer %}
-
Я заказчик
+
Я заказчик
{% else %}
-
Я заказчик
+
Я заказчик
{% endif %}
-
- {{ main_settings.customer_text|safe }}
+
+
+
+
+
+ Ресурс для специалистов по проектированию, дизайну, оформлению и сопровождению
+ проектной документации
+
+
+
+
+
+ Удобный и быстрый поиск исполнителей
+
+
+
+
+
+ Готовые сформированные группы исполнителей
+
+
+
+
+
+ Безопасная сделка (договор без риска)
+
+
+
+
+
+ Адекватная оценка стоимости работы
+
+
+
+
+
+ Возможность купить готовые проекты, работы
+
+
+
-
-
-
-
+
+
{% if request.user.is_authenticated and request.user.is_contractor %}
-
Я исполнитель
+
Я
+ исполнитель
{% else %}
-
Я исполнитель
+
Я
+ исполнитель
{% endif %}
-
- {{ main_settings.contractor_text|safe }}
+
+
+
+
+
+ Большой выбор заказов для исполнителей
+
+
+
+
+
+ Удобный и быстрый поиск заказчиков
+
+
+
+
+
+ Безопасная сделка (договор без риска)
+
+
+
+
+
+ Печать, брошюровка и доставка проектной документации
+
+
+
+
+
+ Возможность продать готовые проекты, работы
+
+
+
+
+
+ Платформа разработана для проектировщиков дизайнеров и технических заказчиков
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-{# #}
-{#
#}
-{#
#}
-{#
#}
-{# #}
-{#
#}
-{#
#}
-{# {{ main_settings.video_code | safe }}#}
-{#
#}
-{#
#}
-{#
#}
-{#
#}
-{#
#}
-
-
-
+
Добавить проект
+
+
+
+
+
+
+ {% include 'partials/footer.html' %}
{% endblock %}
+{% block old_js %}
+
+{% endblock %}
{% block js_block %}
-
+
+
{% endblock %}
diff --git a/templates/partials/inc-captcha.html b/templates/partials/inc-captcha.html
new file mode 100644
index 0000000..06d211c
--- /dev/null
+++ b/templates/partials/inc-captcha.html
@@ -0,0 +1,3 @@
+{{ form.captcha }}
+{{ user_form.captcha }}
+{{ form.captcha.errors }}
\ No newline at end of file
diff --git a/templates/partials/inc-registration_form.html b/templates/partials/inc-registration_form.html
new file mode 100644
index 0000000..a94bd34
--- /dev/null
+++ b/templates/partials/inc-registration_form.html
@@ -0,0 +1,61 @@
+{% load sass_tags %}
+
+
+
\ No newline at end of file
diff --git a/templates/partials/modals/modal-registration_form.html b/templates/partials/modals/modal-registration_form.html
new file mode 100644
index 0000000..b8f69f0
--- /dev/null
+++ b/templates/partials/modals/modal-registration_form.html
@@ -0,0 +1,19 @@
+
diff --git a/templates/partials/sass/footer.sass b/templates/partials/sass/footer.sass
index 34e0e32..193bb69 100644
--- a/templates/partials/sass/footer.sass
+++ b/templates/partials/sass/footer.sass
@@ -88,4 +88,7 @@ footer
&:link, &:visited
font-family: 'Arial-MT-Regular', sans-serif
color: #6c6c6c
- font-size: 15px
\ No newline at end of file
+ font-size: 15px
+ &:hover
+ text-decoration: none
+ color: #383838
\ No newline at end of file
diff --git a/templates/partials/sass/header.sass b/templates/partials/sass/header.sass
index 83f0788..2b3e2f2 100644
--- a/templates/partials/sass/header.sass
+++ b/templates/partials/sass/header.sass
@@ -1,4 +1,4 @@
-$static: '/static'
+@import "base/variavles"
.wrTop
width: 100%
@@ -170,98 +170,22 @@ li.officeList.icon_tml > a > p
right: -34px
top: -4px
-.changeBlock
- width: 485px
- overflow: hidden
- padding: 113px 0 0 0
- position: relative
- &a
- border: none
- cursor: pointer
- height: 40px
- border-radius: 40px
- font-size: 20px
- text-transform: uppercase
- font-family: 'pfdintextcomppro-regular', sans-serif
- letter-spacing: 4px
- position: relative
- top: -60px
- display: table
- margin: auto
-
-.changeBlock1
+.reg, .reg:link, .reg:visited
+ color: #fb1818
+ font-size: 16px
+ text-transform: uppercase
float: left
- margin-left: -15px
- background-color: rgba(255, 0, 6, 0.7)
- &a
- &:link,
- &:visited
- background: url('#{$static}/img/button1.png') no-repeat 25px, black
- color: white
- padding: 24px 26px 20px 72px
-
-.changeBlock2
- float: right
- margin-right: -15px
- background-color: rgba(0, 0, 0, 0.7)
- &a
- &:link,
- &:visited
- background: url('#{$static}/img/button2.png') no-repeat 27px, white
- color: black
- padding: 24px 26px 20px 72px
-
-.changeBlock
- p
- font-family: 'Arial-MT-Regular', sans-serif
-
-.changeBlock1
- p
- color: white
-
-.changeBlock2
- p
- color: black
-
-.changeBlock
- min-height: 500px
- display: table
- padding: 143px 20px 120px 20px
- &:after
- content: ''
- position: absolute
- width: 66px
- height: 1px
- left: 50%
- margin-left: -30px
- background-color: white
- bottom: 60px
+ line-height: 75px
+ font-family: 'pfdintextcomppro-regular', sans-serif
+ letter-spacing: 4px
-.changeBlock2
+.lock
+ width: 75px
+ height: 75px
+ background: url('#{$static}/img/lock.png') no-repeat center, white
float: right
- margin-right: -15px
- background-color: rgba(0, 0, 0, 0.7)
-
-.square
- width: 46px
- height: 46px
- position: absolute
- right: -23px
- top: 100px
- z-index: 9
- -webkit-transform: rotate(135deg)
- -moz-transform: rotate(135deg)
- transform: rotate(135deg)
- background-color: #DCDCDD
-
- .insetSquare
- width: 100%
- height: 100%
- position: relative
- -webkit-transform: rotate(-135deg)
- -moz-transform: rotate(-135deg)
- transform: rotate(-135deg)
- background: url('#{$static}/img/arrow.png') no-repeat center
+ cursor: pointer
+ margin: 0 -25px 0 0
.imgProfile
width: 75px
diff --git a/templates/partials/sass/home.sass b/templates/partials/sass/home.sass
new file mode 100644
index 0000000..bc7d8fc
--- /dev/null
+++ b/templates/partials/sass/home.sass
@@ -0,0 +1,160 @@
+@import "base/variavles"
+@import "base/fonts"
+
+.home
+ background:
+ image: url("#{$static}/img/main.png")
+ repeat: no-repeat
+ position: center
+ size: cover
+
+.icons
+ display: inline-block
+ width: 24px
+ height: 24px
+ background:
+ image: url("#{$static}/img/sprite.png")
+ repeat: no-repeat
+
+.infoBlock
+ //padding: 113px 0 0 0
+ height: 100%
+ text-align: center
+ padding: 80px 0 40px
+ ul
+ &.customer-list,
+ &.contractor-list
+ text-align: left
+ padding-left: 60px
+ padding-right: 20px
+ li
+ display: flex
+ align-items: center
+ padding-top: 10px
+ list-style: none
+ font-size: 12px
+ .text
+ padding-left: 10px
+ display: inline-block
+ .icon
+ &-1
+ @extend .icons
+ width: 40px
+ background-position: 0 0
+ &-2
+ @extend .icons
+ background-position: 0 -24px
+ &-3
+ @extend .icons
+ background-position: 0 -48px
+ &-4
+ @extend .icons
+ background-position: 0 -72px
+ &-5
+ @extend .icons
+ background-position: 0 -96px
+ &-6
+ @extend .icons
+ background-position: 0 -120px
+ &-7
+ @extend .icons
+ background-position: 0 -144px
+ &-8
+ @extend .icons
+ background-position: 0 -168px
+ &-9
+ @extend .icons
+ background-position: 0 -192px
+ &-10
+ @extend .icons
+ background-position: 0 -216px
+ &-11
+ @extend .icons
+ background-position: 0 -240px
+ &-12
+ @extend .icons
+ background-position: 0 -264px
+
+ &.customer-list
+ li
+ color: #c7c5c5
+ &.contractor-list
+ li
+ color: #353434
+
+
+
+ a
+ text-decoration: none
+ border: none
+ cursor: pointer
+ & > a.to-profile
+ height: 40px
+ border-radius: 40px
+ font-size: 20px
+ text-transform: uppercase
+ font-family: 'pfdintextcomppro-regular', sans-serif
+ letter-spacing: 4px
+ position: relative
+ display: table
+ margin: 0 auto
+ a.create
+ font-family: Myriad, sans-serif
+ font-weight: normal
+ font-size: 18pt
+ display: inline-block
+ margin-top: 40px
+ text-transform: uppercase
+ &.customer
+ background-color: rgba(0, 0, 0, 0.7)
+ p, a.create
+ color: #c7c5c5
+ &:hover
+ color: #f3f1f1
+ & > a.to-profile
+ &:link, &:visited
+ background: url('#{$static}/img/button2.png') no-repeat 27px, white
+ color: black
+ padding: 24px 26px 20px 72px
+ &:hover
+ box-shadow: 0 0 15px rgba(255, 255, 255, 0.8)
+ -webkit-transform: scale(1.04)
+ -moz-transform: scale(1.04)
+ transform: scale(1.04)
+ &.contractor
+ background-color: rgba(255, 0, 6, 0.7)
+ p, a.create
+ color: #353434
+ &:hover
+ color: #141313
+ & > a.to-profile
+ &:link, &:visited
+ background: url('#{$static}/img/button1.png') no-repeat 25px, black
+ color: white
+ padding: 24px 26px 20px 72px
+ &:hover
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.8)
+ -webkit-transform: scale(1.04)
+ -moz-transform: scale(1.04)
+ transform: scale(1.04)
+
+.youtube
+ display: block
+ border-radius: 50%
+ width: 80px
+ height: 80px
+ margin: 20px auto 40px
+ //border-radius: 100%
+ cursor: pointer
+ background:
+ image: url('#{$static}/img/youtube.png')
+ repeat: no-repeat
+ position: center
+ size: cover
+ &:hover
+ box-shadow: 0 0 15px rgba(255, 19, 19, 0.8)
+ -webkit-transform: scale(1.04)
+ -moz-transform: scale(1.04)
+ transform: scale(1.04)
+ &:focus
+ outline: none
diff --git a/templates/partials/sass/registration.sass b/templates/partials/sass/registration.sass
new file mode 100644
index 0000000..632a894
--- /dev/null
+++ b/templates/partials/sass/registration.sass
@@ -0,0 +1,119 @@
+@import "base/variavles"
+
+.form-regestration
+ display: table
+ width: 100%
+ float: left
+ margin: 0 0 80px 0
+ padding: 67px 0
+ //padding: 20px 0 67px 0
+ background-color: #ddd
+ text-align: center
+ a, a:hover
+ text-decoration: none
+ a:hover
+ color: #6f7bff
+
+.select-reg
+ .btn-group
+ display: inline-block
+ vertical-align: top
+ &.captcha
+ text-align: center
+ .g-recaptcha
+ display: inline-table
+ margin: 25px 0 0 0
+ input[type="checkbox"] + span
+ position: absolute
+ left: 0
+ top: 0
+ width: 100%
+ height: 100%
+ background:
+ image: url('#{$static}/img/check.png')
+ repeat: no-repeat
+ position: 0 0
+ size: cover
+ cursor: pointer
+ label
+ width: 23px
+ height: 23px
+ display: block
+ position: relative
+ margin-right: 10px
+
+ input[type="checkbox"]:checked + span
+ background-position: 0 -23px
+
+.email-reg, .pass-reg
+ width: 360px
+ height: 51px
+ display: inline-block
+ vertical-align: top
+ padding: 0 15px
+ font-size: 15px
+ background-color: white
+ color: black
+ margin: 20px 0 0 0
+ font-family: 'Arial-MT-Regular', sans-serif
+ border: none !important
+
+.reg-sub
+ width: 360px
+ height: 51px
+ color: white
+ text-align: center
+ font-family: 'pfdintextcomppro-regular', sans-serif
+ letter-spacing: 2px
+ line-height: 51px
+ border: none
+ background-color: #42B476
+ border-radius: 40px
+ display: inline-block
+ vertical-align: top
+ margin-top: 20px
+ font-size: 15px
+ text-transform: uppercase
+ &:active, &:focus
+ outline: none !important
+
+.check-reg
+ width: 360px
+ display: inline-block
+ vertical-align: top
+ margin-top: 20px
+ label
+ float: left
+ p
+ font-family: 'Arial-MT-Regular', sans-serif
+ color: #6c6c6c
+ font-size: 15px
+ float: left
+ /*margin: -2px 0 0 10px;
+ line-height: 18px
+ width: 90%
+ text-align: left
+ > a
+ color: #009DD9
+ &:link, &:visited
+ color: #009DD9
+ &:hover
+ color: #6f7bff
+
+.have-ac, .have-ac:link, .have-ac:visited
+ color: #009DD9
+ font-size: 17px
+ font-family: 'Arial-MT-Regular', sans-serif
+ text-transform: uppercase
+ display: inline-block
+
+.form-regestration
+ .errorlist
+ color: red
+ //width: 360px
+ //margin: 0 auto
+ //text-align: left
+ font-family: 'Arial-MT-Regular', sans-serif
+ font-size: 15px
+ li
+ list-style: none
\ No newline at end of file
diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html
index 41428ef..f5f0449 100644
--- a/templates/registration/registration_form.html
+++ b/templates/registration/registration_form.html
@@ -6,75 +6,7 @@
-
+ {% include 'partials/inc-registration_form.html' %}
{% include 'partials/footer.html' %}
diff --git a/templates/trash/home.html b/templates/trash/home.html
new file mode 100644
index 0000000..a0f08a1
--- /dev/null
+++ b/templates/trash/home.html
@@ -0,0 +1,100 @@
+{% extends 'partials/base.html' %}
+
+{% block content %}
+
+ {% include 'partials/header.html' %}
+
+
+
+
{{ main_settings.heading }}
+
+
+
+
+
+
+
+ {% if request.user.is_authenticated and request.user.is_customer %}
+
Я заказчик
+ {% else %}
+
Я заказчик
+ {% endif %}
+
+ {{ main_settings.customer_text|safe }}
+
+
+
+
+
+
+ {% if request.user.is_authenticated and request.user.is_contractor %}
+
Я исполнитель
+ {% else %}
+
Я исполнитель
+ {% endif %}
+
+ {{ main_settings.contractor_text|safe }}
+
+
+
+
+
+
+
+
+
+
+
+
+{# #}
+{#
#}
+{#
#}
+{#
#}
+{# #}
+{#
#}
+{#
#}
+{# {{ main_settings.video_code | safe }}#}
+{#
#}
+{#
#}
+{#
#}
+{#
#}
+{#
#}
+
+
+
+{% endblock %}
+
+{% block js_block %}
+
+{% endblock %}
diff --git a/webpack.config.js b/webpack.config.js
index da0cdaf..c7d2022 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -14,6 +14,8 @@ module.exports = {
//worksell
create_worksell: "./assets/js/src/create_worksell.js",
init_create_worksell: './assets/js/src/init_create_worksell.js',
+ //home
+ home_page: "./assets/js/src/home_page.js",
},
diff --git a/work_sell/templates/worksell_create.html b/work_sell/templates/worksell_create.html
index 5cabe30..a893da0 100644
--- a/work_sell/templates/worksell_create.html
+++ b/work_sell/templates/worksell_create.html
@@ -8,24 +8,12 @@
- {# #}
{% endblock %}
{% block content %}
{% include 'partials/modals/project_work_type_suggestion.html' %}
+ {% include 'partials/modals/modal-registration_form.html' %}
{% include 'partials/header.html' %}
@@ -132,7 +120,7 @@
style="position: absolute; top: -1000px; left: -1000px">
×
-{#
#}
+ {#
#}
@@ -192,17 +180,53 @@
-
-
-
+
+
-
diff --git a/work_sell/views.py b/work_sell/views.py
index 5bcad35..b19916c 100644
--- a/work_sell/views.py
+++ b/work_sell/views.py
@@ -6,7 +6,7 @@ import pydash as _;
_.map = _.map_;
_.filter = _.filter_
from pprint import pformat
-from django.shortcuts import render, redirect
+from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.contrib import messages
from django.db.models import Q
@@ -20,11 +20,14 @@ from django.views.generic import ListView, DetailView, CreateView, View, \
from projects.models import BuildingClassfication, ConstructionType
from projects.forms import ProjectWorkTypeSuggestionForm
+from archilance.mixins import BaseMixin
+from common.forms import CustomRegistrationForm
+from users.models import User
from .models import WorkSell, Picture, WorkSellPhoto, WorkSellPhoto
from .forms import WorkSellForm, WorkSellFilterForm, ContractorWorkSellTrashForm
from .serialize import serialize
from .response import JSONResponse, response_mimetype
-from archilance.mixins import BaseMixin
+
class PictureCreateView(CreateView):
@@ -174,11 +177,17 @@ class WorkSellCreateView(BaseMixin, View):
work_type_suggestion_form = ProjectWorkTypeSuggestionForm
template_name = 'worksell_create.html'
- def dispatch(self, request, *args, **kwargs):
- if request.user.is_authenticated() and request.user.is_contractor():
- return super().dispatch(request, *args, **kwargs)
- else:
- raise PermissionDenied
+ # def dispatch(self, request, *args, **kwargs):
+ # if request.user.is_authenticated() and request.user.is_contractor():
+ # return super().dispatch(request, *args, **kwargs)
+ # else:
+ # raise PermissionDenied
+
+ def get_context_data(self, **kwargs):
+ ctx = super().get_context_data()
+ user_form = CustomRegistrationForm()
+ ctx['user_form'] = user_form
+ return ctx
def get(self, request, *args, **kwargs):
context = self.get_context_data(**_.merge({}, request.GET, kwargs))
@@ -207,10 +216,15 @@ class WorkSellCreateView(BaseMixin, View):
else:
request.POST.setlist('el_format', request.POST.get('el_format', "").split(','))
- print("POST before = ", request.POST)
+ # print("POST before = ", request.POST)
if form.is_valid():
work_sell = form.save(commit=False)
- work_sell.contractor = request.user
+ unregister_user = request.POST.get('not_auth_user_id')
+ if unregister_user:
+ user = get_object_or_404(User, pk=unregister_user)
+ else:
+ user = request.user
+ work_sell.contractor = user
work_sell.save()
form.save_m2m()