From b2bdaddfc7aac061b45d17a5f1059456248522ee Mon Sep 17 00:00:00 2001 From: booblegum Date: Thu, 2 Feb 2017 17:58:30 +0300 Subject: [PATCH] chat v.0.2 Fix many many bugs... --- assets/css/main.css | 46 +- assets/img/icons/icon_books.png | Bin 8500 -> 5935 bytes assets/img/icons/icon_hand_pen.png | Bin 0 -> 4949 bytes assets/img/icons/icon_print.png | Bin 4480 -> 1786 bytes assets/js/build/chat_contractor_oop.js | 677 ++++++++++----- assets/js/build/chat_customer_oop.js | 816 ++++++++++++++++-- assets/js/build/contractor_filter.js | 16 +- assets/js/build/create_project.js | 83 +- assets/js/build/create_worksell.js | 20 +- assets/js/build/custom_components.js | 8 +- assets/js/build/customer_profile.js | 16 +- assets/js/build/debugUtilsInit.js | 4 +- assets/js/build/home_page.js | 4 +- assets/js/build/init_contractor_filter.js | 34 +- assets/js/build/init_create_worksell.js | 58 +- .../js/build/init_customer_project_create.js | 58 +- assets/js/build/init_modal_realty_edit.js | 58 +- assets/js/build/init_portfolio_create_edit.js | 50 +- assets/js/build/init_worksell_filter.js | 34 +- assets/js/build/portfolio_create_edit.js | 12 +- assets/js/build/project_filter.js | 12 +- assets/js/build/registration.js | 4 +- assets/js/build/user_profile_edit.js | 16 +- assets/js/build/worksell_filter.js | 16 +- assets/js/src/chat/BINDS.js | 82 +- .../src/chat/ChatContractorPageController.js | 2 +- .../js/src/chat/ChatCustomerPageController.js | 2 +- assets/js/src/chat/MessagesControllers.js | 5 +- assets/js/src/chat/Stages.js | 3 - .../js/src/chat/StagesContractorController.js | 100 ++- .../js/src/chat/StagesCustomerController.js | 130 ++- assets/js/src/chat/archiveProjects.js | 46 +- assets/js/src/chat/documents.js | 19 +- assets/js/src/chat/loaders.js | 8 + assets/js/src/chat/messageCounters.js | 2 +- assets/js/src/chat/notes.js | 117 ++- .../links/document_before_upload_tmpl.html | 7 + assets/js/src/chat/templates/note_tmpl.html | 1 + .../src/chat/templates/order_info_tmpl.html | 16 + .../chat/templates/stage_approved_tmpl.html | 5 +- .../stage_contractor_approve_tmpl.html | 32 + assets/js/src/chat/templates/stage_tmpl.html | 13 +- .../templates/switch_to_protected_tmpl.html | 14 + assets/js/src/chat/wsChatConnect.js | 10 +- assets/js/src/chat_contractor_oop.js | 6 +- assets/js/src/chat_customer_oop.js | 17 +- assets/js/trash/chat.js | 2 +- assets/js/trash/chat_customer.js | 1 + assets/sass/modules/_mods.sass | 10 + chat/serializers.py | 1 + chat/static/sass/chat_add.sass | 59 +- chat/templates/chat_contractor.html | 161 ++-- chat/templates/chat_customer.html | 158 ++-- chat/templates/order_info.html | 8 +- .../partials/inc-attach-documents.html | 20 +- chat/templates/partials/inc-team-card.html | 2 +- reviews/models.py | 2 +- reviews/serializers.py | 5 + users/templates/contractor_office.html | 2 +- users/urls.py | 3 + users/views.py | 6 + 61 files changed, 2173 insertions(+), 946 deletions(-) create mode 100644 assets/img/icons/icon_hand_pen.png create mode 100644 assets/js/src/chat/templates/links/document_before_upload_tmpl.html create mode 100644 assets/js/src/chat/templates/order_info_tmpl.html create mode 100644 assets/js/src/chat/templates/stage_contractor_approve_tmpl.html create mode 100644 assets/js/src/chat/templates/switch_to_protected_tmpl.html diff --git a/assets/css/main.css b/assets/css/main.css index 5b1dfdc..d63ded3 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -3291,7 +3291,7 @@ footer:after { .insetCommChat { width: 100%; float: left; - margin: 20px 0 -7px 0; + margin: 9px 0 -7px 0; } .topCommChat{ @@ -3479,7 +3479,7 @@ footer:after { .wrMessages { padding: 0; - background-color: #F7F7F7; + /*background-color: #F7F7F7;*/ border-right: 1px solid #DADADA; /*border-left: 1px solid #DADADA;*/ } @@ -3487,8 +3487,10 @@ footer:after { .messageBlock { width: 100%; float: left; - margin: 0 0 0 0; - padding: 0 0; + background-color: #F7F7F7; + /*margin: 0 0 0 0;*/ + /*padding: 0 0;*/ + padding-bottom: 20px; } .messageBlock > p { @@ -3686,6 +3688,8 @@ footer:after { .documentsChat { width: 100%; float: left; + border-top: 1px solid black; + border-bottom: 1px solid black; } .documentsChat > p { @@ -3915,19 +3919,19 @@ footer:after { /*transform: rotate(90deg);*/ /*}*/ -.orAct .dimovChat { - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - transform: rotate(90deg); -} +/*.orAct .dimovChat {*/ + /*-webkit-transform: rotate(90deg);*/ + /*-moz-transform: rotate(90deg);*/ + /*transform: rotate(90deg);*/ +/*}*/ /*.orderBlock:hover .hideOBB {*/ /*display: block;*/ /*}*/ -.orAct .hideOBB { - display: block !important; -} +/*.orAct .hideOBB {*/ + /*display: block !important;*/ +/*}*/ .wrstepschat { float: left; @@ -3953,11 +3957,12 @@ footer:after { /*display: inline-block;*/ font-size: 24px; font-family: 'pfbeausanspro-reg', sans-serif; - padding: 26px 0px; + padding: 26px 0 40px 0; width: 100%; color: black; background-color: #F3F3F3; text-align: center; + position: relative; } .tab-content .header-wrapper .header{ @@ -3979,8 +3984,9 @@ footer:after { width: 100%; float: left; padding: 15px; - border-top: 1px solid black; - border-bottom: 1px solid black; + padding-bottom: 0; + /*border-top: 1px solid black;*/ + /*border-bottom: 1px solid black;*/ z-index: 9; position: relative; /*margin-bottom: -1px;*/ @@ -3988,7 +3994,7 @@ footer:after { .titleStepss { width: 100%; - /*float: left;*/ + padding-left: 15px; font-size: 18px; font-family: 'Arial-MT-Regular', sans-serif; margin: 0 0 15px 0; @@ -3997,7 +4003,7 @@ footer:after { .textStepss { width: 100%; - /*float: left;*/ + padding-left: 15px; font-size: 14px; line-height: 17px; font-family: 'Arial-MT-Regular', sans-serif; @@ -5801,9 +5807,9 @@ input[type="radio"]:checked + span { /*border-bottom: 1px solid #2c2c2c;*/ /*margin-bottom: 14px;*/ /*}*/ -#order-stages > div:nth-last-child(2), #order-stages > div:last-child{ - border: none; -} +/*#order-stages > div:nth-last-child(2), #order-stages > div:last-child{*/ + /*border: none;*/ +/*}*/ .linkSort button{ font-size: 14px; font-family: 'Arial-MT-Regular', sans-serif; diff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TMaav`n@}}86$HkZpeU*rW1Ku*rwIuOTXi~}!|8Og7-Q8aN>nPn48tTgG&I20 zty?GDkBXaJs4v^2=!r%$D&{k z0AS(5g-};l_g)|npkfTPou#Fv-;DgGDCz@+LJ?DP^E|(trfFf@wrx280D(YYd>{@V zJ`B~>)o|<9tt+A^>cdodZO)uIWURg!5o{+;oOoquXy_6`NG@As=H@!sqkdwcG8RN=r-SDR%en z-Pr>J1D%oOFk{AyC81F08?V>v9%B%G>~_14$(4~_udnoay>`3ZKFVe^8bPDcYzhPd z&n#P&O66mMAX+1PnIH%OF${BE5QMCVEcnc3^D8Ek={nEzSusvw{|bddscN;lUZqm~ zMG%D7Se7*if-qmHRQ`iun4GbKp(yHxBuQ^h#%nC^hVVGLt&Q48bcphtE;Qq zT3cIH9*-w8IXStbr>CctVHoLYFWt9q-x8P0H7NkT?Fod?{b+R%4zxE0a%?ad+8BoE zzH{de=X5%+b#-<12Lb`nYPGhG47!BKk;9Xj;m{{H?yPxkQ_*=)9t{C@w*$l6}8 zV8I-Z$Ag?s=L4B~pU<*vt0;Q!0GrLW#qakwi~vz66fTp=l;m(Y(mWo|O+gSe3WY+@>2#}8Q&TT>cX#)}6nO}O z;89CU3ltRD?B@ifzJz&Fz4Pdj`Hm9ejH#?oqv`3E~ z-H2S1oSdA*^ZcyA!NKbo)^(X8_F|h&V-@^B?#h4LPEjjAF1xb>>*|B5CR~TckTCHWFP-r#A z_=f=C4G+^Ef*|gRqWDWu6uoNk&FSpsA?|Hg4Q_$z(E}Wmh1CB%MyzP*G8_v$?q$ii?Y17(4wBfc4^W TS;#&n00000NkvXXu0mjf=aONf literal 0 HcmV?d00001 diff --git a/assets/img/icons/icon_print.png b/assets/img/icons/icon_print.png index 42648fb98a1a0880f24cad4f1731dd47218fa176..f3afceba694804a0b782f81d00edd68d81b62950 100644 GIT binary patch literal 1786 zcmaJ?X;2eq7!IZl6h$OjPK(QiS{0IPLK2cl43JGUN;o1%3aEr+fe6Wl&0->W;R$jn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cu2;iQmGCcJZN0t-9I}!SKx3s{9d7U?b_iPY+IeE@;i6kuHZhtIe41{2RRh2QdprD`^M1KBSY}vBO z=LdZI?M&Rb;YM3qo55zYEo6*AqtQ$>8Y}+v?zePl#x#$|@8oRo> zgaDvctCNRbzkdDtuUf5E9>^F{>CN7{XU~qr)YLQ=0N8D|(*U9Zs%8ZWB0gS6`}M@d z#f43pH1S48#xelF?AggUa-=3`OXvIV=VANyZ3E{C39~F7k7pcX3~IGHzN)ISVMIVA zB_;jlaJU`=0F6fTNoD1M_lEXKNO;lW@o)jB^5e#hTVpVkmiM3M=H{Zky+eQL(xuA2 z=FF}9HrkPx zn8=@NEL*nxxr-Ms{t(Kw1-V?dt)`~>170j*)21zGZf+*+?d_D~xKQQ*LI|FDW|~?i zlXa|Hw>J0|k(HJ6-1+n84WV9bVvIqlR2cT}FIyLM<#~De|GV;AR#x^s_x%q%_r}S* SPeLpJ0000Резервирование не предусмотрено, безопасная сделака не активна'); } } // Нет Этапов / "Не согласован" @@ -344,7 +346,7 @@ key: 'buildSendApproveStage', value: function buildSendApproveStage() { console.log("Stage: send_approve"); - this._renderStage('stage_approved_tmpl', true); + this._renderStage('stage_contractor_approve_tmpl', true); this.$orderStagesContainer.parent().show(); this.buttons.btnApprove.show(); this.buttons.btnChange.show(); @@ -365,6 +367,7 @@ this.buttons.btnsArbitration.last().show(); this._renderStage('stage_approved_tmpl', true); this.stages_elements.$approve.find('.js-help-text').hide(); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.show(); if (this.secureOrder) { this._renderStageReserved('reserved_tmpl'); @@ -379,31 +382,24 @@ key: 'buildProcessStage', value: function buildProcessStage() { console.log('Stage: in_process'); + // Block-Stage-1 + this.stages_elements.$approve.find('.js-stage-header').html('Согласованные условия'); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.buildAgreedStage(); + // Block-Stage-2 this.stages_elements.$reserve.find('.js-help-text').hide(); + // Block-Stage-3 this.stages_elements.$works.show(); + + this._renderStageInWork('work_in_process_tmpl'); if (this.secureOrder) { - this._renderStageInWork('work_in_process_tmpl'); + // this._renderStageInWork('work_in_process_tmpl'); } else { - this.stages_elements.$reserve.find('.stages-paid').html(""); + this.stages_elements.$reserve.hide(); } } // Статус "В процессе"/"Завершен"/"Закрыт" - }, { - key: '_buildPage', - value: function _buildPage() { - // console.log("Build PAge"); - this.stages_elements.$reserve.hide(); - this.stages_elements.$works.hide(); - if (this.data.stages.length == 0) { - this.buildStartStage(); - } else { - var stageStatus = this.data.stages[0].status; - // console.log('stageStatus = ', stageStatus); - this.STAGE_STATUSES[stageStatus](); - } - this._bindEvents(); - } + }, { key: '_renderStage', value: function _renderStage(template_name) { @@ -518,6 +514,7 @@ }); this.stages_work.push(stage); } + // console.log("has_user_review = ", this.data.has_user_review); } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; @@ -533,7 +530,6 @@ } } - console.log("has_user_review = ", this.data.has_user_review); if (!this.data.has_user_review) { var btnReviewOpenModel = $(this.btnSendReviewTmpl()); btnReviewOpenModel.unbind().on('click', this._onBtnReviewOpenModal.bind(this)); @@ -585,6 +581,11 @@ value: function _onLoadData(json) { this.data = json; this._buildPage(); + if (this.data.project.state == 'deleted') { + for (var key in this.buttons) { + this.buttons[key].hide(); + } + } } }, { key: '_bindEvents', @@ -618,7 +619,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043F\u0440\u0438\u043D\u044F\u0442\u044B'; + message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 "' + self.orderName + '" \u043F\u0440\u0438\u043D\u044F\u0442\u044B'; console.log("Send-WS Условия приняты"); socket.send_stages_approve(message); //TODO: раскомментировать дурацкое окно @@ -640,7 +641,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u0417\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439'; + message.data.msg = '\u0417\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439'; console.log("Send-WS Внести изменения"); socket.send_stages_approve(message); }); @@ -683,7 +684,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u042D\u0442\u0430\u043F ' + json.name + ' \u0437\u0430\u043A\u0440\u044B\u0442'; + message.data.msg = '\u042D\u0442\u0430\u043F "' + json.name + '" \u0437\u0430\u043A\u0440\u044B\u0442'; console.log("Send-WS Закрытие этапа"); socket.send_stages_approve(message); }).catch(function (xhr) { @@ -717,22 +718,26 @@ data: formData, dataType: 'json', success: function success(json) { - console.log('Отзыв успешно отправлен, json -->', json); + // console.log('Отзыв успешно отправлен, json -->', json); // $('#review-add').modal('hide'); // self.stages_elements.$works.find('.js-btnSendReview').hide(); $('#review-add').modal('hide'); - self.redraw(); - var message = message_format; message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D'; + message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D'; console.log("Send-WS Оставить отзыв"); + // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2) socket.send_stages_approve(message); // $("a[href='#tab2']").trigger('click'); - window.location = '/chat/#order'; - location.reload(); + if (json.count_reviews == 1) { + self.redraw(); + } else { + self.reload(); + } + // window.location = '/chat/#order'; + // location.reload(); }, error: function error(e) { console.log('error'); @@ -741,6 +746,14 @@ }); } // "Оставить отзыв" + }, { + key: '_changeOrderProtect', + value: function _changeOrderProtect(secure) { + this.secureOrder = secure; + console.log('secure = ', this.secureOrder); + this.redraw(); + } // Если заказчик изменил secure + }, { key: '_onBtnArbitration', @@ -852,6 +865,22 @@ var _note_tmpl2 = _interopRequireDefault(_note_tmpl); + var _order_info_tmpl = __webpack_require__(14); + + var _order_info_tmpl2 = _interopRequireDefault(_order_info_tmpl); + + var _stage_contractor_approve_tmpl = __webpack_require__(15); + + var _stage_contractor_approve_tmpl2 = _interopRequireDefault(_stage_contractor_approve_tmpl); + + var _document_before_upload_tmpl = __webpack_require__(16); + + var _document_before_upload_tmpl2 = _interopRequireDefault(_document_before_upload_tmpl); + + var _switch_to_protected_tmpl = __webpack_require__(17); + + var _switch_to_protected_tmpl2 = _interopRequireDefault(_switch_to_protected_tmpl); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function loadTemplate(template_name) { @@ -864,7 +893,11 @@ bntCompleteStage_tmpl: _bntCompleteStage_tmpl2.default, btnSendReview_tmpl: _btnSendReview_tmpl2.default, document_attach_file_tmpl: _document_attach_file_tmpl2.default, - note_tmpl: _note_tmpl2.default + note_tmpl: _note_tmpl2.default, + order_info_tmpl: _order_info_tmpl2.default, + stage_contractor_approve_tmpl: _stage_contractor_approve_tmpl2.default, + document_before_upload_tmpl: _document_before_upload_tmpl2.default, + switch_to_protected_tmpl: _switch_to_protected_tmpl2.default }; if (!templates[template_name]) throw new Error('Template ' + template_name + ' does not exist'); @@ -888,14 +921,14 @@ }; function _template() { - return '\n
\n

\u042D\u0422\u0410\u041F ' + this.stage_num + '

\n
\n \n \n

\n \n \n

\n \n

\n \n \n \n \n

\n \n \n

\n
\n
'; + return '\n
\n \n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + '\n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + '\n
\n
\n
\n
\n \n \n

\n \n \n

\n \n

\n \n \n \n \n

\n \n \n

\n
\n
'; }; /***/ }, /* 6 */ /***/ function(module, exports) { - "use strict"; + 'use strict'; Object.defineProperty(exports, "__esModule", { value: true @@ -906,7 +939,7 @@ }; function _template() { - return "\n
\n
\n
\n \u042D\u0422\u0410\u041F " + this.stage_num + "\n
\n
\n " + this.stage_status + "\n
\n
\n
\n\n
\n " + this.stage.name + "\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n " + this.stage.result + "\n
\n \u0426\u0435\u043D\u0430\n
\n " + this.stage.cost + " \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E " + this.stage.term + "\n
\n\n
"; + return '\n
\n
\n
\n \u042D\u0422\u0410\u041F ' + this.stage_num + '\n
\n
\n ' + (this.stage_status ? this.stage_status : 'не согласован') + '\n
\n
\n
\n\n
\n ' + this.stage.name + '\n
\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
\n ' + this.stage.result + '\n
\n \u0426\u0435\u043D\u0430\n
\n ' + this.stage.cost + ' \u20BD\n
\n \u0421\u0440\u043E\u043A\n
\n \u0434\u043E ' + this.stage.term + '\n
\n
\n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
\n\n
'; }; /***/ }, @@ -1032,11 +1065,83 @@ }; function _template() { - return "
\n
  • \n " + this.text + "\n
  • \n
    \n
    \n"; + return "\n
    \n
  • \n " + this.text + "\n
  • \n
    \n
    \n"; }; /***/ }, /* 14 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return '\n\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\n ' + this.order.project.name + '\n\n\n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430\n ' + (this.order.secure ? 'Выбрана' : 'Не выбрана') + '\n\n\n \u0422\u0438\u043F \u0437\u0434\u0430\u043D\u0438\u044F\n ' + (this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан') + '\n\n \u041A\u043B\u0430\u0441\u0441\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F \u0437\u0434\u0430\u043D\u0438\u044F\n ' + (this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name : 'не задана') + '\n'; + }; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n
    \n
    \n
    \n \u042D\u0422\u0410\u041F " + this.stage_num + "\n
    \n
    \n " + this.stage_status + "\n
    \n
    \n
    \n\n
    \n " + this.stage.name + "\n
    \n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
    \n " + this.stage.result + "\n
    \n \u0426\u0435\u043D\u0430\n
    \n " + this.stage.cost + " \u20BD\n
    \n \u0421\u0440\u043E\u043A\n
    \n \u0434\u043E " + this.stage.term + "\n
    \n
    \n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
    \n\n
    "; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n\n
    ;"; + }; + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n
    \n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    "; + }; + +/***/ }, +/* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1239,15 +1344,14 @@ /** * "Согласовать" Этапы (Исполнителем) */ - console.log("secureOrder = ", secureOrder); - console.log("set new status =", secureOrder ? 'agreed' : 'in_process'); + // console.log("secureOrder = ", secureOrder); + // console.log("set new status =", secureOrder ? 'agreed': 'in_process'); return Promise.resolve($.ajax({ url: '/api/stages/' + this.stageId + '/', type: 'PATCH', beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: secureOrder ? 'agreed' : 'in_process' }, @@ -1269,7 +1373,6 @@ beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: 'not_agreed' }, dataType: 'json' }).done(function (json) { @@ -1415,7 +1518,6 @@ beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: 'closed' }, dataType: 'json' }).done(function (json) { @@ -1436,7 +1538,7 @@ exports.StageInWork = StageInWork; /***/ }, -/* 15 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1502,7 +1604,7 @@ className = ''; } if (v.is_system) { - senderName = 'Системное'; + senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName; className = 'systemChat'; } var message = $(self.messageTemplate({ className: className, senderName: senderName, message: v })); @@ -1519,7 +1621,7 @@ exports.MessagesController = MessagesController; /***/ }, -/* 16 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1606,7 +1708,7 @@ exports.DocumentsController = DocumentsController; /***/ }, -/* 17 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1614,14 +1716,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrders = undefined; + exports.bindCtrlEnterSendMessage = exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrderInfo = exports.bindOrders = undefined; var _utils = __webpack_require__(3); - var _messageCounters = __webpack_require__(18); + var _messageCounters = __webpack_require__(22); var _loaders = __webpack_require__(4); + var _notes = __webpack_require__(23); + function dialog(message, yesCallback, notCallback) { $("#dialog_delete .modal-title").html(message); $("#dialog_delete").modal('show'); @@ -1641,6 +1745,7 @@ $('.order-block').on('click', function (event) { event.preventDefault(); var $this = $(this); + $("#chat-order-add").show(); (0, _messageCounters.onClickCardWithCount)($this); $('.order-block').each(function (i, v) { $(v).removeClass('orAct'); @@ -1662,14 +1767,75 @@ $("#chat-order-add #recipentId").val(recipentId); window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder); + + $.ajax({ + url: '/api/note/', + type: 'GET', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + data: { + 'order': orderId + }, + dataType: 'json', + success: function success(json) { + var noteHtmlInbox = ''; + var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); + // console.log("note json -->", json); + $.each(json.results, function (i, v) { + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); + }); + $(".order-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); + } + }); }); $('.order-block .dimovChat').on('click', function (event) { event.preventDefault(); event.stopPropagation(); + // .toggle(); + var $arrow = $(event.target); + var $info = $arrow.siblings('.hideOBB'); + if ($info.hasClass("open")) { + $arrow.css('transform', 'rotate(0deg)'); + $info.hide(); + } else { + $arrow.css('transform', 'rotate(90deg)'); + $info.show(); + } + $info.toggleClass("open"); // console.log('click on tr'); }); } + function bindOrderInfo() { + $(".messageBlock").on('click', '.full-order-info', function (e) { + e.preventDefault(); + e.stopPropagation(); + var orderId = $(this).closest('.orderBlock').data('id'); + if (!orderId) { + orderId = $(this).closest('.trashedOrderBlock').data('id'); + } + $.ajax({ + url: '/api/orders/' + orderId + '/', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + dataType: 'json', + success: function success(data) { + var outTable_tmpl = (0, _loaders.loadTemplate)('order_info_tmpl'); + var outTable = outTable_tmpl({ order: data }); + + $("#order-info table").html(outTable); + $("#order-info").modal('show'); + }, + error: function error(e, jqxhr) { + console.log(e); + } + }); + }); + } + function bindTeams() { $('.team-block').on('click', function () { (0, _messageCounters.onClickCardWithCount)($(this)); @@ -1759,13 +1925,14 @@ data: { 'team': teamId }, dataType: 'json', success: function success(json) { - console.log(json.results); + // console.log(json.results); var noteHtmlInbox = ''; var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({ text: v.text }); + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); }); $(".team-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); } }); }); @@ -1786,7 +1953,7 @@ data: formData, dataType: 'json', success: function success(json) { - console.log(json); + // console.log(json); $("#arbitration-add").modal('hide'); $.jGrowl("Обращение в арбитраж добавлено", { life: 4000 @@ -1805,7 +1972,7 @@ * Биндит обработчики на Закладки */ $('a[data-toggle="tab"]').unbind().on('show.bs.tab', function (e) { - console.log("TAB!"); + // console.log("TAB!"); var activeTab = $(this).attr('href').substring(1); var liveHash = URI(location.href).hash(); @@ -1835,7 +2002,7 @@ case 'tab3': setTimeout(function () { - console.log("on active TAB team"); + // console.log("on active TAB team"); if (liveHash.indexOf("#teamorder") != -1) { var teamHashId = liveHash.replace("#teamorder", ""); $("#teamOrderBlock" + teamHashId).trigger('click'); @@ -1970,7 +2137,7 @@ dataType: 'json', success: function success(json) { - console.log(json); + // console.log(json); $.each(json.results, function (i, v) { docList.innerHTML += '
  • ' + v.file + '
  • '; @@ -1994,13 +2161,14 @@ }, dataType: 'json', success: function success(json) { - console.log(json.results); + // console.log(json.results); var noteHtmlInbox = ''; var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({ text: v.text }); + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); }); $(".contractor-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); } }); }); @@ -2040,16 +2208,29 @@ }); } + function bindCtrlEnterSendMessage() { + $('textarea.js-chat').keydown(function (e) { + var $target = $(e.target); + if (e.ctrlKey && e.keyCode == 13) { + // console.log("Send button -->", $target.parent().find('.btn-send')) + var $btn_send = $target.parent().find('.btn-send'); + $btn_send.trigger('click'); + } + }); + } + exports.bindOrders = bindOrders; + exports.bindOrderInfo = bindOrderInfo; exports.bindArbitrationSend = bindArbitrationSend; exports.bindOnTabs = bindOnTabs; exports.bindUserContacts = bindUserContacts; exports.bindGetUserMessages = bindGetUserMessages; exports.bindTeams = bindTeams; exports.bindDeleteContact = bindDeleteContact; + exports.bindCtrlEnterSendMessage = bindCtrlEnterSendMessage; /***/ }, -/* 18 */ +/* 22 */ /***/ function(module, exports) { 'use strict'; @@ -2106,7 +2287,7 @@ var $container = void 0; if (message.answer_type == "add_message_contact") { $container = $('.contact-count-' + message.sender_id); - } else if (message.answer_type == "add_message_order") { + } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages") { $container = $('#count-order-' + message.order_id); } else if (message.answer_type == "add_message_team") { $container = $('#count-team-' + message.team_id); @@ -2129,7 +2310,137 @@ exports.onClickCardWithCount = onClickCardWithCount; /***/ }, -/* 19 */ +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bindRemoveNotes = exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined; + + var _loaders = __webpack_require__(4); + + var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); + + function bindContractorNotes() { + $('#add-note-contractor').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-contractor-note").serialize(), + dataType: 'json', + success: function success(json) { + // console.log(json); + $("#add-form-contractor-note #chat2").val(""); + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".contractor-notes-block"); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindOrderNotes() { + /** + * Create new Note + */ + $('#add-note-button').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-order-note").serialize(), + dataType: 'json', + success: function success(json) { + // $("
  • " + json.text + "
  • ").appendTo(".order-notes-block"); + // console.log('note json = ', json); + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".order-notes-block"); + $("#add-form-order-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindTeamNotes() { + $('#add-team-note-button').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-team-note").serialize(), + dataType: 'json', + success: function success(json) { + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".team-notes-block"); + $("#add-form-team-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindRemoveNotes() { + // console.log('num notes = ', $('.remove-note').length); + $('.remove-note').unbind().on('click', function (e) { + var $note = $(e.target).parent(); + var noteId = $(e.target).data('id'); + // console.log('click remove note'); + $.ajax({ + url: '/api/note/' + noteId, + type: 'DELETE', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + dataType: 'json', + success: function success(json) { + $note.remove(); + // console.log('Note deleted!'); + + // let li = note_tmpl({text: json.text, note_id: json.id}); + // $(li).appendTo(".team-notes-block"); + // $("#add-form-team-note #chat2").val(""); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + exports.bindContractorNotes = bindContractorNotes; + exports.bindOrderNotes = bindOrderNotes; + exports.bindTeamNotes = bindTeamNotes; + exports.bindRemoveNotes = bindRemoveNotes; + +/***/ }, +/* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -2141,6 +2452,10 @@ var _utils = __webpack_require__(3); + var _loaders = __webpack_require__(4); + + var document_before_upload_tmpl = (0, _loaders.loadTemplate)('document_before_upload_tmpl'); + function uploadDocumentsContactInit() { $("#upload-document-contact").bind('fileuploadsubmit', function (e, data) { data.formData = { @@ -2153,15 +2468,18 @@ url: '/chat/create/', crossDomain: false, beforeSend: function beforeSend(xhr, settings) { - console.log("Upload form data -->", this.formData); + // console.log("Upload form data -->", this.formData); $('#progress .progress-bar').css('width', '0%'); xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); }, dataType: 'json', done: function done(e, data) { $.each(data.result.files, function (index, file) { - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send-contact"); + // var htmlImg = '' + + // '
    '; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send-contact"); }); }, fail: function fail(e) { @@ -2181,7 +2499,7 @@ recipent: $("#chat-order-add #recipentId").val(), order: $("#chat-order-add #orderId").val() }; - console.log(data.formData); + // console.log(data.formData); }); $('#upload-document-order').fileupload({ @@ -2194,8 +2512,10 @@ dataType: 'json', done: function done(e, data) { $.each(data.result.files, function (index, file) { - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send-order"); + // var htmlImg = ''; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send-order"); }); }, fail: function fail(e) { @@ -2216,7 +2536,7 @@ order: $("#team-chat-form #orderTeamId").val(), team: $("#team-chat-form #teamId").val() }; - console.log(data.formData); + // console.log(data.formData); }); $('#upload-document-team').fileupload({ @@ -2232,8 +2552,10 @@ var currentValue = $("#documentSendIds").val(); currentValue += file.id + ';'; $("#documentSendIds").val(currentValue); - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send"); + // var htmlImg = ''; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send"); }); }, fail: function fail(e) { @@ -2261,7 +2583,7 @@ dataType: 'json', success: function success(json) { _this.parent().remove(); - console.log(json); + // console.log(json); }, error: function error(e, jqxhr) { console.log(jqxhr); @@ -2276,99 +2598,7 @@ exports.bindRemoveDocuments = bindRemoveDocuments; /***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined; - - var _loaders = __webpack_require__(4); - - var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); - - function bindContractorNotes() { - $('#add-note-contractor').on('click', function (e) { - e.preventDefault(); - $.ajax({ - url: '/api/note/', - type: 'POST', - beforeSend: function beforeSend(xhr) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); - }, - data: $("#add-form-contractor-note").serialize(), - dataType: 'json', - success: function success(json) { - console.log(json); - $("#add-form-contractor-note #chat2").val(""); - var li = note_tmpl({ text: json.text }); - $(li).appendTo(".contractor-notes-block"); - }, - error: function error(e) { - console.log('error'); - console.log(e); - } - }); - }); - } - - function bindOrderNotes() { - $('#add-note-button').on('click', function (e) { - e.preventDefault(); - $.ajax({ - url: '/api/note/', - type: 'POST', - beforeSend: function beforeSend(xhr) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); - }, - data: $("#add-form-order-note").serialize(), - dataType: 'json', - success: function success(json) { - // $("
  • " + json.text + "
  • ").appendTo(".order-notes-block"); - var li = note_tmpl({ text: json.text }); - $(li).appendTo(".order-notes-block"); - $("#add-form-order-note #chat2").val(""); - }, - error: function error(e) { - console.log('error'); - console.log(e); - } - }); - }); - } - - function bindTeamNotes() { - $('#add-team-note-button').on('click', function (e) { - e.preventDefault(); - $.ajax({ - url: '/api/note/', - type: 'POST', - beforeSend: function beforeSend(xhr) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); - }, - data: $("#add-form-team-note").serialize(), - dataType: 'json', - success: function success(json) { - $("
  • " + json.text + "
  • ").appendTo(".team-notes-block"); - $("#add-form-team-note #chat2").val(""); - }, - error: function error(e) { - console.log('error'); - console.log(e); - } - }); - }); - } - - exports.bindContractorNotes = bindContractorNotes; - exports.bindOrderNotes = bindOrderNotes; - exports.bindTeamNotes = bindTeamNotes; - -/***/ }, -/* 21 */ +/* 25 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -2386,7 +2616,7 @@ $("a[href='#tab2']").trigger('click'); // console.log("click on ", "#orderBlock" + currentHash.replace("#order", "")); var obj_id = currentHash.replace("#order", ""); - console.log("obj_id = ", obj_id); + // console.log("obj_id = ", obj_id); if (obj_id) { $("#orderBlock" + currentHash.replace("#order", "")).trigger('click'); } else { @@ -2404,7 +2634,7 @@ exports.restoreTabFromHash = restoreTabFromHash; /***/ }, -/* 22 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -2437,10 +2667,10 @@ } }); - // Нажимаем на заказ в архмвных заказах + // Нажимаем на заказ в архивных заказах $(".messageBlock").on('click', '.trashedOrderBlock', function () { var $this = $(this); - $("#chat-order-add").css("display", "none"); + $("#chat-order-add").hide(); $('.order-block, .trashedOrderBlock').each(function () { $(this).removeClass('orAct'); }); @@ -2458,6 +2688,9 @@ location.hash = '#order' + orderId; // console.log(orderId); window.chatController.create(orderId); + // hide all buttons + // console.log('chat-buttons -->', $(".chat-button")); + // $(".chat-button").hide(); // $.ajax({ // url: '/api/message', // type: 'GET', @@ -2496,7 +2729,7 @@ exports.bindArchiveProjects = bindArchiveProjects; /***/ }, -/* 23 */ +/* 27 */ /***/ function(module, exports) { 'use strict'; @@ -2527,7 +2760,7 @@ documentLinks += 'Приложенный файл. скачать:
    ' + $(this).text() + '
    '; documentAttachFiles += '
  • ' + '' + $(this).text() + '' + '
  • '; }); - console.log("sendLinkIds = ", sendLinkIds); + // console.log("sendLinkIds = ", sendLinkIds); socket.send_message({ "format_type": "add_message_contact", "data": { @@ -2643,7 +2876,7 @@ exports.chatTeamsInit = chatTeamsInit; /***/ }, -/* 24 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -2655,7 +2888,7 @@ var _loaders = __webpack_require__(4); - var _messageCounters = __webpack_require__(18); + var _messageCounters = __webpack_require__(22); function getUserPlace() { /** @@ -2682,8 +2915,8 @@ */ // message.answer_type=place.tab var eq = ['add_message_contact=user', 'add_message_order=order', 'add_message_team=myteam', 'approve_stages=order']; - console.log([message.answer_type, place.tab].join('=')); - console.log(message.order_id, '==', place.id, message.order_id == place.id); + // console.log([message.answer_type, place.tab].join('=')); + // console.log(message.order_id, '==', place.id, message.order_id == place.id); if (eq.indexOf([message.answer_type, place.tab].join('=')) != -1 && (message.order_id == place.id || message.recipent_id == place.id || message.sender_id == place.id || message.team_id == place.id)) { return true; @@ -2724,7 +2957,7 @@ classMessage = ''; } if (data.is_system) { - senderName = 'Системное'; + senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName; classMessage = 'systemChat'; } @@ -2738,7 +2971,12 @@ $documents_container.append(data.docs_attach); - if (data.answer_type == 'approve_stages') { + if (data.answer_type == 'approve_stages' && data.sender_id != userId) { + if (data.msg.indexOf('перевел заказ') != -1) { + var secure = false; + if (data.msg.indexOf('безопасную сделку') != -1) secure = true; + window.chatController.statesController._changeOrderProtect(secure); + } window.chatController.statesController.redraw(); } } else { @@ -2758,7 +2996,6 @@ }; socket.send_stages_approve = function (messageData) { - // TODO: Пометить сообщения как "системные" socket.send(JSON.stringify(messageData)); }; }); diff --git a/assets/js/build/chat_customer_oop.js b/assets/js/build/chat_customer_oop.js index 4d49282..d4d5517 100644 --- a/assets/js/build/chat_customer_oop.js +++ b/assets/js/build/chat_customer_oop.js @@ -46,17 +46,21 @@ 'use strict'; - var _ChatCustomerPageController = __webpack_require__(25); + var _ChatCustomerPageController = __webpack_require__(29); - var _BINDS = __webpack_require__(17); + var _BINDS = __webpack_require__(21); - var _parts = __webpack_require__(21); + var _parts = __webpack_require__(25); - var _chats = __webpack_require__(23); + var _chats = __webpack_require__(27); - var _wsChatConnect = __webpack_require__(24); + var _documents = __webpack_require__(24); - var _archiveProjects = __webpack_require__(22); + var _wsChatConnect = __webpack_require__(28); + + var _notes = __webpack_require__(23); + + var _archiveProjects = __webpack_require__(26); window.connect = _wsChatConnect.connect; window.socket = undefined; @@ -76,16 +80,26 @@ window.chatController = new _ChatCustomerPageController.ChatPageController(); (0, _BINDS.bindOrders)(); + (0, _BINDS.bindOrderInfo)(); (0, _BINDS.bindOnTabs)(); (0, _parts.restoreTabFromHash)(); (0, _BINDS.bindUserContacts)(); (0, _BINDS.bindGetUserMessages)(); (0, _archiveProjects.bindArchiveProjects)(); (0, _BINDS.bindDeleteContact)(); + (0, _BINDS.bindCtrlEnterSendMessage)(); //Chats (0, _chats.chatContactsInit)(); (0, _chats.chatOrdersInit)(); + + //Documents + (0, _documents.uploadDocumentsContactInit)(); + (0, _documents.uploadDocumentsOrderInit)(); + + //Notes + (0, _notes.bindContractorNotes)(); + (0, _notes.bindOrderNotes)(); }); /***/ }, @@ -181,6 +195,22 @@ var _note_tmpl2 = _interopRequireDefault(_note_tmpl); + var _order_info_tmpl = __webpack_require__(14); + + var _order_info_tmpl2 = _interopRequireDefault(_order_info_tmpl); + + var _stage_contractor_approve_tmpl = __webpack_require__(15); + + var _stage_contractor_approve_tmpl2 = _interopRequireDefault(_stage_contractor_approve_tmpl); + + var _document_before_upload_tmpl = __webpack_require__(16); + + var _document_before_upload_tmpl2 = _interopRequireDefault(_document_before_upload_tmpl); + + var _switch_to_protected_tmpl = __webpack_require__(17); + + var _switch_to_protected_tmpl2 = _interopRequireDefault(_switch_to_protected_tmpl); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function loadTemplate(template_name) { @@ -193,7 +223,11 @@ bntCompleteStage_tmpl: _bntCompleteStage_tmpl2.default, btnSendReview_tmpl: _btnSendReview_tmpl2.default, document_attach_file_tmpl: _document_attach_file_tmpl2.default, - note_tmpl: _note_tmpl2.default + note_tmpl: _note_tmpl2.default, + order_info_tmpl: _order_info_tmpl2.default, + stage_contractor_approve_tmpl: _stage_contractor_approve_tmpl2.default, + document_before_upload_tmpl: _document_before_upload_tmpl2.default, + switch_to_protected_tmpl: _switch_to_protected_tmpl2.default }; if (!templates[template_name]) throw new Error('Template ' + template_name + ' does not exist'); @@ -217,14 +251,14 @@ }; function _template() { - return '\n
    \n

    \u042D\u0422\u0410\u041F ' + this.stage_num + '

    \n
    \n \n \n

    \n \n \n

    \n \n

    \n \n \n \n \n

    \n \n \n

    \n
    \n
    '; + return '\n
    \n \n
    \n
    \n \u042D\u0422\u0410\u041F ' + this.stage_num + '\n
    \n
    \n ' + (this.stage_status ? this.stage_status : 'не согласован') + '\n
    \n
    \n
    \n
    \n \n \n

    \n \n \n

    \n \n

    \n \n \n \n \n

    \n \n \n

    \n
    \n
    '; }; /***/ }, /* 6 */ /***/ function(module, exports) { - "use strict"; + 'use strict'; Object.defineProperty(exports, "__esModule", { value: true @@ -235,7 +269,7 @@ }; function _template() { - return "\n
    \n
    \n
    \n \u042D\u0422\u0410\u041F " + this.stage_num + "\n
    \n
    \n " + this.stage_status + "\n
    \n
    \n
    \n\n
    \n " + this.stage.name + "\n
    \n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
    \n " + this.stage.result + "\n
    \n \u0426\u0435\u043D\u0430\n
    \n " + this.stage.cost + " \u20BD\n
    \n \u0421\u0440\u043E\u043A\n
    \n \u0434\u043E " + this.stage.term + "\n
    \n\n
    "; + return '\n
    \n
    \n
    \n \u042D\u0422\u0410\u041F ' + this.stage_num + '\n
    \n
    \n ' + (this.stage_status ? this.stage_status : 'не согласован') + '\n
    \n
    \n
    \n\n
    \n ' + this.stage.name + '\n
    \n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
    \n ' + this.stage.result + '\n
    \n \u0426\u0435\u043D\u0430\n
    \n ' + this.stage.cost + ' \u20BD\n
    \n \u0421\u0440\u043E\u043A\n
    \n \u0434\u043E ' + this.stage.term + '\n
    \n
    \n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
    \n\n
    '; }; /***/ }, @@ -361,11 +395,83 @@ }; function _template() { - return "
    \n
  • \n " + this.text + "\n
  • \n
    \n
    \n"; + return "\n
    \n
  • \n " + this.text + "\n
  • \n
    \n
    \n"; }; /***/ }, /* 14 */ +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return '\n\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\n ' + this.order.project.name + '\n\n\n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430\n ' + (this.order.secure ? 'Выбрана' : 'Не выбрана') + '\n\n\n \u0422\u0438\u043F \u0437\u0434\u0430\u043D\u0438\u044F\n ' + (this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан') + '\n\n \u041A\u043B\u0430\u0441\u0441\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F \u0437\u0434\u0430\u043D\u0438\u044F\n ' + (this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name : 'не задана') + '\n'; + }; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n
    \n
    \n
    \n \u042D\u0422\u0410\u041F " + this.stage_num + "\n
    \n
    \n " + this.stage_status + "\n
    \n
    \n
    \n\n
    \n " + this.stage.name + "\n
    \n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u044D\u0442\u0430\u043F\u0430\n
    \n " + this.stage.result + "\n
    \n \u0426\u0435\u043D\u0430\n
    \n " + this.stage.cost + " \u20BD\n
    \n \u0421\u0440\u043E\u043A\n
    \n \u0434\u043E " + this.stage.term + "\n
    \n
    \n \u0421\u0440\u043E\u043A \u044D\u0442\u0430\u043F\u0430 \u0440\u0430\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0440\u0435\u0434\u0441\u0442\u0432\n
    \n\n
    "; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n\n
    ;"; + }; + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (ctx) { + return _template.call(ctx, ctx); + }; + + function _template() { + return "\n
    \n \u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0441\u0434\u0435\u043B\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    "; + }; + +/***/ }, +/* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -568,15 +674,14 @@ /** * "Согласовать" Этапы (Исполнителем) */ - console.log("secureOrder = ", secureOrder); - console.log("set new status =", secureOrder ? 'agreed' : 'in_process'); + // console.log("secureOrder = ", secureOrder); + // console.log("set new status =", secureOrder ? 'agreed': 'in_process'); return Promise.resolve($.ajax({ url: '/api/stages/' + this.stageId + '/', type: 'PATCH', beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: secureOrder ? 'agreed' : 'in_process' }, @@ -598,7 +703,6 @@ beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: 'not_agreed' }, dataType: 'json' }).done(function (json) { @@ -744,7 +848,6 @@ beforeSend: function beforeSend(xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); }, - //TODO: слать только изменения data: { status: 'closed' }, dataType: 'json' }).done(function (json) { @@ -765,7 +868,7 @@ exports.StageInWork = StageInWork; /***/ }, -/* 15 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -831,7 +934,7 @@ className = ''; } if (v.is_system) { - senderName = 'Системное'; + senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName; className = 'systemChat'; } var message = $(self.messageTemplate({ className: className, senderName: senderName, message: v })); @@ -848,8 +951,7 @@ exports.MessagesController = MessagesController; /***/ }, -/* 16 */, -/* 17 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -857,14 +959,103 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrders = undefined; + exports.DocumentsController = undefined; + + 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 _utils = __webpack_require__(3); - var _messageCounters = __webpack_require__(18); + var _loaders = __webpack_require__(4); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var DocumentsController = function () { + function DocumentsController(orderId) { + _classCallCheck(this, DocumentsController); + + console.log('Create MessagesController'); + var self = this; + this.orderId = orderId; + this.$container = $('#documentOrderSpace'); + this.$container.html(""); + + this.messageTemplate = (0, _loaders.loadTemplate)('document_attach_file_tmpl'); + this.dataPromise = this.getMessagesData(); + this.dataPromise.then(self._onLoadData.bind(self)); + } + + _createClass(DocumentsController, [{ + key: 'getMessagesData', + value: function getMessagesData() { + var self = this; + return Promise.resolve($.ajax({ + url: '/api/documents', + type: 'GET', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + data: { + 'order': self.orderId, + 'is_delete': false, + 'is_send': true + }, + dataType: 'json', + // success: function (json) { + // + // }, + error: function error(e) { + console.log(e); + } + })); + } + }, { + key: 'addDocument', + value: function addDocument(json) {} + }, { + key: '_onLoadData', + value: function _onLoadData(json) { + var self = this; + // console.log('mesages json = ', json); + // console.log('$inbox = ', this.$inbox); + // console.log("messages render start"); + this.$container.html(""); + $.each(json.results, function (i, v) { + var document = $(self.messageTemplate({ + href: '/chat/download/\' + ' + v.file, + text: v.file, + document_id: v.id + })); + self.$container.append(document); + }); + // console.log("messages render complete"); + // self.$inbox.scrollTop(self.$inbox.prop("scrollHeight")); + } + }]); + + return DocumentsController; + }(); + + exports.DocumentsController = DocumentsController; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bindCtrlEnterSendMessage = exports.bindDeleteContact = exports.bindTeams = exports.bindGetUserMessages = exports.bindUserContacts = exports.bindOnTabs = exports.bindArbitrationSend = exports.bindOrderInfo = exports.bindOrders = undefined; + + var _utils = __webpack_require__(3); + + var _messageCounters = __webpack_require__(22); var _loaders = __webpack_require__(4); + var _notes = __webpack_require__(23); + function dialog(message, yesCallback, notCallback) { $("#dialog_delete .modal-title").html(message); $("#dialog_delete").modal('show'); @@ -884,6 +1075,7 @@ $('.order-block').on('click', function (event) { event.preventDefault(); var $this = $(this); + $("#chat-order-add").show(); (0, _messageCounters.onClickCardWithCount)($this); $('.order-block').each(function (i, v) { $(v).removeClass('orAct'); @@ -905,14 +1097,75 @@ $("#chat-order-add #recipentId").val(recipentId); window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder); + + $.ajax({ + url: '/api/note/', + type: 'GET', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + data: { + 'order': orderId + }, + dataType: 'json', + success: function success(json) { + var noteHtmlInbox = ''; + var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); + // console.log("note json -->", json); + $.each(json.results, function (i, v) { + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); + }); + $(".order-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); + } + }); }); $('.order-block .dimovChat').on('click', function (event) { event.preventDefault(); event.stopPropagation(); + // .toggle(); + var $arrow = $(event.target); + var $info = $arrow.siblings('.hideOBB'); + if ($info.hasClass("open")) { + $arrow.css('transform', 'rotate(0deg)'); + $info.hide(); + } else { + $arrow.css('transform', 'rotate(90deg)'); + $info.show(); + } + $info.toggleClass("open"); // console.log('click on tr'); }); } + function bindOrderInfo() { + $(".messageBlock").on('click', '.full-order-info', function (e) { + e.preventDefault(); + e.stopPropagation(); + var orderId = $(this).closest('.orderBlock').data('id'); + if (!orderId) { + orderId = $(this).closest('.trashedOrderBlock').data('id'); + } + $.ajax({ + url: '/api/orders/' + orderId + '/', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + dataType: 'json', + success: function success(data) { + var outTable_tmpl = (0, _loaders.loadTemplate)('order_info_tmpl'); + var outTable = outTable_tmpl({ order: data }); + + $("#order-info table").html(outTable); + $("#order-info").modal('show'); + }, + error: function error(e, jqxhr) { + console.log(e); + } + }); + }); + } + function bindTeams() { $('.team-block').on('click', function () { (0, _messageCounters.onClickCardWithCount)($(this)); @@ -1002,13 +1255,14 @@ data: { 'team': teamId }, dataType: 'json', success: function success(json) { - console.log(json.results); + // console.log(json.results); var noteHtmlInbox = ''; var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({ text: v.text }); + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); }); $(".team-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); } }); }); @@ -1029,7 +1283,7 @@ data: formData, dataType: 'json', success: function success(json) { - console.log(json); + // console.log(json); $("#arbitration-add").modal('hide'); $.jGrowl("Обращение в арбитраж добавлено", { life: 4000 @@ -1048,7 +1302,7 @@ * Биндит обработчики на Закладки */ $('a[data-toggle="tab"]').unbind().on('show.bs.tab', function (e) { - console.log("TAB!"); + // console.log("TAB!"); var activeTab = $(this).attr('href').substring(1); var liveHash = URI(location.href).hash(); @@ -1078,7 +1332,7 @@ case 'tab3': setTimeout(function () { - console.log("on active TAB team"); + // console.log("on active TAB team"); if (liveHash.indexOf("#teamorder") != -1) { var teamHashId = liveHash.replace("#teamorder", ""); $("#teamOrderBlock" + teamHashId).trigger('click'); @@ -1213,7 +1467,7 @@ dataType: 'json', success: function success(json) { - console.log(json); + // console.log(json); $.each(json.results, function (i, v) { docList.innerHTML += '
  • ' + v.file + '
  • '; @@ -1237,13 +1491,14 @@ }, dataType: 'json', success: function success(json) { - console.log(json.results); + // console.log(json.results); var noteHtmlInbox = ''; var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({ text: v.text }); + noteHtmlInbox += note_tmpl({ text: v.text, note_id: v.id }); }); $(".contractor-notes-block").html(noteHtmlInbox); + (0, _notes.bindRemoveNotes)(); } }); }); @@ -1283,16 +1538,29 @@ }); } + function bindCtrlEnterSendMessage() { + $('textarea.js-chat').keydown(function (e) { + var $target = $(e.target); + if (e.ctrlKey && e.keyCode == 13) { + // console.log("Send button -->", $target.parent().find('.btn-send')) + var $btn_send = $target.parent().find('.btn-send'); + $btn_send.trigger('click'); + } + }); + } + exports.bindOrders = bindOrders; + exports.bindOrderInfo = bindOrderInfo; exports.bindArbitrationSend = bindArbitrationSend; exports.bindOnTabs = bindOnTabs; exports.bindUserContacts = bindUserContacts; exports.bindGetUserMessages = bindGetUserMessages; exports.bindTeams = bindTeams; exports.bindDeleteContact = bindDeleteContact; + exports.bindCtrlEnterSendMessage = bindCtrlEnterSendMessage; /***/ }, -/* 18 */ +/* 22 */ /***/ function(module, exports) { 'use strict'; @@ -1349,7 +1617,7 @@ var $container = void 0; if (message.answer_type == "add_message_contact") { $container = $('.contact-count-' + message.sender_id); - } else if (message.answer_type == "add_message_order") { + } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages") { $container = $('#count-order-' + message.order_id); } else if (message.answer_type == "add_message_team") { $container = $('#count-team-' + message.team_id); @@ -1372,9 +1640,295 @@ exports.onClickCardWithCount = onClickCardWithCount; /***/ }, -/* 19 */, -/* 20 */, -/* 21 */ +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bindRemoveNotes = exports.bindTeamNotes = exports.bindOrderNotes = exports.bindContractorNotes = undefined; + + var _loaders = __webpack_require__(4); + + var note_tmpl = (0, _loaders.loadTemplate)('note_tmpl'); + + function bindContractorNotes() { + $('#add-note-contractor').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-contractor-note").serialize(), + dataType: 'json', + success: function success(json) { + // console.log(json); + $("#add-form-contractor-note #chat2").val(""); + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".contractor-notes-block"); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindOrderNotes() { + /** + * Create new Note + */ + $('#add-note-button').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-order-note").serialize(), + dataType: 'json', + success: function success(json) { + // $("
  • " + json.text + "
  • ").appendTo(".order-notes-block"); + // console.log('note json = ', json); + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".order-notes-block"); + $("#add-form-order-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindTeamNotes() { + $('#add-team-note-button').on('click', function (e) { + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + data: $("#add-form-team-note").serialize(), + dataType: 'json', + success: function success(json) { + var li = note_tmpl({ text: json.text, note_id: json.id }); + $(li).appendTo(".team-notes-block"); + $("#add-form-team-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + function bindRemoveNotes() { + // console.log('num notes = ', $('.remove-note').length); + $('.remove-note').unbind().on('click', function (e) { + var $note = $(e.target).parent(); + var noteId = $(e.target).data('id'); + // console.log('click remove note'); + $.ajax({ + url: '/api/note/' + noteId, + type: 'DELETE', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + }, + dataType: 'json', + success: function success(json) { + $note.remove(); + // console.log('Note deleted!'); + + // let li = note_tmpl({text: json.text, note_id: json.id}); + // $(li).appendTo(".team-notes-block"); + // $("#add-form-team-note #chat2").val(""); + }, + error: function error(e) { + console.log('error'); + console.log(e); + } + }); + }); + } + + exports.bindContractorNotes = bindContractorNotes; + exports.bindOrderNotes = bindOrderNotes; + exports.bindTeamNotes = bindTeamNotes; + exports.bindRemoveNotes = bindRemoveNotes; + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bindRemoveDocuments = exports.uploadDocumentsTeamInit = exports.uploadDocumentsOrderInit = exports.uploadDocumentsContactInit = undefined; + + var _utils = __webpack_require__(3); + + var _loaders = __webpack_require__(4); + + var document_before_upload_tmpl = (0, _loaders.loadTemplate)('document_before_upload_tmpl'); + + function uploadDocumentsContactInit() { + $("#upload-document-contact").bind('fileuploadsubmit', function (e, data) { + data.formData = { + sender: $("#contact-chat-form #senderContactId").val(), + recipent: $("#contact-chat-form #recipentContactId").val() + }; + }); + + $('#upload-document-contact').fileupload({ + url: '/chat/create/', + crossDomain: false, + beforeSend: function beforeSend(xhr, settings) { + // console.log("Upload form data -->", this.formData); + $('#progress .progress-bar').css('width', '0%'); + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + dataType: 'json', + done: function done(e, data) { + $.each(data.result.files, function (index, file) { + // var htmlImg = '' + + // '
    '; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send-contact"); + }); + }, + fail: function fail(e) { + console.log(e); + }, + progressall: function progressall(e, data) { + var progress = parseInt(data.loaded / data.total * 100, 10); + $('#progress .progress-bar').css('width', progress + '%'); + } + }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); + } + + function uploadDocumentsOrderInit() { + $("#upload-document-order").bind('fileuploadsubmit', function (e, data) { + data.formData = { + sender: $("#chat-order-add #senderId").val(), + recipent: $("#chat-order-add #recipentId").val(), + order: $("#chat-order-add #orderId").val() + }; + // console.log(data.formData); + }); + + $('#upload-document-order').fileupload({ + url: '/chat/create/', + crossDomain: false, + beforeSend: function beforeSend(xhr, settings) { + $('#progress .progress-bar').css('width', '0%'); + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + dataType: 'json', + done: function done(e, data) { + $.each(data.result.files, function (index, file) { + // var htmlImg = ''; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send-order"); + }); + }, + fail: function fail(e) { + console.log(e); + }, + progressall: function progressall(e, data) { + var progress = parseInt(data.loaded / data.total * 100, 10); + $('#progress .progress-bar').css('width', progress + '%'); + } + }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); + } + + function uploadDocumentsTeamInit() { + $("#upload-document-team").bind('fileuploadsubmit', function (e, data) { + data.formData = { + sender: $("#team-chat-form #senderTeamId").val(), + recipent: $("#team-chat-form #recipentTeamId").val(), + order: $("#team-chat-form #orderTeamId").val(), + team: $("#team-chat-form #teamId").val() + }; + // console.log(data.formData); + }); + + $('#upload-document-team').fileupload({ + url: '/chat/create/', + crossDomain: false, + beforeSend: function beforeSend(xhr, settings) { + $('#progress .progress-bar').css('width', '0%'); + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + dataType: 'json', + done: function done(e, data) { + $.each(data.result.files, function (index, file) { + var currentValue = $("#documentSendIds").val(); + currentValue += file.id + ';'; + $("#documentSendIds").val(currentValue); + // var htmlImg = ''; + var htmlImg = document_before_upload_tmpl({ file: file }); + $(htmlImg).appendTo("#document-send"); + }); + }, + fail: function fail(e) { + console.log(e); + }, + progressall: function progressall(e, data) { + var progress = parseInt(data.loaded / data.total * 100, 10); + $('#progress .progress-bar').css('width', progress + '%'); + } + }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); + } + + function bindRemoveDocuments() { + $('.tab-content').on('click', '.remove-document', function (e) { + e.preventDefault(); + var dataId = $(this).attr('data-id'); + var _this = $(this); + $.ajax({ + url: '/api/documents/' + dataId + '/', + type: 'PATCH', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + data: { is_delete: true }, + dataType: 'json', + success: function success(json) { + _this.parent().remove(); + // console.log(json); + }, + error: function error(e, jqxhr) { + console.log(jqxhr); + } + }); + }); + } + + exports.uploadDocumentsContactInit = uploadDocumentsContactInit; + exports.uploadDocumentsOrderInit = uploadDocumentsOrderInit; + exports.uploadDocumentsTeamInit = uploadDocumentsTeamInit; + exports.bindRemoveDocuments = bindRemoveDocuments; + +/***/ }, +/* 25 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -1392,7 +1946,7 @@ $("a[href='#tab2']").trigger('click'); // console.log("click on ", "#orderBlock" + currentHash.replace("#order", "")); var obj_id = currentHash.replace("#order", ""); - console.log("obj_id = ", obj_id); + // console.log("obj_id = ", obj_id); if (obj_id) { $("#orderBlock" + currentHash.replace("#order", "")).trigger('click'); } else { @@ -1410,7 +1964,7 @@ exports.restoreTabFromHash = restoreTabFromHash; /***/ }, -/* 22 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1443,10 +1997,10 @@ } }); - // Нажимаем на заказ в архмвных заказах + // Нажимаем на заказ в архивных заказах $(".messageBlock").on('click', '.trashedOrderBlock', function () { var $this = $(this); - $("#chat-order-add").css("display", "none"); + $("#chat-order-add").hide(); $('.order-block, .trashedOrderBlock').each(function () { $(this).removeClass('orAct'); }); @@ -1464,6 +2018,9 @@ location.hash = '#order' + orderId; // console.log(orderId); window.chatController.create(orderId); + // hide all buttons + // console.log('chat-buttons -->', $(".chat-button")); + // $(".chat-button").hide(); // $.ajax({ // url: '/api/message', // type: 'GET', @@ -1502,7 +2059,7 @@ exports.bindArchiveProjects = bindArchiveProjects; /***/ }, -/* 23 */ +/* 27 */ /***/ function(module, exports) { 'use strict'; @@ -1533,7 +2090,7 @@ documentLinks += 'Приложенный файл. скачать:
    ' + $(this).text() + '
    '; documentAttachFiles += '
  • ' + '' + $(this).text() + '' + '
  • '; }); - console.log("sendLinkIds = ", sendLinkIds); + // console.log("sendLinkIds = ", sendLinkIds); socket.send_message({ "format_type": "add_message_contact", "data": { @@ -1649,7 +2206,7 @@ exports.chatTeamsInit = chatTeamsInit; /***/ }, -/* 24 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1661,7 +2218,7 @@ var _loaders = __webpack_require__(4); - var _messageCounters = __webpack_require__(18); + var _messageCounters = __webpack_require__(22); function getUserPlace() { /** @@ -1688,8 +2245,8 @@ */ // message.answer_type=place.tab var eq = ['add_message_contact=user', 'add_message_order=order', 'add_message_team=myteam', 'approve_stages=order']; - console.log([message.answer_type, place.tab].join('=')); - console.log(message.order_id, '==', place.id, message.order_id == place.id); + // console.log([message.answer_type, place.tab].join('=')); + // console.log(message.order_id, '==', place.id, message.order_id == place.id); if (eq.indexOf([message.answer_type, place.tab].join('=')) != -1 && (message.order_id == place.id || message.recipent_id == place.id || message.sender_id == place.id || message.team_id == place.id)) { return true; @@ -1730,7 +2287,7 @@ classMessage = ''; } if (data.is_system) { - senderName = 'Системное'; + senderName = senderName == 'Вы' ? 'Системное от Вас' : '\u0421\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0435 \u043E\u0442 ' + senderName; classMessage = 'systemChat'; } @@ -1744,7 +2301,12 @@ $documents_container.append(data.docs_attach); - if (data.answer_type == 'approve_stages') { + if (data.answer_type == 'approve_stages' && data.sender_id != userId) { + if (data.msg.indexOf('перевел заказ') != -1) { + var secure = false; + if (data.msg.indexOf('безопасную сделку') != -1) secure = true; + window.chatController.statesController._changeOrderProtect(secure); + } window.chatController.statesController.redraw(); } } else { @@ -1764,7 +2326,6 @@ }; socket.send_stages_approve = function (messageData) { - // TODO: Пометить сообщения как "системные" socket.send(JSON.stringify(messageData)); }; }); @@ -1776,7 +2337,7 @@ exports.connect = connect; /***/ }, -/* 25 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1788,11 +2349,11 @@ 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 _StagesCustomerController = __webpack_require__(26); + var _StagesCustomerController = __webpack_require__(30); - var _MessagesControllers = __webpack_require__(15); + var _MessagesControllers = __webpack_require__(19); - var _messageCounters = __webpack_require__(18); + var _DocumentsControllers = __webpack_require__(20); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1804,15 +2365,17 @@ // console.log("NEW Chat CUSTOMER PageController"); this.statesController = undefined; this.messagesController = undefined; - // TODO: не забыть! - // recalculateMessages(); + this.documentsController = undefined; } _createClass(ChatPageController, [{ key: 'create', value: function create(orderId, projectId, recipentId, orderName, secureOrder) { - this.statesController = new _StagesCustomerController.StagesController(orderId, projectId, recipentId, orderName, secureOrder); + var kwargs = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : { archive: false }; + + this.statesController = new _StagesCustomerController.StagesController(orderId, projectId, recipentId, orderName, secureOrder, kwargs); this.messagesController = new _MessagesControllers.MessagesController(orderId); + this.documentsController = new _DocumentsControllers.DocumentsController(orderId); } }]); @@ -1822,7 +2385,7 @@ exports.ChatPageController = ChatPageController; /***/ }, -/* 26 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1838,7 +2401,7 @@ var _loaders = __webpack_require__(4); - var _Stages = __webpack_require__(14); + var _Stages = __webpack_require__(18); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1864,8 +2427,13 @@ }; + //Customer + //TODO: Вынесли общую логику в родительский класс + var StagesController = function () { function StagesController(orderId, projectId, recipentId, orderName, secureOrder) { + var kwargs = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; + _classCallCheck(this, StagesController); var self = this; @@ -1874,6 +2442,7 @@ this.projectId = projectId; this.recipentId = recipentId; this.secureOrder = secureOrder; + // this.is_archive_project this.data = {}; //JSON this.stages = []; this.stages_reserved = []; @@ -1888,6 +2457,8 @@ }; this.btnCompleteTmpl = (0, _loaders.loadTemplate)('bntCompleteStage_tmpl'); this.btnSendReviewTmpl = (0, _loaders.loadTemplate)('btnSendReview_tmpl'); + this.switch_to_protected_tmpl = (0, _loaders.loadTemplate)('switch_to_protected_tmpl'); + this.$orderStagesContainer = $('#order-stages'); this.$orderStagesContainer.html(''); this.$stagesCount = $('#countStage'); @@ -1906,6 +2477,9 @@ $reserve: $('#reserveSpace'), //2. Резервирование $works: $('#completeWork') //3. Выполненная работа }; + this.temp = { + approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html() + }; this.init(); } @@ -1941,6 +2515,39 @@ // $("#orderBlock" + this.orderId).trigger('click'); this.init(); } + }, { + key: 'reload', + value: function reload() { + /** + * Перезагружаем страницу Чата(при удалении заказа) + */ + window.location = '/chat/#order'; + location.reload(); + } + }, { + key: '_buildPage', + value: function _buildPage() { + console.log("Build Page!"); + // Restore html to default + this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text); + console.log("restore this -->", this.stages_elements.$approve.find('.js-select')); + this.stages_elements.$approve.find('.js-select').addClass("select"); + this.stages_elements.$reserve.find('.js-select').addClass("select"); + this.stages_elements.$works.find('.js-select').addClass("select"); + var $swith_to_protected = this.$orderStagesContainer.siblings('.switch'); + if ($swith_to_protected.length) $swith_to_protected.remove(); + + this.stages_elements.$reserve.hide(); + this.stages_elements.$works.hide(); + if (this.data.stages.length == 0) { + this.buildStartStage(); + } else { + var stageStatus = this.data.stages[0].status; + // console.log('stageStatus = ', stageStatus); + this.STAGE_STATUSES[stageStatus](); + } + this._bindEvents(); + } }, { key: 'buildStartStage', value: function buildStartStage() { @@ -1956,11 +2563,17 @@ this.$stagesCount.removeAttr('disabled'); this.$stagesCount.val(1); this.$stagesCount.trigger('change'); + this.stages_elements.$approve.find('.js-select').addClass('select'); // this.stages_elements.$approve.find('.js-help-text').show(); // this.stages_elements.$reserve.find('.js-help-text').show(); // this.stages_elements.$reserve.find('.stages-paid').hide(); // this.stages_elements.$works.find('.js-help-text').show(); // this.stages_elements.$works.find('#stagesWork').show(); + if (!this.secureOrder) { + // console.log("add switch to protect"); + this.$orderStagesContainer.after(this.switch_to_protected_tmpl()); + $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this)); + } } // Нет Этапов }, { @@ -1971,6 +2584,11 @@ this.buttons.btnApprove.show(); this.buttons.btnChange.hide(); this.buttons.btnToArchive.hide(); + if (!this.secureOrder) { + // console.log("add switch to protect"); + this.$orderStagesContainer.after(this.switch_to_protected_tmpl()); + $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this)); + } } // Статус "Не согласован" }, { @@ -1996,6 +2614,7 @@ this.$stagesCount.parent().hide(); this._renderStage('stage_approved_tmpl', true); this.stages_elements.$approve.find('.js-help-text').hide(); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.find('.js-help-text').show(); this.stages_elements.$reserve.show(); this.buttons.btnReserve.show(); @@ -2008,26 +2627,20 @@ value: function buildProcessStage() { console.log('Stage: in_process'); this.buildAgreedStage(); + // Block-Stage-1 + this.stages_elements.$approve.find('.js-select').removeClass('select'); + // Block-Stage-2 + this.stages_elements.$reserve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.find('.js-btnArbitration').hide(); + // Block-Stage-3 this.stages_elements.$works.show(); this._renderStageInWork('work_in_process_tmpl'); + if (this.secureOrder) {} else { + this.stages_elements.$reserve.hide(); + } } // Статус "В процессе"/"Завершен"/"Закрыт" - }, { - key: '_buildPage', - value: function _buildPage() { - // console.log("Build PAge"); - this.stages_elements.$reserve.hide(); - this.stages_elements.$works.hide(); - if (this.data.stages.length == 0) { - this.buildStartStage(); - } else { - var stageStatus = this.data.stages[0].status; - // console.log('stageStatus = ', stageStatus); - this.STAGE_STATUSES[stageStatus](); - } - this._bindEvents(); - } + }, { key: '_renderStage', value: function _renderStage(template_name) { @@ -2135,8 +2748,7 @@ var stage = new _Stages.StageInWork($container, { template_name: template_name, - data: stage_data, - note_text: 'Закройте этап или подробно опишите замечания в чате' + data: stage_data }); this.stages_work.push(stage); } @@ -2174,7 +2786,7 @@ if (_stage_data.status == 'closed') continue; var _stage = new _Stages.StageInWork($container, { - template_name: template_name, data: _stage_data + template_name: template_name, data: _stage_data, note_text: 'Закройте этап или подробно опишите замечания в чате' }); if (_stage_data.status == 'completed') { var $btn = $(this.btnCompleteTmpl({ stage: _stage_data, text: 'Закрыть этап' })); @@ -2205,6 +2817,11 @@ value: function _onLoadData(json) { this.data = json; this._buildPage(); + if (this.data.project.state == 'deleted') { + for (var key in this.buttons) { + this.buttons[key].hide(); + } + } } }, { key: '_changeNumStages', @@ -2336,7 +2953,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435'; + message.data.msg = '\u0423\u0441\u043B\u043E\u0432\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 "' + self.orderName + '" \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435'; console.log("Send-WS Отправить на согласование"); socket.send_stages_approve(message); //TODO: раскомментировать дурацкое окно @@ -2363,7 +2980,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u0417\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0442\u043E\u0437\u0432\u0430\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439'; + message.data.msg = '\u0417\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0442\u043E\u0437\u0432\u0430\u043D \u0434\u043B\u044F \u0432\u043D\u0435\u0441\u0435\u043D\u0438\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439'; console.log("Send-WS Внести изменения"); socket.send_stages_approve(message); }); @@ -2386,7 +3003,7 @@ dataType: 'json' }).done(function (json) { console.log('delete complete'); - window.location.href = window.location.href.replace(getHash(), ""); + // window.location.href = window.location.href.replace(getHash(), ""); var message = message_format; message.data.sender_id = userId; message.data.recipent_id = self.recipentId; @@ -2394,6 +3011,7 @@ message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0430 ' + self.orderName + ' \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u0432 \u0430\u0440\u0445\u0438\u0432'; console.log("Send-WS Отправить в архив"); socket.send_stages_approve(message); + self.reload(); }).fail(function (xhr, errorMsg, error) { console.log("delete fail, json -->", xhr); }); @@ -2508,7 +3126,7 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u0437\u0430\u043A\u0440\u044B\u043B \u044D\u0442\u0430\u043F ' + json.name; + message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u0437\u0430\u043A\u0440\u044B\u043B \u044D\u0442\u0430\u043F "' + json.name + '"'; console.log("Send-WS Оплата Этапа/Этапов"); socket.send_stages_approve(message); self.redraw(); @@ -2546,12 +3164,16 @@ message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 ' + self.orderName + ' \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D'; + message.data.msg = '\u041E\u0442\u0437\u044B\u0432 \u043D\u0430 \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D'; console.log("Send-WS Оставить отзыв"); + // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2) socket.send_stages_approve(message); - window.location = '/chat/#order'; - location.reload(); - // $("a[href='#tab2']").trigger('click'); + // console.log('json = ', json); + if (json.count_reviews == 1) { + self.redraw(); + } else { + self.reload(); + } }, error: function error(e) { console.log('error'); @@ -2560,6 +3182,34 @@ }); } // "Оставить отзыв" + }, { + key: '_onChangeToProtect', + value: function _onChangeToProtect(event) { + var self = this; + var checked = $(event.target).prop('checked'); + console.log('checked = ', checked); + $.ajax({ + url: '/api/orders/' + this.orderId + '/', + type: 'PATCH', + beforeSend: function beforeSend(xhr) { + xhr.setRequestHeader("X-CSRFToken", (0, _utils.getCookie)('csrftoken')); + }, + data: { secure: checked }, + dataType: 'json', + success: function success(json) { + console.log("Protect switch success, json = ", json); + var message = message_format; + message.data.sender_id = userId; + message.data.recipent_id = self.recipentId; + message.data.order_id = self.orderId; + // Key words "перевел заказ" - на них завязан анализатор на стороне Исполнителя (костыль) + message.data.msg = '\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A \u043F\u0435\u0440\u0435\u0432\u0435\u043B \u0437\u0430\u043A\u0430\u0437 "' + self.orderName + '" \u043D\u0430 ' + (checked ? 'безопасную сделку' : 'прямую оплату') + ' '; + console.log("Send-WS Оставить отзыв"); + socket.send_stages_approve(message); + } + }); + } // "Перевести на Безопасный заказ" + }, { key: '_onBtnArbitration', diff --git a/assets/js/build/contractor_filter.js b/assets/js/build/contractor_filter.js index b2ec298..6245d28 100644 --- a/assets/js/build/contractor_filter.js +++ b/assets/js/build/contractor_filter.js @@ -47,13 +47,13 @@ 'use strict'; - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); - var _extended_field = __webpack_require__(28); + var _extended_field = __webpack_require__(32); - var _ajax_set_filter = __webpack_require__(29); + var _ajax_set_filter = __webpack_require__(33); - var _filter_toggle = __webpack_require__(30); + var _filter_toggle = __webpack_require__(34); function paginateTo(pageNum) { var $form = $('#filter-form'); @@ -75,7 +75,7 @@ /***/ }, -/***/ 27: +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -105,7 +105,7 @@ /***/ }, -/***/ 28: +/***/ 32: /***/ function(module, exports) { 'use strict'; @@ -136,7 +136,7 @@ /***/ }, -/***/ 29: +/***/ 33: /***/ function(module, exports) { 'use strict'; @@ -200,7 +200,7 @@ /***/ }, -/***/ 30: +/***/ 34: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/create_project.js b/assets/js/build/create_project.js index 4ef741f..5fb443b 100644 --- a/assets/js/build/create_project.js +++ b/assets/js/build/create_project.js @@ -40,29 +40,30 @@ /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ -/******/ ([ -/* 0 */ +/******/ ({ + +/***/ 0: /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _file_upload = __webpack_require__(31); + var _file_upload = __webpack_require__(35); - var _extended_field = __webpack_require__(28); + var _extended_field = __webpack_require__(32); - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); - var _read_more = __webpack_require__(32); + var _read_more = __webpack_require__(36); - var _only_one_checkbox = __webpack_require__(33); + var _only_one_checkbox = __webpack_require__(37); - var _popups = __webpack_require__(34); + var _popups = __webpack_require__(38); - var _scroll_on_required = __webpack_require__(35); + var _scroll_on_required = __webpack_require__(39); - var _ajax_registration = __webpack_require__(36); + var _ajax_registration = __webpack_require__(40); - var _test_seeds = __webpack_require__(37); + var _test_seeds = __webpack_require__(41); function showHideRealry() { var check = $('#checkbox-sb-realty'); @@ -97,9 +98,8 @@ }); /***/ }, -/* 1 */, -/* 2 */, -/* 3 */ + +/***/ 3: /***/ function(module, exports) { 'use strict'; @@ -143,30 +143,8 @@ exports.getCookie = getCookie; /***/ }, -/* 4 */, -/* 5 */, -/* 6 */, -/* 7 */, -/* 8 */, -/* 9 */, -/* 10 */, -/* 11 */, -/* 12 */, -/* 13 */, -/* 14 */, -/* 15 */, -/* 16 */, -/* 17 */, -/* 18 */, -/* 19 */, -/* 20 */, -/* 21 */, -/* 22 */, -/* 23 */, -/* 24 */, -/* 25 */, -/* 26 */, -/* 27 */ + +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -195,7 +173,8 @@ exports.customCheckInit = customCheckInit; /***/ }, -/* 28 */ + +/***/ 32: /***/ function(module, exports) { 'use strict'; @@ -225,9 +204,8 @@ exports.extendedFieldInit = extendedFieldInit; /***/ }, -/* 29 */, -/* 30 */, -/* 31 */ + +/***/ 35: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -275,7 +253,8 @@ exports.fileUploadInit = fileUploadInit; /***/ }, -/* 32 */ + +/***/ 36: /***/ function(module, exports) { "use strict"; @@ -295,7 +274,8 @@ exports.readMoreInit = readMoreInit; /***/ }, -/* 33 */ + +/***/ 37: /***/ function(module, exports) { "use strict"; @@ -326,7 +306,8 @@ exports.onlyOneCheckboxInit = onlyOneCheckboxInit; /***/ }, -/* 34 */ + +/***/ 38: /***/ function(module, exports) { 'use strict'; @@ -381,7 +362,8 @@ exports.addMessage = addMessage; /***/ }, -/* 35 */ + +/***/ 39: /***/ function(module, exports) { 'use strict'; @@ -401,7 +383,8 @@ exports.scrollOnRequiredInit = scrollOnRequiredInit; /***/ }, -/* 36 */ + +/***/ 40: /***/ function(module, exports) { 'use strict'; @@ -499,7 +482,8 @@ exports.ajaxRegistrationInit = ajaxRegistrationInit; /***/ }, -/* 37 */ + +/***/ 41: /***/ function(module, exports) { "use strict"; @@ -514,4 +498,5 @@ exports.print = print; /***/ } -/******/ ]); \ No newline at end of file + +/******/ }); \ No newline at end of file diff --git a/assets/js/build/create_worksell.js b/assets/js/build/create_worksell.js index 1312f0f..5732130 100644 --- a/assets/js/build/create_worksell.js +++ b/assets/js/build/create_worksell.js @@ -47,15 +47,15 @@ 'use strict'; - var _image_upload = __webpack_require__(38); + var _image_upload = __webpack_require__(42); - var _scroll_on_required = __webpack_require__(35); + var _scroll_on_required = __webpack_require__(39); - var _popups = __webpack_require__(34); + var _popups = __webpack_require__(38); - var _ajax_registration = __webpack_require__(36); + var _ajax_registration = __webpack_require__(40); - var _ajax_send_form_data = __webpack_require__(39); + var _ajax_send_form_data = __webpack_require__(43); $(function () { (0, _image_upload.imageUploadInit)(); @@ -114,7 +114,7 @@ /***/ }, -/***/ 34: +/***/ 38: /***/ function(module, exports) { 'use strict'; @@ -170,7 +170,7 @@ /***/ }, -/***/ 35: +/***/ 39: /***/ function(module, exports) { 'use strict'; @@ -191,7 +191,7 @@ /***/ }, -/***/ 36: +/***/ 40: /***/ function(module, exports) { 'use strict'; @@ -290,7 +290,7 @@ /***/ }, -/***/ 38: +/***/ 42: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -370,7 +370,7 @@ /***/ }, -/***/ 39: +/***/ 43: /***/ function(module, exports, __webpack_require__) { "use strict"; diff --git a/assets/js/build/custom_components.js b/assets/js/build/custom_components.js index b44253f..bd473d2 100644 --- a/assets/js/build/custom_components.js +++ b/assets/js/build/custom_components.js @@ -47,9 +47,9 @@ 'use strict'; - var _custom_select = __webpack_require__(40); + var _custom_select = __webpack_require__(44); - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); $(function () { (0, _custom_select.customSelectInit)(); @@ -58,7 +58,7 @@ /***/ }, -/***/ 27: +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -88,7 +88,7 @@ /***/ }, -/***/ 40: +/***/ 44: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/customer_profile.js b/assets/js/build/customer_profile.js index aeffe42..5df21d1 100644 --- a/assets/js/build/customer_profile.js +++ b/assets/js/build/customer_profile.js @@ -47,13 +47,13 @@ 'use strict'; - var _show_hide = __webpack_require__(41); + var _show_hide = __webpack_require__(45); - var _bootstrap_tabs = __webpack_require__(42); + var _bootstrap_tabs = __webpack_require__(46); - var _sort_by = __webpack_require__(43); + var _sort_by = __webpack_require__(47); - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); $(function () { (0, _bootstrap_tabs.restoreTab)(); @@ -111,7 +111,7 @@ /***/ }, -/***/ 27: +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -141,7 +141,7 @@ /***/ }, -/***/ 41: +/***/ 45: /***/ function(module, exports) { "use strict"; @@ -158,7 +158,7 @@ /***/ }, -/***/ 42: +/***/ 46: /***/ function(module, exports) { "use strict"; @@ -194,7 +194,7 @@ /***/ }, -/***/ 43: +/***/ 47: /***/ function(module, exports, __webpack_require__) { "use strict"; diff --git a/assets/js/build/debugUtilsInit.js b/assets/js/build/debugUtilsInit.js index ce4e128..ba8d88c 100644 --- a/assets/js/build/debugUtilsInit.js +++ b/assets/js/build/debugUtilsInit.js @@ -47,7 +47,7 @@ 'use strict'; - var _utils_debug = __webpack_require__(44); + var _utils_debug = __webpack_require__(48); // DEBUG window.print = {}; @@ -55,7 +55,7 @@ /***/ }, -/***/ 44: +/***/ 48: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/home_page.js b/assets/js/build/home_page.js index e6f7512..8818af5 100644 --- a/assets/js/build/home_page.js +++ b/assets/js/build/home_page.js @@ -47,7 +47,7 @@ 'use strict'; - var _popupYoutube = __webpack_require__(45); + var _popupYoutube = __webpack_require__(49); $(function () { (0, _popupYoutube.popupYoutubeInit)(); @@ -55,7 +55,7 @@ /***/ }, -/***/ 45: +/***/ 49: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/init_contractor_filter.js b/assets/js/build/init_contractor_filter.js index d267aef..17b75ab 100644 --- a/assets/js/build/init_contractor_filter.js +++ b/assets/js/build/init_contractor_filter.js @@ -47,15 +47,15 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); @@ -122,7 +122,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -137,15 +137,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -378,7 +378,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -534,7 +534,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -591,7 +591,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -676,7 +676,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -690,9 +690,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -754,7 +754,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1306,7 +1306,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1320,9 +1320,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); diff --git a/assets/js/build/init_create_worksell.js b/assets/js/build/init_create_worksell.js index b101cd1..1295477 100644 --- a/assets/js/build/init_create_worksell.js +++ b/assets/js/build/init_create_worksell.js @@ -47,27 +47,27 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _SelectedContainerCreate = __webpack_require__(53); + var _SelectedContainerCreate = __webpack_require__(57); var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); - var _SingleTreeSelect = __webpack_require__(54); + var _SingleTreeSelect = __webpack_require__(58); var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect); - var _SelectOrCreate = __webpack_require__(55); + var _SelectOrCreate = __webpack_require__(59); var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate); @@ -169,7 +169,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -184,15 +184,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -425,7 +425,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -581,7 +581,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -638,7 +638,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -723,7 +723,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -737,9 +737,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -801,7 +801,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1353,7 +1353,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1367,9 +1367,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); @@ -1479,7 +1479,7 @@ /***/ }, -/***/ 53: +/***/ 57: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1495,11 +1495,11 @@ var _desc, _value, _class; - var _SelectedContainer2 = __webpack_require__(46); + var _SelectedContainer2 = __webpack_require__(50); var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -1581,7 +1581,7 @@ /***/ }, -/***/ 54: +/***/ 58: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1593,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__(51); + var _AbsBaseSelect = __webpack_require__(55); - var _TreeSelect2 = __webpack_require__(52); + var _TreeSelect2 = __webpack_require__(56); var _TreeSelect3 = _interopRequireDefault(_TreeSelect2); @@ -1677,7 +1677,7 @@ /***/ }, -/***/ 55: +/***/ 59: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1691,9 +1691,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); 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 c6ea8eb..f4ae04b 100644 --- a/assets/js/build/init_customer_project_create.js +++ b/assets/js/build/init_customer_project_create.js @@ -47,27 +47,27 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _SelectedContainerCreate = __webpack_require__(53); + var _SelectedContainerCreate = __webpack_require__(57); var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); - var _SingleTreeSelect = __webpack_require__(54); + var _SingleTreeSelect = __webpack_require__(58); var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect); - var _SelectOrCreate = __webpack_require__(55); + var _SelectOrCreate = __webpack_require__(59); var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate); @@ -216,7 +216,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -231,15 +231,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -472,7 +472,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -628,7 +628,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -685,7 +685,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -770,7 +770,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -784,9 +784,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -848,7 +848,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1400,7 +1400,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1414,9 +1414,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); @@ -1526,7 +1526,7 @@ /***/ }, -/***/ 53: +/***/ 57: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1542,11 +1542,11 @@ var _desc, _value, _class; - var _SelectedContainer2 = __webpack_require__(46); + var _SelectedContainer2 = __webpack_require__(50); var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -1628,7 +1628,7 @@ /***/ }, -/***/ 54: +/***/ 58: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1640,9 +1640,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__(51); + var _AbsBaseSelect = __webpack_require__(55); - var _TreeSelect2 = __webpack_require__(52); + var _TreeSelect2 = __webpack_require__(56); var _TreeSelect3 = _interopRequireDefault(_TreeSelect2); @@ -1724,7 +1724,7 @@ /***/ }, -/***/ 55: +/***/ 59: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1738,9 +1738,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); diff --git a/assets/js/build/init_modal_realty_edit.js b/assets/js/build/init_modal_realty_edit.js index 40767ed..b3f7826 100644 --- a/assets/js/build/init_modal_realty_edit.js +++ b/assets/js/build/init_modal_realty_edit.js @@ -47,27 +47,27 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _SelectedContainerCreate = __webpack_require__(53); + var _SelectedContainerCreate = __webpack_require__(57); var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); - var _SingleTreeSelect = __webpack_require__(54); + var _SingleTreeSelect = __webpack_require__(58); var _SingleTreeSelect2 = _interopRequireDefault(_SingleTreeSelect); - var _SelectOrCreate = __webpack_require__(55); + var _SelectOrCreate = __webpack_require__(59); var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate); @@ -276,7 +276,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -291,15 +291,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -532,7 +532,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -688,7 +688,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -745,7 +745,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -830,7 +830,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -844,9 +844,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -908,7 +908,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1460,7 +1460,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1474,9 +1474,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); @@ -1586,7 +1586,7 @@ /***/ }, -/***/ 53: +/***/ 57: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1602,11 +1602,11 @@ var _desc, _value, _class; - var _SelectedContainer2 = __webpack_require__(46); + var _SelectedContainer2 = __webpack_require__(50); var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -1688,7 +1688,7 @@ /***/ }, -/***/ 54: +/***/ 58: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1700,9 +1700,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__(51); + var _AbsBaseSelect = __webpack_require__(55); - var _TreeSelect2 = __webpack_require__(52); + var _TreeSelect2 = __webpack_require__(56); var _TreeSelect3 = _interopRequireDefault(_TreeSelect2); @@ -1784,7 +1784,7 @@ /***/ }, -/***/ 55: +/***/ 59: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1798,9 +1798,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); diff --git a/assets/js/build/init_portfolio_create_edit.js b/assets/js/build/init_portfolio_create_edit.js index c6dd2c7..22f6b58 100644 --- a/assets/js/build/init_portfolio_create_edit.js +++ b/assets/js/build/init_portfolio_create_edit.js @@ -47,23 +47,23 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _SelectedContainerCreate = __webpack_require__(53); + var _SelectedContainerCreate = __webpack_require__(57); var _SelectedContainerCreate2 = _interopRequireDefault(_SelectedContainerCreate); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); - var _SelectOrCreate = __webpack_require__(55); + var _SelectOrCreate = __webpack_require__(59); var _SelectOrCreate2 = _interopRequireDefault(_SelectOrCreate); @@ -124,7 +124,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -139,15 +139,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -380,7 +380,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -536,7 +536,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -593,7 +593,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -678,7 +678,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -692,9 +692,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -756,7 +756,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1308,7 +1308,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1322,9 +1322,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); @@ -1434,7 +1434,7 @@ /***/ }, -/***/ 53: +/***/ 57: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1450,11 +1450,11 @@ var _desc, _value, _class; - var _SelectedContainer2 = __webpack_require__(46); + var _SelectedContainer2 = __webpack_require__(50); var _SelectedContainer3 = _interopRequireDefault(_SelectedContainer2); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -1536,7 +1536,7 @@ /***/ }, -/***/ 55: +/***/ 59: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1550,9 +1550,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); diff --git a/assets/js/build/init_worksell_filter.js b/assets/js/build/init_worksell_filter.js index f31a639..153d6e1 100644 --- a/assets/js/build/init_worksell_filter.js +++ b/assets/js/build/init_worksell_filter.js @@ -47,15 +47,15 @@ 'use strict'; - var _SelectedContainer = __webpack_require__(46); + var _SelectedContainer = __webpack_require__(50); var _SelectedContainer2 = _interopRequireDefault(_SelectedContainer); - var _NoTreeSelect = __webpack_require__(50); + var _NoTreeSelect = __webpack_require__(54); var _NoTreeSelect2 = _interopRequireDefault(_NoTreeSelect); - var _TreeSelect = __webpack_require__(52); + var _TreeSelect = __webpack_require__(56); var _TreeSelect2 = _interopRequireDefault(_TreeSelect); @@ -122,7 +122,7 @@ /***/ }, -/***/ 46: +/***/ 50: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -137,15 +137,15 @@ var _desc, _value, _class; // ` - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); - var _decorators = __webpack_require__(49); + var _decorators = __webpack_require__(53); var _decorators2 = _interopRequireDefault(_decorators); @@ -378,7 +378,7 @@ /***/ }, -/***/ 47: +/***/ 51: /***/ function(module, exports) { "use strict"; @@ -534,7 +534,7 @@ /***/ }, -/***/ 48: +/***/ 52: /***/ function(module, exports) { "use strict"; @@ -591,7 +591,7 @@ /***/ }, -/***/ 49: +/***/ 53: /***/ function(module, exports) { "use strict"; @@ -676,7 +676,7 @@ /***/ }, -/***/ 50: +/***/ 54: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -690,9 +690,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _NoTreeData = __webpack_require__(48); + var _NoTreeData = __webpack_require__(52); var _NoTreeData2 = _interopRequireDefault(_NoTreeData); @@ -754,7 +754,7 @@ /***/ }, -/***/ 51: +/***/ 55: /***/ function(module, exports) { "use strict"; @@ -1306,7 +1306,7 @@ /***/ }, -/***/ 52: +/***/ 56: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1320,9 +1320,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__(51); + var _AbsBaseSelect2 = __webpack_require__(55); - var _DataTree = __webpack_require__(47); + var _DataTree = __webpack_require__(51); var _DataTree2 = _interopRequireDefault(_DataTree); diff --git a/assets/js/build/portfolio_create_edit.js b/assets/js/build/portfolio_create_edit.js index 54b253e..8a7a7c2 100644 --- a/assets/js/build/portfolio_create_edit.js +++ b/assets/js/build/portfolio_create_edit.js @@ -47,11 +47,11 @@ 'use strict'; - var _image_upload = __webpack_require__(38); + var _image_upload = __webpack_require__(42); - var _scroll_on_required = __webpack_require__(35); + var _scroll_on_required = __webpack_require__(39); - var _ajax_send_form_data = __webpack_require__(39); + var _ajax_send_form_data = __webpack_require__(43); $(function () { (0, _image_upload.imageUploadInit)(); @@ -107,7 +107,7 @@ /***/ }, -/***/ 35: +/***/ 39: /***/ function(module, exports) { 'use strict'; @@ -128,7 +128,7 @@ /***/ }, -/***/ 38: +/***/ 42: /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -208,7 +208,7 @@ /***/ }, -/***/ 39: +/***/ 43: /***/ function(module, exports, __webpack_require__) { "use strict"; diff --git a/assets/js/build/project_filter.js b/assets/js/build/project_filter.js index 650c753..68fb0fb 100644 --- a/assets/js/build/project_filter.js +++ b/assets/js/build/project_filter.js @@ -47,11 +47,11 @@ 'use strict'; - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); - var _extended_field = __webpack_require__(28); + var _extended_field = __webpack_require__(32); - var _ajax_set_filter = __webpack_require__(29); + var _ajax_set_filter = __webpack_require__(33); function paginateTo(pageNum) { var $form = $('#filter-form'); @@ -72,7 +72,7 @@ /***/ }, -/***/ 27: +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -102,7 +102,7 @@ /***/ }, -/***/ 28: +/***/ 32: /***/ function(module, exports) { 'use strict'; @@ -133,7 +133,7 @@ /***/ }, -/***/ 29: +/***/ 33: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/registration.js b/assets/js/build/registration.js index 41b0ee2..e0ff477 100644 --- a/assets/js/build/registration.js +++ b/assets/js/build/registration.js @@ -47,7 +47,7 @@ 'use strict'; - var _popups = __webpack_require__(34); + var _popups = __webpack_require__(38); function checkHash() { // on load of the page: switch to the currently selected tab @@ -65,7 +65,7 @@ /***/ }, -/***/ 34: +/***/ 38: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/user_profile_edit.js b/assets/js/build/user_profile_edit.js index 5c9fe2d..4f449ca 100644 --- a/assets/js/build/user_profile_edit.js +++ b/assets/js/build/user_profile_edit.js @@ -47,13 +47,13 @@ 'use strict'; - var _avatar_upload = __webpack_require__(56); + var _avatar_upload = __webpack_require__(60); - var _bootstrap_tabs = __webpack_require__(42); + var _bootstrap_tabs = __webpack_require__(46); - var _user_check_statuses = __webpack_require__(57); + var _user_check_statuses = __webpack_require__(61); - var _custom_select = __webpack_require__(40); + var _custom_select = __webpack_require__(44); $(function () { (0, _avatar_upload.avatarUploadInit)(); @@ -64,7 +64,7 @@ /***/ }, -/***/ 40: +/***/ 44: /***/ function(module, exports) { 'use strict'; @@ -108,7 +108,7 @@ /***/ }, -/***/ 42: +/***/ 46: /***/ function(module, exports) { "use strict"; @@ -144,7 +144,7 @@ /***/ }, -/***/ 56: +/***/ 60: /***/ function(module, exports) { 'use strict'; @@ -197,7 +197,7 @@ /***/ }, -/***/ 57: +/***/ 61: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/build/worksell_filter.js b/assets/js/build/worksell_filter.js index b2ec298..6245d28 100644 --- a/assets/js/build/worksell_filter.js +++ b/assets/js/build/worksell_filter.js @@ -47,13 +47,13 @@ 'use strict'; - var _custom_check = __webpack_require__(27); + var _custom_check = __webpack_require__(31); - var _extended_field = __webpack_require__(28); + var _extended_field = __webpack_require__(32); - var _ajax_set_filter = __webpack_require__(29); + var _ajax_set_filter = __webpack_require__(33); - var _filter_toggle = __webpack_require__(30); + var _filter_toggle = __webpack_require__(34); function paginateTo(pageNum) { var $form = $('#filter-form'); @@ -75,7 +75,7 @@ /***/ }, -/***/ 27: +/***/ 31: /***/ function(module, exports) { "use strict"; @@ -105,7 +105,7 @@ /***/ }, -/***/ 28: +/***/ 32: /***/ function(module, exports) { 'use strict'; @@ -136,7 +136,7 @@ /***/ }, -/***/ 29: +/***/ 33: /***/ function(module, exports) { 'use strict'; @@ -200,7 +200,7 @@ /***/ }, -/***/ 30: +/***/ 34: /***/ function(module, exports) { 'use strict'; diff --git a/assets/js/src/chat/BINDS.js b/assets/js/src/chat/BINDS.js index 025478d..96f27f5 100644 --- a/assets/js/src/chat/BINDS.js +++ b/assets/js/src/chat/BINDS.js @@ -1,6 +1,7 @@ import {getCookie} from '../utils' import {onClickCardWithCount} from './messageCounters' import {loadTemplate} from './loaders' +import {bindRemoveNotes} from './notes' function dialog(message, yesCallback, notCallback) { $("#dialog_delete .modal-title").html(message); @@ -21,6 +22,7 @@ function bindOrders() { $('.order-block').on('click', function (event) { event.preventDefault(); let $this = $(this); + $("#chat-order-add").show(); onClickCardWithCount($this); $('.order-block').each(function (i, v) { $(v).removeClass('orAct'); @@ -42,14 +44,75 @@ function bindOrders() { $("#chat-order-add #recipentId").val(recipentId); window.chatController.create(orderId, projectId, recipentId, orderName, secureOrder); + + $.ajax({ + url: '/api/note/', + type: 'GET', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + data: { + 'order': orderId, + }, + dataType: 'json', + success: function (json) { + var noteHtmlInbox = ''; + var note_tmpl = loadTemplate('note_tmpl'); + // console.log("note json -->", json); + $.each(json.results, function (i, v) { + noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id}); + }); + $(".order-notes-block").html(noteHtmlInbox); + bindRemoveNotes(); + } + }); }); $('.order-block .dimovChat').on('click', function (event) { event.preventDefault(); event.stopPropagation(); + // .toggle(); + let $arrow = $(event.target); + let $info = $arrow.siblings('.hideOBB'); + if ($info.hasClass("open")) { + $arrow.css('transform', 'rotate(0deg)'); + $info.hide(); + } else { + $arrow.css('transform', 'rotate(90deg)'); + $info.show(); + } + $info.toggleClass("open"); // console.log('click on tr'); }); } +function bindOrderInfo() { + $(".messageBlock").on('click', '.full-order-info', function (e) { + e.preventDefault(); + e.stopPropagation(); + var orderId = $(this).closest('.orderBlock').data('id'); + if (!orderId) { + orderId = $(this).closest('.trashedOrderBlock').data('id'); + } + $.ajax({ + url: '/api/orders/' + orderId + '/', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + dataType: 'json', + success: function (data) { + let outTable_tmpl = loadTemplate('order_info_tmpl'); + var outTable = outTable_tmpl({order: data}); + + $("#order-info table").html(outTable); + $("#order-info").modal('show'); + }, + error: function (e, jqxhr) { + console.log(e); + } + }); + }); +} + function bindTeams() { $('.team-block').on('click', function () { onClickCardWithCount($(this)); @@ -145,10 +208,11 @@ function bindTeams() { var noteHtmlInbox = ''; var note_tmpl = loadTemplate('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({text: v.text}); + noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id}); }); $(".team-notes-block").html(noteHtmlInbox); + bindRemoveNotes(); } }); @@ -385,9 +449,10 @@ function bindGetUserMessages() { var noteHtmlInbox = ''; var note_tmpl = loadTemplate('note_tmpl'); $.each(json.results, function (i, v) { - noteHtmlInbox += note_tmpl({text: v.text}); + noteHtmlInbox += note_tmpl({text: v.text, note_id: v.id}); }); $(".contractor-notes-block").html(noteHtmlInbox); + bindRemoveNotes(); } }); @@ -434,12 +499,25 @@ function bindDeleteContact() { }); } +function bindCtrlEnterSendMessage() { + $('textarea.js-chat').keydown(function (e) { + let $target = $(e.target); + if (e.ctrlKey && e.keyCode == 13) { + // console.log("Send button -->", $target.parent().find('.btn-send')) + let $btn_send = $target.parent().find('.btn-send'); + $btn_send.trigger('click'); + } + }) +} + export { bindOrders, + bindOrderInfo, bindArbitrationSend, bindOnTabs, bindUserContacts, bindGetUserMessages, bindTeams, bindDeleteContact, + bindCtrlEnterSendMessage, } \ No newline at end of file diff --git a/assets/js/src/chat/ChatContractorPageController.js b/assets/js/src/chat/ChatContractorPageController.js index 6e18d8c..241a295 100644 --- a/assets/js/src/chat/ChatContractorPageController.js +++ b/assets/js/src/chat/ChatContractorPageController.js @@ -1 +1 @@ -import {StagesController} from './StagesContractorController' import {MessagesController} from './MessagesControllers' import {DocumentsController} from './DocumentsControllers' class ChatPageController { constructor() { let self = this; console.log("NEW CONTRACTOR ChatPageController"); this.statesController = undefined; this.messagesController = undefined; this.documentsController = undefined; // TODO: не забыть! // $('.order-block').on('click', function (event) { // console.log("CLICK!!!"); // event.preventDefault(); // let $this = $(this); // $('.order-block').each(function (i, v) { // $(v).removeClass('orAct'); // }); // $this.addClass('orAct'); // let orderId = $this.data('id'); // let projectId = $this.data('project-id'); // let recipentId = $this.data('recipent-id'); // let orderName = $this.data('order-name'); // // console.log('orderId = ', orderId); // new StagesController(orderId, projectId, recipentId, orderName); // new MessagesController(orderId); // window.location.hash = `order${orderId}`; // // $("#chat-order-add #orderId").val(orderId); // $("#add-form-order-note #orderNote").val(orderId); // $("#orderArbitrationId").val(orderId); // $("#projectReviewId").val(projectId); // // console.log("recipentId = ", recipentId); // $("#chat-order-add #recipentId").val(recipentId); // $("#targetCustomerId").val(recipentId); // $("#add-form-order-note #recipentNote").val(recipentId); // // }); // $('.order-block .dimovChat').on('click', function (event) { // event.preventDefault(); // event.stopPropagation(); // // TODO: доделать сворачивание/разворачивание блока // // console.log('click on tr'); // }); } create(orderId, projectId, recipentId, orderName, secureOrder) { this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder); this.messagesController = new MessagesController(orderId); this.documentsController = new DocumentsController(orderId); } // refresh() } export {ChatPageController} \ No newline at end of file +import {StagesController} from './StagesContractorController' import {MessagesController} from './MessagesControllers' import {DocumentsController} from './DocumentsControllers' class ChatPageController { constructor() { let self = this; console.log("NEW CONTRACTOR ChatPageController"); this.statesController = undefined; this.messagesController = undefined; this.documentsController = undefined; } create(orderId, projectId, recipentId, orderName, secureOrder) { this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder); this.messagesController = new MessagesController(orderId); this.documentsController = new DocumentsController(orderId); } // refresh() } export {ChatPageController} \ No newline at end of file diff --git a/assets/js/src/chat/ChatCustomerPageController.js b/assets/js/src/chat/ChatCustomerPageController.js index 679d9c3..f8f9df5 100644 --- a/assets/js/src/chat/ChatCustomerPageController.js +++ b/assets/js/src/chat/ChatCustomerPageController.js @@ -1 +1 @@ -import {StagesController} from './StagesCustomerController' import {MessagesController} from './MessagesControllers' import {recalculateMessages} from './messageCounters' class ChatPageController { constructor() { let self = this; // console.log("NEW Chat CUSTOMER PageController"); this.statesController = undefined; this.messagesController = undefined; // TODO: не забыть! // recalculateMessages(); } create(orderId, projectId, recipentId, orderName, secureOrder) { this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder); this.messagesController = new MessagesController(orderId); } } export {ChatPageController} \ No newline at end of file +import {StagesController} from './StagesCustomerController' import {MessagesController} from './MessagesControllers' import {DocumentsController} from './DocumentsControllers' class ChatPageController { constructor() { let self = this; // console.log("NEW Chat CUSTOMER PageController"); this.statesController = undefined; this.messagesController = undefined; this.documentsController = undefined; } create(orderId, projectId, recipentId, orderName, secureOrder, kwargs={archive:false}) { this.statesController = new StagesController(orderId, projectId, recipentId, orderName, secureOrder, kwargs); this.messagesController = new MessagesController(orderId); this.documentsController = new DocumentsController(orderId); } } export {ChatPageController} \ No newline at end of file diff --git a/assets/js/src/chat/MessagesControllers.js b/assets/js/src/chat/MessagesControllers.js index 8bb1d10..368a0ae 100644 --- a/assets/js/src/chat/MessagesControllers.js +++ b/assets/js/src/chat/MessagesControllers.js @@ -33,9 +33,6 @@ class MessagesController { _onLoadData(json) { const self = this; - // console.log('mesages json = ', json); - // console.log('$inbox = ', this.$inbox); - // console.log("messages render start"); self.$inbox.html(""); $.each(json.results, function (i, v) { var senderName = 'Вы'; @@ -46,7 +43,7 @@ class MessagesController { className = ''; } if (v.is_system) { - senderName = 'Системное'; + senderName = (senderName == 'Вы') ? 'Системное от Вас': `Системное от ${senderName}`; className = 'systemChat' } let message = $(self.messageTemplate({className: className, senderName: senderName, message: v})); diff --git a/assets/js/src/chat/Stages.js b/assets/js/src/chat/Stages.js index feb09f9..61da520 100644 --- a/assets/js/src/chat/Stages.js +++ b/assets/js/src/chat/Stages.js @@ -188,7 +188,6 @@ class StageForm { beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) }, - //TODO: слать только изменения data: { status: secureOrder ? 'agreed': 'in_process', }, @@ -209,7 +208,6 @@ class StageForm { beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) }, - //TODO: слать только изменения data: {status: 'not_agreed'}, dataType: 'json', }) @@ -322,7 +320,6 @@ class StageInWork { beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) }, - //TODO: слать только изменения data: {status: 'closed'}, dataType: 'json', }) diff --git a/assets/js/src/chat/StagesContractorController.js b/assets/js/src/chat/StagesContractorController.js index bb947d8..86842ba 100644 --- a/assets/js/src/chat/StagesContractorController.js +++ b/assets/js/src/chat/StagesContractorController.js @@ -25,6 +25,7 @@ const STATUSES = { }; //Contractor +//TODO: Вынесли общую логику в родительский класс class StagesController { constructor(orderId, projectId, recipentId, orderName, secureOrder) { const self = this; @@ -62,6 +63,10 @@ class StagesController { $reserve: $('#reserveSpace'), //2. Резервирование (Отобразить) $works: $('#completeWork') //3. Выполненная работа }; + this.temp = { + approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html(), + reserve_help_text: this.stages_elements.$approve.find('.js-help-text').html(), + }; this.init(); } @@ -98,13 +103,39 @@ class StagesController { this.init(); } + reload() { + /** + * Перезагружаем страницу Чата(при удалении заказа) + */ + window.location = '/chat/#order'; + location.reload(); + } + + _buildPage() { + // console.log("Build PAge"); + // Restore html to default + this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text); + this.stages_elements.$reserve.find('.js-help-text').html(this.temp.reserve_help_text); + this.stages_elements.$approve.find('.js-select').addClass("select"); + this.stages_elements.$reserve.find('.js-select').addClass("select"); + this.stages_elements.$works.find('.js-select').addClass("select"); + + this.stages_elements.$reserve.hide(); + this.stages_elements.$works.hide(); + if (this.data.stages.length == 0) { + this.buildStartStage() + } else { + let stageStatus = this.data.stages[0].status; + // console.log('stageStatus = ', stageStatus); + this.STAGE_STATUSES[stageStatus](); + } + this._bindEvents(); + } buildStartStage() { /** * Стадия: "Проект Предложен"(нет этапов) */ - // Выделить цифру 1. красным - // $('#conditions-approve').find('.select') this.stages_elements.$approve.show(); this.stages_elements.$reserve.show(); this.stages_elements.$works.show(); @@ -121,8 +152,11 @@ class StagesController { if (this.secureOrder){ this.stages_elements.$reserve.find('.js-help-text').show(); } else { - this.stages_elements.$reserve.find('.js-help-text').hide(); - // this.stages_elements.$reserve.find('.js-help-text').html('Резервирование не предусмотрено, безопасная сделака не активна'); + this.stages_elements.$reserve.find('.js-help-text').show(); + this.stages_elements.$reserve.find('.js-select').removeClass('select'); + this.stages_elements.$reserve.find('.js-help-text').html( + 'Резервирование не предусмотрено, безопасная сделака не активна' + ); } } // Нет Этапов / "Не согласован" @@ -138,7 +172,7 @@ class StagesController { buildSendApproveStage() { console.log("Stage: send_approve"); - this._renderStage('stage_approved_tmpl', true); + this._renderStage('stage_contractor_approve_tmpl', true); this.$orderStagesContainer.parent().show(); this.buttons.btnApprove.show(); this.buttons.btnChange.show(); @@ -157,6 +191,7 @@ class StagesController { this.buttons.btnsArbitration.last().show(); this._renderStage('stage_approved_tmpl', true); this.stages_elements.$approve.find('.js-help-text').hide(); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.show(); if (this.secureOrder){ this._renderStageReserved('reserved_tmpl'); @@ -169,29 +204,23 @@ class StagesController { buildProcessStage() { console.log('Stage: in_process'); + // Block-Stage-1 + this.stages_elements.$approve.find('.js-stage-header').html('Согласованные условия'); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.buildAgreedStage(); + // Block-Stage-2 this.stages_elements.$reserve.find('.js-help-text').hide(); + // Block-Stage-3 this.stages_elements.$works.show(); + + this._renderStageInWork('work_in_process_tmpl'); if (this.secureOrder) { - this._renderStageInWork('work_in_process_tmpl'); + // this._renderStageInWork('work_in_process_tmpl'); } else { - this.stages_elements.$reserve.find('.stages-paid').html(""); + this.stages_elements.$reserve.hide(); } } // Статус "В процессе"/"Завершен"/"Закрыт" - _buildPage() { - // console.log("Build PAge"); - this.stages_elements.$reserve.hide(); - this.stages_elements.$works.hide(); - if (this.data.stages.length == 0) { - this.buildStartStage() - } else { - let stageStatus = this.data.stages[0].status; - // console.log('stageStatus = ', stageStatus); - this.STAGE_STATUSES[stageStatus](); - } - this._bindEvents(); - } _renderStage(template_name, disable = false) { let i = 0; @@ -287,6 +316,11 @@ class StagesController { _onLoadData(json) { this.data = json; this._buildPage(); + if (this.data.project.state == 'deleted') { + for (let key in this.buttons){ + this.buttons[key].hide(); + } + } } _bindEvents() { @@ -315,7 +349,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Условия заказа ${self.orderName} приняты`; + message.data.msg = `Условия заказа "${self.orderName}" приняты`; console.log("Send-WS Условия приняты"); socket.send_stages_approve(message); //TODO: раскомментировать дурацкое окно @@ -333,7 +367,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Заказ ${self.orderName} отправлен для внесения изменений`; + message.data.msg = `Заказ "${self.orderName}" отправлен для внесения изменений`; console.log("Send-WS Внести изменения"); socket.send_stages_approve(message); }); @@ -376,7 +410,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Этап ${json.name} закрыт`; + message.data.msg = `Этап "${json.name}" закрыт`; console.log("Send-WS Закрытие этапа"); socket.send_stages_approve(message); }) @@ -412,18 +446,22 @@ class StagesController { // $('#review-add').modal('hide'); // self.stages_elements.$works.find('.js-btnSendReview').hide(); $('#review-add').modal('hide'); - self.redraw(); - let message = message_format; message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Отзыв на заказ ${self.orderName} оставлен`; + message.data.msg = `Отзыв на заказ "${self.orderName}" оставлен`; console.log("Send-WS Оставить отзыв"); + // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2) socket.send_stages_approve(message); // $("a[href='#tab2']").trigger('click'); - window.location = '/chat/#order'; - location.reload(); + if(json.count_reviews == 1){ + self.redraw(); + }else { + self.reload(); + } + // window.location = '/chat/#order'; + // location.reload(); }, error: function (e) { console.log('error'); @@ -432,6 +470,12 @@ class StagesController { }); } // "Оставить отзыв" + _changeOrderProtect(secure) { + this.secureOrder = secure; + console.log('secure = ', this.secureOrder); + this.redraw(); + }// Если заказчик изменил secure + _onBtnArbitration(event) { event.preventDefault(); diff --git a/assets/js/src/chat/StagesCustomerController.js b/assets/js/src/chat/StagesCustomerController.js index 5541d05..0f4f9d2 100644 --- a/assets/js/src/chat/StagesCustomerController.js +++ b/assets/js/src/chat/StagesCustomerController.js @@ -24,15 +24,17 @@ const STATUSES = { }; - +//Customer +//TODO: Вынесли общую логику в родительский класс class StagesController { - constructor(orderId, projectId, recipentId, orderName, secureOrder) { + constructor(orderId, projectId, recipentId, orderName, secureOrder, kwargs = {}) { const self = this; this.orderId = orderId; this.orderName = orderName; this.projectId = projectId; this.recipentId = recipentId; this.secureOrder = secureOrder; + // this.is_archive_project this.data = {}; //JSON this.stages = []; this.stages_reserved = []; @@ -47,6 +49,8 @@ class StagesController { }; this.btnCompleteTmpl = loadTemplate('bntCompleteStage_tmpl'); this.btnSendReviewTmpl = loadTemplate('btnSendReview_tmpl'); + this.switch_to_protected_tmpl = loadTemplate('switch_to_protected_tmpl'); + this.$orderStagesContainer = $('#order-stages'); this.$orderStagesContainer.html(''); this.$stagesCount = $('#countStage'); @@ -65,6 +69,9 @@ class StagesController { $reserve: $('#reserveSpace'), //2. Резервирование $works: $('#completeWork') //3. Выполненная работа }; + this.temp = { + approve_stage_header_text: this.stages_elements.$approve.find('.js-stage-header').html(), + }; this.init(); } @@ -101,6 +108,37 @@ class StagesController { this.init(); } + reload() { + /** + * Перезагружаем страницу Чата(при удалении заказа) + */ + window.location = '/chat/#order'; + location.reload(); + } + + _buildPage() { + console.log("Build Page!"); + // Restore html to default + this.stages_elements.$approve.find('.js-stage-header').html(this.temp.approve_stage_header_text); + console.log("restore this -->", this.stages_elements.$approve.find('.js-select')); + this.stages_elements.$approve.find('.js-select').addClass("select"); + this.stages_elements.$reserve.find('.js-select').addClass("select"); + this.stages_elements.$works.find('.js-select').addClass("select"); + let $swith_to_protected = this.$orderStagesContainer.siblings('.switch'); + if ($swith_to_protected.length) $swith_to_protected.remove(); + + this.stages_elements.$reserve.hide(); + this.stages_elements.$works.hide(); + if (this.data.stages.length == 0) { + this.buildStartStage() + } else { + let stageStatus = this.data.stages[0].status; + // console.log('stageStatus = ', stageStatus); + this.STAGE_STATUSES[stageStatus](); + } + this._bindEvents(); + } + buildStartStage() { /** * Стадия: "Проект Предложен"(нет этапов) @@ -114,11 +152,17 @@ class StagesController { this.$stagesCount.removeAttr('disabled'); this.$stagesCount.val(1); this.$stagesCount.trigger('change'); + this.stages_elements.$approve.find('.js-select').addClass('select'); // this.stages_elements.$approve.find('.js-help-text').show(); // this.stages_elements.$reserve.find('.js-help-text').show(); // this.stages_elements.$reserve.find('.stages-paid').hide(); // this.stages_elements.$works.find('.js-help-text').show(); // this.stages_elements.$works.find('#stagesWork').show(); + if (!this.secureOrder) { + // console.log("add switch to protect"); + this.$orderStagesContainer.after(this.switch_to_protected_tmpl()); + $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this)); + } } // Нет Этапов @@ -128,6 +172,11 @@ class StagesController { this.buttons.btnApprove.show(); this.buttons.btnChange.hide(); this.buttons.btnToArchive.hide(); + if (!this.secureOrder) { + // console.log("add switch to protect"); + this.$orderStagesContainer.after(this.switch_to_protected_tmpl()); + $('#switch-to-protected').unbind().on('change', this._onChangeToProtect.bind(this)); + } } // Статус "Не согласован" buildSendApproveStage() { @@ -149,6 +198,7 @@ class StagesController { this.$stagesCount.parent().hide(); this._renderStage('stage_approved_tmpl', true); this.stages_elements.$approve.find('.js-help-text').hide(); + this.stages_elements.$approve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.find('.js-help-text').show(); this.stages_elements.$reserve.show(); this.buttons.btnReserve.show(); @@ -160,24 +210,21 @@ class StagesController { buildProcessStage() { console.log('Stage: in_process'); this.buildAgreedStage(); + // Block-Stage-1 + this.stages_elements.$approve.find('.js-select').removeClass('select'); + // Block-Stage-2 + this.stages_elements.$reserve.find('.js-select').removeClass('select'); this.stages_elements.$reserve.find('.js-btnArbitration').hide(); + // Block-Stage-3 this.stages_elements.$works.show(); this._renderStageInWork('work_in_process_tmpl'); - } // Статус "В процессе"/"Завершен"/"Закрыт" + if (this.secureOrder) { - _buildPage() { - // console.log("Build PAge"); - this.stages_elements.$reserve.hide(); - this.stages_elements.$works.hide(); - if (this.data.stages.length == 0) { - this.buildStartStage() } else { - let stageStatus = this.data.stages[0].status; - // console.log('stageStatus = ', stageStatus); - this.STAGE_STATUSES[stageStatus](); + this.stages_elements.$reserve.hide(); } - this._bindEvents(); - } + } // Статус "В процессе"/"Завершен"/"Закрыт" + _renderStage(template_name, disable = false) { let i = 0; @@ -232,7 +279,6 @@ class StagesController { { template_name, data: stage_data, - note_text: 'Закройте этап или подробно опишите замечания в чате' }); this.stages_work.push(stage); } @@ -250,7 +296,7 @@ class StagesController { if (stage_data.status == 'closed') continue; let stage = new StageInWork($container, { - template_name, data: stage_data + template_name, data: stage_data, note_text: 'Закройте этап или подробно опишите замечания в чате' }); if (stage_data.status == 'completed') { let $btn = $(this.btnCompleteTmpl({stage: stage_data, text: 'Закрыть этап'})); @@ -267,6 +313,11 @@ class StagesController { _onLoadData(json) { this.data = json; this._buildPage(); + if (this.data.project.state == 'deleted') { + for (let key in this.buttons) { + this.buttons[key].hide(); + } + } } _changeNumStages(event) { @@ -345,7 +396,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Условия заказа ${self.orderName} отправлены на согласование`; + message.data.msg = `Условия заказа "${self.orderName}" отправлены на согласование`; console.log("Send-WS Отправить на согласование"); socket.send_stages_approve(message); //TODO: раскомментировать дурацкое окно @@ -366,7 +417,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Заказ ${self.orderName} отозван для внесения изменений`; + message.data.msg = `Заказ "${self.orderName}" отозван для внесения изменений`; console.log("Send-WS Внести изменения"); socket.send_stages_approve(message); }); @@ -388,7 +439,7 @@ class StagesController { }) .done(function (json) { console.log('delete complete'); - window.location.href = window.location.href.replace(getHash(), ""); + // window.location.href = window.location.href.replace(getHash(), ""); let message = message_format; message.data.sender_id = userId; message.data.recipent_id = self.recipentId; @@ -396,6 +447,7 @@ class StagesController { message.data.msg = `Заказа ${self.orderName} отправлен в архив`; console.log("Send-WS Отправить в архив"); socket.send_stages_approve(message); + self.reload(); }) .fail(function (xhr, errorMsg, error) { console.log("delete fail, json -->", xhr); @@ -481,7 +533,7 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Заказчик закрыл этап ${json.name}`; + message.data.msg = `Заказчик закрыл этап "${json.name}"`; console.log("Send-WS Оплата Этапа/Этапов"); socket.send_stages_approve(message); self.redraw(); @@ -517,12 +569,16 @@ class StagesController { message.data.sender_id = userId; message.data.recipent_id = self.recipentId; message.data.order_id = self.orderId; - message.data.msg = `Отзыв на заказ ${self.orderName} оставлен`; + message.data.msg = `Отзыв на заказ "${self.orderName}" оставлен`; console.log("Send-WS Оставить отзыв"); + // TODO: в этом сообщении отослать команду на reload if(json.count_reviews == 2) socket.send_stages_approve(message); - window.location = '/chat/#order'; - location.reload(); - // $("a[href='#tab2']").trigger('click'); + // console.log('json = ', json); + if(json.count_reviews == 1){ + self.redraw(); + }else { + self.reload(); + } }, error: function (e) { console.log('error'); @@ -531,6 +587,32 @@ class StagesController { }); } // "Оставить отзыв" + _onChangeToProtect(event) { + const self = this; + let checked = $(event.target).prop('checked'); + console.log('checked = ', checked); + $.ajax({ + url: '/api/orders/' + this.orderId + '/', + type: 'PATCH', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + data: {secure: checked}, + dataType: 'json', + success: function (json) { + console.log("Protect switch success, json = ", json); + let message = message_format; + message.data.sender_id = userId; + message.data.recipent_id = self.recipentId; + message.data.order_id = self.orderId; + // Key words "перевел заказ" - на них завязан анализатор на стороне Исполнителя (костыль) + message.data.msg = `Заказчик перевел заказ "${self.orderName}" на ${checked ? 'безопасную сделку': 'прямую оплату'} `; + console.log("Send-WS Оставить отзыв"); + socket.send_stages_approve(message); + } + }) + } // "Перевести на Безопасный заказ" + _onBtnArbitration(event) { event.preventDefault(); diff --git a/assets/js/src/chat/archiveProjects.js b/assets/js/src/chat/archiveProjects.js index aabd223..aa4ae30 100644 --- a/assets/js/src/chat/archiveProjects.js +++ b/assets/js/src/chat/archiveProjects.js @@ -25,59 +25,17 @@ function bindArchiveProjects() { }); - // Нажимаем на заказ в архмвных заказах + // Нажимаем на заказ в архивных заказах $(".messageBlock").on('click', '.trashedOrderBlock', function () { let $this = $(this); - $("#chat-order-add").css("display", "none"); + $("#chat-order-add").hide(); $('.order-block, .trashedOrderBlock').each(function () { $(this).removeClass('orAct'); }); $this.addClass('orAct'); - // var inbox = document.getElementById('message-chat-order-space'); - // var docList = document.getElementById('documentOrderSpace'); - // inbox.innerHTML = ''; - // docList.innerHTML = ''; - - let orderId = $this.data('id'); - // let projectId = $this.data('project-id'); - // let recipentId = $this.data('recipent-id'); - // let orderName = $this.data('order-name'); location.hash = '#order' + orderId; - // console.log(orderId); window.chatController.create(orderId); - // $.ajax({ - // url: '/api/message', - // type: 'GET', - // beforeSend: function (xhr) { - // xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) - // }, - // data: {'order': orderId, 'team__isnull': 'true'}, - // dataType: 'json', - // success: function (json) { - // $.each(json.results, function (i, v) { - // var senderName = 'Вы'; - // var className = 'youChat'; - // - // if (v.sender.id !== userId) { - // senderName = v.sender.username; - // className = ''; - // } - // - // inbox.innerHTML += '
    ' + - // '

    ' + senderName + '

    ' + v.created + '
    ' + - // '

    ' + v.text + '

    '; - // - // }); - // var height = inbox.scrollHeight; - // inbox.scrollTop = height; - // } - // }); - - // $("#order-stages").html(""); - // $("#completeWork").hide(); - // $("#add-form-order-note").hide(); - // $("#reserveSpace").hide(); }); } diff --git a/assets/js/src/chat/documents.js b/assets/js/src/chat/documents.js index 5045aec..04c284b 100644 --- a/assets/js/src/chat/documents.js +++ b/assets/js/src/chat/documents.js @@ -1,4 +1,7 @@ import {getCookie} from '../utils' +import {loadTemplate} from './loaders' + +let document_before_upload_tmpl = loadTemplate('document_before_upload_tmpl'); function uploadDocumentsContactInit() { $("#upload-document-contact").bind('fileuploadsubmit', function (e, data) { @@ -23,9 +26,8 @@ function uploadDocumentsContactInit() { dataType: 'json', done: function (e, data) { $.each(data.result.files, function (index, file) { - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send-contact"); + let htmlImg = document_before_upload_tmpl({file: file}); + $(htmlImg).appendTo("#document-send-contact"); }); }, fail: function (e) { @@ -49,7 +51,6 @@ function uploadDocumentsOrderInit() { recipent: $("#chat-order-add #recipentId").val(), order: $("#chat-order-add #orderId").val(), } - // console.log(data.formData); }); $('#upload-document-order').fileupload({ @@ -65,9 +66,8 @@ function uploadDocumentsOrderInit() { dataType: 'json', done: function (e, data) { $.each(data.result.files, function (index, file) { - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send-order"); + let htmlImg = document_before_upload_tmpl({file: file}); + $(htmlImg).appendTo("#document-send-order"); }); }, fail: function (e) { @@ -111,9 +111,8 @@ function uploadDocumentsTeamInit() { var currentValue = $("#documentSendIds").val(); currentValue += file.id + ';'; $("#documentSendIds").val(currentValue); - var htmlImg = ''; - var document_send = $(htmlImg).appendTo("#document-send"); + let htmlImg = document_before_upload_tmpl({file: file}); + $(htmlImg).appendTo("#document-send"); }); }, fail: function (e) { diff --git a/assets/js/src/chat/loaders.js b/assets/js/src/chat/loaders.js index 7b76cb6..bbc86df 100644 --- a/assets/js/src/chat/loaders.js +++ b/assets/js/src/chat/loaders.js @@ -7,6 +7,10 @@ import bntCompleteStage_tmpl from './templates/buttons/bntCompleteStage_tmpl.htm import btnSendReview_tmpl from './templates/buttons/btnSendReview_tmpl.html' import document_attach_file_tmpl from './templates/links/document_attach_file_tmpl.html' import note_tmpl from './templates/note_tmpl.html' +import order_info_tmpl from './templates/order_info_tmpl.html' +import stage_contractor_approve_tmpl from './templates/stage_contractor_approve_tmpl.html' +import document_before_upload_tmpl from './templates/links/document_before_upload_tmpl.html' +import switch_to_protected_tmpl from './templates/switch_to_protected_tmpl.html' function loadTemplate(template_name) { let templates = { @@ -19,6 +23,10 @@ function loadTemplate(template_name) { btnSendReview_tmpl: btnSendReview_tmpl, document_attach_file_tmpl: document_attach_file_tmpl, note_tmpl: note_tmpl, + order_info_tmpl: order_info_tmpl, + stage_contractor_approve_tmpl: stage_contractor_approve_tmpl, + document_before_upload_tmpl: document_before_upload_tmpl, + switch_to_protected_tmpl: switch_to_protected_tmpl, }; if (!templates[template_name]) throw new Error(`Template ${template_name} does not exist`); diff --git a/assets/js/src/chat/messageCounters.js b/assets/js/src/chat/messageCounters.js index b4169de..9e5cded 100644 --- a/assets/js/src/chat/messageCounters.js +++ b/assets/js/src/chat/messageCounters.js @@ -21,7 +21,7 @@ function countPlus(message, place) { let $container; if (message.answer_type == "add_message_contact"){ $container = $(`.contact-count-${message.sender_id}`); - } else if (message.answer_type == "add_message_order"){ + } else if (message.answer_type == "add_message_order" || message.answer_type == "approve_stages"){ $container = $(`#count-order-${message.order_id}`); } else if (message.answer_type == "add_message_team") { $container = $(`#count-team-${message.team_id}`); diff --git a/assets/js/src/chat/notes.js b/assets/js/src/chat/notes.js index 1ec480b..7184686 100644 --- a/assets/js/src/chat/notes.js +++ b/assets/js/src/chat/notes.js @@ -15,8 +15,9 @@ function bindContractorNotes() { success: function (json) { // console.log(json); $("#add-form-contractor-note #chat2").val(""); - let li = note_tmpl({text: json.text}); + let li = note_tmpl({text: json.text, note_id: json.id}); $(li).appendTo(".contractor-notes-block"); + bindRemoveNotes(); }, error: function (e) { console.log('error'); @@ -27,51 +28,87 @@ function bindContractorNotes() { } function bindOrderNotes() { + /** + * Create new Note + */ $('#add-note-button').on('click', function (e) { - e.preventDefault(); - $.ajax({ - url: '/api/note/', - type: 'POST', - beforeSend: function (xhr) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) - }, - data: $("#add-form-order-note").serialize(), - dataType: 'json', - success: function (json) { - // $("
  • " + json.text + "
  • ").appendTo(".order-notes-block"); - let li = note_tmpl({text: json.text}); - $(li).appendTo(".order-notes-block"); - $("#add-form-order-note #chat2").val(""); - }, - error: function (e) { - console.log('error'); - console.log(e); - } + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + data: $("#add-form-order-note").serialize(), + dataType: 'json', + success: function (json) { + // $("
  • " + json.text + "
  • ").appendTo(".order-notes-block"); + // console.log('note json = ', json); + let li = note_tmpl({text: json.text, note_id: json.id}); + $(li).appendTo(".order-notes-block"); + $("#add-form-order-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function (e) { + console.log('error'); + console.log(e); + } + }); }); -}); } function bindTeamNotes() { $('#add-team-note-button').on('click', function (e) { - e.preventDefault(); - $.ajax({ - url: '/api/note/', - type: 'POST', - beforeSend: function (xhr) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) - }, - data: $("#add-form-team-note").serialize(), - dataType: 'json', - success: function (json) { - $("
  • " + json.text + "
  • ").appendTo(".team-notes-block"); - $("#add-form-team-note #chat2").val(""); - }, - error: function (e) { - console.log('error'); - console.log(e); - } + e.preventDefault(); + $.ajax({ + url: '/api/note/', + type: 'POST', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + data: $("#add-form-team-note").serialize(), + dataType: 'json', + success: function (json) { + let li = note_tmpl({text: json.text, note_id: json.id}); + $(li).appendTo(".team-notes-block"); + $("#add-form-team-note #chat2").val(""); + bindRemoveNotes(); + }, + error: function (e) { + console.log('error'); + console.log(e); + } + }); }); -}); } -export {bindContractorNotes, bindOrderNotes, bindTeamNotes} \ No newline at end of file +function bindRemoveNotes() { + // console.log('num notes = ', $('.remove-note').length); + $('.remove-note').unbind().on('click', function (e) { + let $note = $(e.target).parent(); + let noteId = $(e.target).data('id'); + // console.log('click remove note'); + $.ajax({ + url: `/api/note/${noteId}`, + type: 'DELETE', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + dataType: 'json', + success: function (json) { + $note.remove(); + // console.log('Note deleted!'); + + // let li = note_tmpl({text: json.text, note_id: json.id}); + // $(li).appendTo(".team-notes-block"); + // $("#add-form-team-note #chat2").val(""); + }, + error: function (e) { + console.log('error'); + console.log(e); + } + }); + }) +} + +export {bindContractorNotes, bindOrderNotes, bindTeamNotes, bindRemoveNotes} \ No newline at end of file diff --git a/assets/js/src/chat/templates/links/document_before_upload_tmpl.html b/assets/js/src/chat/templates/links/document_before_upload_tmpl.html new file mode 100644 index 0000000..2edcde7 --- /dev/null +++ b/assets/js/src/chat/templates/links/document_before_upload_tmpl.html @@ -0,0 +1,7 @@ + + +
    ; \ No newline at end of file diff --git a/assets/js/src/chat/templates/note_tmpl.html b/assets/js/src/chat/templates/note_tmpl.html index e13300f..4174343 100644 --- a/assets/js/src/chat/templates/note_tmpl.html +++ b/assets/js/src/chat/templates/note_tmpl.html @@ -1,3 +1,4 @@ +
  • ${this.text} diff --git a/assets/js/src/chat/templates/order_info_tmpl.html b/assets/js/src/chat/templates/order_info_tmpl.html new file mode 100644 index 0000000..ce12b7e --- /dev/null +++ b/assets/js/src/chat/templates/order_info_tmpl.html @@ -0,0 +1,16 @@ + + + Название + ${this.order.project.name} + + + Безопасная сделка + ${this.order.secure ? 'Выбрана': 'Не выбрана'} + + + Тип здания + ${this.order.project.realty.building_classification ? this.order.project.realty.building_classification.name : 'не задан'} + + Классификация здания + ${this.order.project.realty.construction_type ? this.order.project.realty.construction_type.name: 'не задана'} + \ No newline at end of file diff --git a/assets/js/src/chat/templates/stage_approved_tmpl.html b/assets/js/src/chat/templates/stage_approved_tmpl.html index 31f12be..4e93438 100644 --- a/assets/js/src/chat/templates/stage_approved_tmpl.html +++ b/assets/js/src/chat/templates/stage_approved_tmpl.html @@ -5,7 +5,7 @@ ЭТАП ${this.stage_num}
  • - ${this.stage_status} + ${this.stage_status?this.stage_status:'не согласован'}
    @@ -25,5 +25,8 @@
    до ${this.stage.term}
    +
    + Срок этапа расчитывается с момента резервирования средств +
    \ No newline at end of file diff --git a/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html b/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html new file mode 100644 index 0000000..6857d6c --- /dev/null +++ b/assets/js/src/chat/templates/stage_contractor_approve_tmpl.html @@ -0,0 +1,32 @@ + +
    +
    +
    + ЭТАП ${this.stage_num} +
    +
    + ${this.stage_status} +
    +
    +
    + +
    + ${this.stage.name} +
    + Результат этапа +
    + ${this.stage.result} +
    + Цена +
    + ${this.stage.cost} ₽ +
    + Срок +
    + до ${this.stage.term} +
    +
    + Срок этапа расчитывается с момента резервирования средств +
    + +
    \ No newline at end of file diff --git a/assets/js/src/chat/templates/stage_tmpl.html b/assets/js/src/chat/templates/stage_tmpl.html index ac21205..9101554 100644 --- a/assets/js/src/chat/templates/stage_tmpl.html +++ b/assets/js/src/chat/templates/stage_tmpl.html @@ -1,6 +1,15 @@
    -

    ЭТАП ${this.stage_num}

    + +
    +
    + ЭТАП ${this.stage_num} +
    +
    + ${this.stage_status?this.stage_status:'не согласован'} +
    +
    +
    @@ -21,7 +30,7 @@

    - +

    diff --git a/assets/js/src/chat/templates/switch_to_protected_tmpl.html b/assets/js/src/chat/templates/switch_to_protected_tmpl.html new file mode 100644 index 0000000..b33c59c --- /dev/null +++ b/assets/js/src/chat/templates/switch_to_protected_tmpl.html @@ -0,0 +1,14 @@ + +
    + Безопасная сделка не активна +
    +
    + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/assets/js/src/chat/wsChatConnect.js b/assets/js/src/chat/wsChatConnect.js index 5b8db0b..452ba98 100644 --- a/assets/js/src/chat/wsChatConnect.js +++ b/assets/js/src/chat/wsChatConnect.js @@ -66,7 +66,7 @@ function connect() { classMessage = ''; } if (data.is_system){ - senderName = 'Системное'; + senderName = (senderName == 'Вы') ? 'Системное от Вас': `Системное от ${senderName}`; classMessage = 'systemChat' } @@ -80,7 +80,12 @@ function connect() { $documents_container.append(data.docs_attach); - if (data.answer_type == 'approve_stages') { + if (data.answer_type == 'approve_stages' && data.sender_id != userId) { + if (data.msg.indexOf('перевел заказ') != -1){ + let secure = false; + if (data.msg.indexOf('безопасную сделку') != -1) secure = true; + window.chatController.statesController._changeOrderProtect(secure); + } window.chatController.statesController.redraw(); } @@ -102,7 +107,6 @@ function connect() { }; socket.send_stages_approve = function (messageData) { - // TODO: Пометить сообщения как "системные" socket.send(JSON.stringify(messageData)); }; }); diff --git a/assets/js/src/chat_contractor_oop.js b/assets/js/src/chat_contractor_oop.js index 4bb146d..d018c8a 100644 --- a/assets/js/src/chat_contractor_oop.js +++ b/assets/js/src/chat_contractor_oop.js @@ -1,12 +1,14 @@ import {ChatPageController} from './chat/ChatContractorPageController' import { bindOrders, + bindOrderInfo, bindArbitrationSend, bindOnTabs, bindUserContacts, bindGetUserMessages, bindTeams, - bindDeleteContact + bindDeleteContact, + bindCtrlEnterSendMessage, } from './chat/BINDS' import { @@ -35,12 +37,14 @@ $(function () { }; window.chatController = new ChatPageController(); bindOrders(); + bindOrderInfo(); bindTeams(); bindOnTabs(); bindUserContacts(); bindGetUserMessages(); bindArchiveProjects(); bindDeleteContact(); + bindCtrlEnterSendMessage(); // Chats chatContactsInit(); diff --git a/assets/js/src/chat_customer_oop.js b/assets/js/src/chat_customer_oop.js index 293589b..960b045 100644 --- a/assets/js/src/chat_customer_oop.js +++ b/assets/js/src/chat_customer_oop.js @@ -1,18 +1,23 @@ import {ChatPageController} from './chat/ChatCustomerPageController' import { bindOrders, + bindOrderInfo, bindArbitrationSend, bindOnTabs, bindUserContacts, bindGetUserMessages, - bindDeleteContact + bindDeleteContact, + bindCtrlEnterSendMessage, } from './chat/BINDS' import {restoreTabFromHash} from './chat/parts' import {chatContactsInit, chatOrdersInit} from './chat/chats' +import {uploadDocumentsOrderInit, uploadDocumentsContactInit} from './chat/documents' import {connect} from './chat/wsChatConnect' +import {bindContractorNotes, bindOrderNotes} from './chat/notes' + import {bindArchiveProjects} from './chat/archiveProjects' window.connect = connect; @@ -33,15 +38,25 @@ $(function () { window.chatController = new ChatPageController(); bindOrders(); + bindOrderInfo(); bindOnTabs(); restoreTabFromHash(); bindUserContacts(); bindGetUserMessages(); bindArchiveProjects(); bindDeleteContact(); + bindCtrlEnterSendMessage(); //Chats chatContactsInit(); chatOrdersInit(); + //Documents + uploadDocumentsContactInit(); + uploadDocumentsOrderInit(); + + //Notes + bindContractorNotes(); + bindOrderNotes(); + }); \ No newline at end of file diff --git a/assets/js/trash/chat.js b/assets/js/trash/chat.js index c852baa..3cb18f6 100644 --- a/assets/js/trash/chat.js +++ b/assets/js/trash/chat.js @@ -203,7 +203,7 @@ $(function () { // $("a[href='#tab1']").trigger('click'); // } - // Информация о заказе + // Информация о заказе (copy) $(".messageBlock").on('click','.full-order-info', function (e) { e.preventDefault(); e.stopPropagation(); diff --git a/assets/js/trash/chat_customer.js b/assets/js/trash/chat_customer.js index 5d50d28..4e6f03e 100644 --- a/assets/js/trash/chat_customer.js +++ b/assets/js/trash/chat_customer.js @@ -504,6 +504,7 @@ $(function () { } }); + // Нечто непонятное $.ajax({ url: '/api/users/' + userId + '/', type: 'GET', diff --git a/assets/sass/modules/_mods.sass b/assets/sass/modules/_mods.sass index 2a53a00..8afd83f 100644 --- a/assets/sass/modules/_mods.sass +++ b/assets/sass/modules/_mods.sass @@ -26,3 +26,13 @@ display: -webkit-flex display: -ms-flexbox display: flex + +.mod-align-center-soft + display: flex + -ms-flex-align: center + -webkit-align-items: center + -webkit-box-align: center + align-items: center + &-inline + display: inline-flex + align-items: center \ No newline at end of file diff --git a/chat/serializers.py b/chat/serializers.py index e74fa59..b30c8f8 100644 --- a/chat/serializers.py +++ b/chat/serializers.py @@ -75,6 +75,7 @@ class NoteSerializer(ModelSerializer): model = Notes fields = ( + 'id', 'text', 'created', 'order', diff --git a/chat/static/sass/chat_add.sass b/chat/static/sass/chat_add.sass index 00ef1d4..021abfc 100644 --- a/chat/static/sass/chat_add.sass +++ b/chat/static/sass/chat_add.sass @@ -3,7 +3,7 @@ @import "base/colors" %icons - margin-left: 0px + margin-left: 0 display: inline-flex align-items: center &:before @@ -20,6 +20,14 @@ padding-left: 45px font-family: Arial, Verdana, Helvetica, sans-serif +.team-block + a:visited, a:link + color: #a8a8a8 + a.my-group + color: #3d3d3d + a:hover + color: black + ol li display: list-item @@ -35,10 +43,23 @@ ol .modal-header text-align: center +.fix-wrapper + width: 100% + padding-left: 15px + padding-right: 15px + +.switch + padding-left: 15px + // Системное сообщение .systemChat background-color: #ffe9ed +.numberStepp + border-bottom: 1px solid #CFCFCF + &:last-child + border-bottom: none + .review-type .alignleft float: left @@ -103,11 +124,11 @@ ol &.icon-change @extend %icons &:before - width: 20px + width: 24px height: 24px background: image: url("#{$static}/img/icons/icon_edit.png") - size: 20px 24px + size: 24px 24px repeat: no-repeat &.icon-credit_card @extend %icons @@ -149,23 +170,30 @@ ol a.btn.btn-send transition: all 0.3s - padding: 5px 25px !important + padding: 4px 25px !important background-color: white border: 1px solid #BEBEBE border-radius: 40px &:hover - transform: scale(1.04) - box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) + //transform: scale(1.04) + //box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) + background-color: #e6e6e6 + border-color: #adadad &.icon-send @extend %icons &:before - width: 25px - height: 25px + width: 20px + height: 20px background: image: url("#{$static}/img/icons/icon_arrow_gray.png") - size: 24px 24px + size: 20px 20px repeat: no-repeat +.upload-new p + font-family: 'pfdintextcomppro-regular', sans-serif !important + font-size: 15px !important + letter-spacing: 1px !important + .icon-protect display: inline-block @extend %icons @@ -186,16 +214,27 @@ a.btn.btn-send height: 20px left: 0 background: - image: url("#{$static}/img/icons/icon_pen_black.png") + image: url("#{$static}/img/icons/icon_hand_pen.png") size: 20px 20px repeat: no-repeat +.linkChat11:hover > .glyphicon-info-sign + color: red + .stage-data padding-left: 3px background-color: #f1f1f1 color: #8c8c8c font-size: 12px +.stage-header + white-space: nowrap + +.annotate + padding-top: 5px + color: #8c8c8c + font-size: 12px + .stage-status font-style: italic color: #5e5e5e diff --git a/chat/templates/chat_contractor.html b/chat/templates/chat_contractor.html index b12ad3f..634d017 100644 --- a/chat/templates/chat_contractor.html +++ b/chat/templates/chat_contractor.html @@ -12,7 +12,7 @@
    -

    Чат

    +

    Переговорная

    @@ -46,19 +46,21 @@
    -
    -
    +
    +
    - - Контакты - + + Контакты +
    -
    - {% for contact in contacts_users %} - {% include 'inc-contact-card.html' %} - {% endfor %} +
    + {% for contact in contacts_users %} + {% include 'inc-contact-card.html' %} + {% endfor %} +
    +
    @@ -67,7 +69,7 @@ - + @@ -86,17 +88,8 @@
    -
    +
    {% include 'partials/inc-attach-documents.html' with class='documentSpace' %} - {#

    Прикрепленные документы

    #} - {#
      #} - {#
    #} - {# #}
      @@ -125,35 +118,45 @@
      -
      -
      +
      +
      - - Заказы - + + Заказы +
      -
      - {% for order in orders %} - {% include 'partials/inc-order-card.html' %} - {% endfor %} +
      + {% for order in orders %} + {% include 'partials/inc-order-card.html' %} + {% endfor %} +
      - {% if archive_orders %} -
      - + {% if archive_orders %} + {# - - + {% endif %} +
      +
      @@ -183,7 +188,7 @@ - +
      @@ -211,9 +216,12 @@
      {# 1.Согласование условий #} -
      +
      -
      +
      {% include 'partials/inc-attach-documents.html' with class='documentSpace' %} - {#

      Прикрепленные документы

      #} - {#
        #} - {#
      #} - {# #} - {# Распечатать с помощью ресурса#} - {# #}
      @@ -143,8 +132,9 @@
      -
      -
      +
      +
      +
      Заказы @@ -152,31 +142,36 @@
      -
      - {% for order in orders %} - {% include 'partials/inc-order-card.html' %} - {% endfor %} +
      + {% for order in orders %} + {% include 'partials/inc-order-card.html' %} + {% endfor %} +
      - {% if archive_projects %} - {# #} - - -
      @@ -205,7 +202,7 @@ - +
      @@ -215,9 +212,11 @@ class="upload-new paper-clip">

      прикрепить файл

      -
      + {#
      #} отправить +
      +
      @@ -232,9 +231,10 @@
      {# 1.Согласование условий #} -
      +

      - 1. Согласование условий

      + 1. Согласование условий

      Обсуджение задания и условий выполнения работы. Подтверждение заказа исполнителем.

      @@ -243,10 +243,10 @@
      -
      -

      Количество этапов в данном проекте - -

      +
      +
      Количество этапов в данном проекте + +
      @@ -273,7 +273,7 @@
      diff --git a/chat/templates/partials/inc-attach-documents.html b/chat/templates/partials/inc-attach-documents.html index 7383c42..fb03f36 100644 --- a/chat/templates/partials/inc-attach-documents.html +++ b/chat/templates/partials/inc-attach-documents.html @@ -1,27 +1,27 @@ -

      Прикрепленные документы

      -
        -
        - +
        +

        Прикрепленные документы

        +
          +
          + +
          Распечатать с помощью ресурса + style="padding: 25px 10px"> + Распечатать с помощью ресурса +
          \ No newline at end of file diff --git a/chat/templates/partials/inc-team-card.html b/chat/templates/partials/inc-team-card.html index 6320580..b14ed06 100644 --- a/chat/templates/partials/inc-team-card.html +++ b/chat/templates/partials/inc-team-card.html @@ -5,7 +5,7 @@
          {{ yteam }} {% if yteam.owner.pk == request.user.pk %} - [Моя группа] {% endif %} + [Моя группа] {% endif %}
          {% get_new_count_for_team request.user yteam.id %} diff --git a/reviews/models.py b/reviews/models.py index bd7d9ef..02b9c53 100644 --- a/reviews/models.py +++ b/reviews/models.py @@ -12,7 +12,7 @@ TYPE_REVIEWS = ( class Review(models.Model): project = models.ForeignKey('projects.Project', related_name='reviews') type = models.CharField(max_length=30, choices=TYPE_REVIEWS, default='neutral') - text = models.TextField() + text = models.TextField(blank=True) created = models.DateTimeField(default=timezone.now) target_customer = models.ForeignKey('users.User', related_name='reviews_by_customer', null=True, blank=True) target_contractor = models.ForeignKey('users.User', related_name='reviews_by_contractor', null=True, blank=True) diff --git a/reviews/serializers.py b/reviews/serializers.py index 8da3904..547a7e3 100644 --- a/reviews/serializers.py +++ b/reviews/serializers.py @@ -7,6 +7,7 @@ from .models import Review class ReviewSerializer(ModelSerializer): target_user = serializers.SerializerMethodField(read_only=True) order = serializers.SerializerMethodField(read_only=True) + count_reviews = serializers.SerializerMethodField(read_only=True) class Meta: model = Review @@ -16,6 +17,7 @@ class ReviewSerializer(ModelSerializer): 'text', 'type', 'created', + 'count_reviews', 'project', 'from_customer', 'from_contractor', @@ -30,6 +32,9 @@ class ReviewSerializer(ModelSerializer): def get_order(self, obj): return obj.project.order.pk + def get_count_reviews(self, obj): + return Review.objects.filter(project=obj.project).count() + def get_target_user(self, obj): if obj.target_customer: return obj.target_customer.pk diff --git a/users/templates/contractor_office.html b/users/templates/contractor_office.html index 40acc72..72e6e6e 100644 --- a/users/templates/contractor_office.html +++ b/users/templates/contractor_office.html @@ -406,7 +406,7 @@ data: { sender_id: '{{ contractor.pk }}', recipent_id: String(contractor2Id), - chat_message: 'Приглашаю в группу "{{ contractor.team.name }}" Присоединиться', + chat_message: 'Приглашаю в группу "{{ contractor.team.name }}" ПрисоединитьсяОтказаться', }, }) diff --git a/users/urls.py b/users/urls.py index 4c6df3c..e5f9c70 100755 --- a/users/urls.py +++ b/users/urls.py @@ -2,6 +2,7 @@ from django.conf import urls from .views import ( AcceptTeamInvitation, + RefuseTeamInvitation, contractor_resumefile_create, ContractorChatProjectsView, ContractorFilterView, @@ -52,4 +53,6 @@ urlpatterns = [ name='create-team-invitation'), urls.url(r'^accept-team-invitation/(?P\d+)/$', AcceptTeamInvitation.as_view(), name='accept-team-invitation'), + urls.url(r'^refuse-team-invitation/(?P\d+)/$', RefuseTeamInvitation.as_view(), + name='refuse-team-invitation'), ] diff --git a/users/views.py b/users/views.py index 7c6c4f7..604653e 100644 --- a/users/views.py +++ b/users/views.py @@ -995,4 +995,10 @@ class AcceptTeamInvitation(NoCsrfMixin, ContractorRequiredMixin, View): else: raise Http404 + +class RefuseTeamInvitation(NoCsrfMixin, ContractorRequiredMixin, View): + + def get(self, request, *args, owner_id, **kwargs): + pass + # import code; code.interact(local=dict(globals(), **locals()))