@ -136,42 +136,13 @@
< / p >
< / div >
{# < div class = "stepssBlock box-sizing disTab" > #}
{# < p class = "textStepss" > #}
{# Какое кол-во этапов подразумевает работа? < input type = "text" id = "countStage" size = "3" / > #}
{# < / p > #}
{# < div id = "formsetStage" class = "numberStepp box-sizing" style = "display: none;" > #}
{# < div class = "insetNumStepp" id = "stage1" > #}
{# < p class = "titleNumStepp" > #}
{# < span > Этап < / span > #}
{# < / p > #}
{# < div class = "textAreaBlock2 box-sizing disTab" > #}
{# < form class = "new-stages-form" > #}
{# < label > Название< / label > #}
{# < input type = "text" name = "name" / > #}
{# < label > Результат< / label > #}
{# < input type = "text" name = "result" / > #}
{# < label > Стоимость< / label > #}
{# < input type = "text" name = "cost" / > #}
{# < input type = "hidden" name = "order" class = "orderStagesInput" / > #}
{# < / form > #}
{# < / div > #}
{# < / div > #}
{##}
{# < / div > #}
{##}
{# < / div > #}
{# < div class = "textAreaBlock2 FFD box-sizing disTab" > #}
{# < a href = "javascript:void()" > согласовать< / a > #}
{# < / div > #}
< div id = "order-stages" > < / div >
< div class = "stepssBlock box-sizing disTab" >
< p class = "titleStepss" > 2 / Резервирование< / p >
< p class = "textStepss" >
Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на сайте.
Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на
сайте.
< / p >
< div class = "textAreaBlock2 FFD box-sizing disTab" >
@ -185,7 +156,8 @@
< div class = "modal-dialog" style = "width:900px;" >
< div class = "modal-content" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > ×< / button >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > ×
< / button >
< h4 class = "modal-title" > Зарезервировать средства< / h4 >
< / div >
@ -216,13 +188,71 @@
< textarea id = "chat2" > < / textarea >
< a href = "javascript:void()" > сохранить< / a >
< / div >
< div class = "linkChatB box-sizing disTab" >
< a href = "javascript:void(0)" > предложить проект< / a >
< div class = "closeChat closeChat1" >
< a href = "#" data-toggle = "modal" data-target = "#review-add" >
Закрыть проект< br > и оставить отзыв
< / a >
< / div >
<!-- Review add -->
< div id = "review-add" class = "modal fade" role = "dialog" >
< div class = "modal-dialog" role = "document" style = "width:900px;" >
< div class = "modal-content" >
< div class = "modal-header" >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > ×
< / button >
< h4 class = "modal-title" > Оставить отзыв< / h4 >
< / div >
< form id = "review-adds-form" method = "POST" > {% csrf_token %}
< div class = "modal-body" >
< div style = "height: 250px;" >
< div class = "text-nn box-sizing disTab" >
< input type = "radio" value = "positive"
name="type">Положительный
< input type = "radio" value = "negative"
name="type">Отрицательный
< input type = "radio" value = "neutral"
name="type">Нейтральный
< / div >
< div class = "textAreaBlock2 text-nn box-sizing disTab" >
< textarea cols = "40" name = "text" rows = "10" > < / textarea >
< input type = "hidden" name = "from_customer" value = "{{ request.user.pk }}" / >
< input type = "hidden" name = "target_contractor" id = "targetContractorId" / >
< input type = "hidden" name = "project" id = "projectReviewId" / >
< / div >
< / div >
< / div >
< div class = "modal-footer" >
< button type = "button" class = "btn btn-default" data-dismiss = "modal" > Закрыть
< / button >
< button type = "submit" id = "order-review-add" class = "btn btn-primary" > Оставить отзыв< / button >
< / div >
< / form >
< / div >
< / div >
< / div >
<!-- -->
< / div >
< / div >
<!-- End block (chat order block) -->
< / div >
{% include 'partials/footer.html' %}
< / div >
< / div >
@ -272,7 +302,7 @@
$.each(json.results, function (i, v) {
if (v.status == "not_agreed") {
htmlInbox += '< div class = "numberStepp box-sizing" > ' +
'< p > Этап< / p > < form class = "update-stages-form" data-order-id = "'+ v.order + '" id = "stage-form-'+ v.pos +'" > ' +
'< p > Этап< / p > < form class = "update-stages-form" data-stage-id = "' + v.id + '" id = "stage-form-' + v.pos + '" > ' +
'< label for = "" > Название< / label > < input class = "form-control" type = "text" name = "name" value = "' + v.name + '" / > ' +
'< label for = "" > Цена< / label > < input class = "form-control" type = "text" name = "cost" value = "' + v.cost + '" / > ' +
'< input class = "form-control" type = "hidden" name = "order" value = "' + v.order + '" / > ' +
@ -300,6 +330,7 @@
}
});
}
setTimeout(function () {
$(".user-block").first().trigger('click');
}, 10);
@ -334,8 +365,7 @@
});
$(".update-stages-form").each(function (i, v) {
var currentStageId = parseInt($(this).attr('data-order-id'));
alert(currentStageId);
var currentStageId = parseInt($(this).attr('data-stage-id'));
$.ajax({
url: '/api/stages/' + currentStageId + '/',
type: 'PUT',
@ -355,8 +385,6 @@
});
var currentOrderId = $(this).attr('data-order-id');
currentOrderId = parseInt(currentOrderId);
getStages(currentOrderId);
@ -386,6 +414,8 @@
var orderId = $(this).attr('data-id');
var recipentId = $(this).attr('data-recipent-id');
$("#chat-order-add #orderId").val(orderId);
$("#projectReviewId").val(orderId);
$("#targetContractorId").val(recipentId);
$("#chat-order-add #recipentId").val(recipentId);
$(".orderStagesInput").val(orderId);
var inbox = document.getElementById('message-chat-order-space');
@ -411,70 +441,7 @@
});
}
});
getStages(orderId);
{# $.ajax({#}
{# url: '/api/stages/',#}
{# type: 'GET',#}
{# data: {csrfmiddlewaretoken: csrftoken, 'order': orderId},#}
{# dataType: 'json',#}
{# success: function (json) {#}
{# var stageCount = json.results.length;#}
{# if (stageCount == 0){#}
{# stageCountVal = 1;#}
{# }else{#}
{# stageCountVal = stageCount;#}
{# }#}
{##}
{# var htmlInbox = "";#}
{##}
{# var htmlInboxStage = '< p class = "textStepss" > Какое кол-во этапов подразумевает работа? ' +#}
{# '< input type = "text" id = "countStage" value = "'+ stageCountVal +'" size = "3" / > < / p > ';#}
{##}
{# if (stageCount == 0){#}
{# htmlInboxStage += '< div class = "numberStepp box-sizing" id = "stage1" > ' +#}
{# '< p > Этап < span class = "stage-span-id" > 1< / span > < / p > < form class = "new-stages-form" id = "stage-form" > ' +#}
{# '< label for = "" > Название< / label > < input class = "form-control" name = "name" type = "text" / > ' +#}
{# '< label for = "" > Цена< / label > < input class = "form-control" name = "cost" type = "text" / > ' +#}
{# '< input class = "form-control" name = "order" type = "hidden" value = "'+ orderId +'" class = "orderStagesInput" / > />' +#}
{# '< label for = "" > Срок< / label > < input class = "form-control" name = "term" type = "text" / > ' +#}
{# '< label for = "" > Результат< / label > < input class = "form-control" name = "result" type = "text" / > ' +#}
{# '< / form > < / div > ';#}
{# }#}
{# var statusNotAgreed = true;#}
{# $.each(json.results, function (i, v) {#}
{# if (v.status == "not_agreed") {#}
{# htmlInbox += '< div class = "numberStepp box-sizing" > ' +#}
{# '< p > Этап< / p > < form class = "update-stages-form" id = "stage-form-'+ v.pos +'" > ' +#}
{# '< label for = "" > Название< / label > < input class = "form-control" type = "text" value = "'+ v.name +'" / > ' +#}
{# '< label for = "" > Цена< / label > < input class = "form-control" type = "text" value = "'+ v.cost +'" / > ' +#}
{# '< input class = "form-control" type = "hidden" value = "'+ v.order +'" / > ' +#}
{# '< label for = "" > Срок< / label > < input class = "form-control" type = "text" value = "'+ v.term +'" / > ' +#}
{# '< label for = "" > Результат< / label > < input class = "form-control" type = "text" value = "'+ v.result +'" / > ' +#}
{# '< / form > < / div > ';#}
{# } else {#}
{# statusNotAgreed = false;#}
{# htmlInboxStage = "";#}
{# htmlInbox += '< div class = "numberStepp box-sizing" > < div class = "insetNumStepp" > ' +#}
{# '< p class = "titleNumStepp" > < span > Этап ' + v.pos + '< / span > ' + v.name + '< / p > ' +#}
{# '< p class = "textNumStepp" > Результаты этапа:' + v.result + '< / p > < div > ' +#}
{# '< p > до 16.03.2015< / p > < span > ' + v.cost + '< i class = "fa fa-rub" > < / i > < / span > < / div > < / div > < / div > ';#}
{##}
{# }#}
{# });#}
{##}
{# if (statusNotAgreed) {#}
{# htmlInbox += '< div class = "box-sizing disTab" style = "text-align:center;" > < div class = "checkbox" > < input type = "checkbox" style = "opacity:1" > Перейти в режим безопасной сделки' +#}
{# '< / div > < / div > < div class = "textAreaBlock2 box-sizing disTab" > ' +#}
{# '< a href = "javascript:void()" data-order-id = "'+ orderId +'" id = "addStagesForm" > отправить на согласование< / a > < / div > ';#}
{# }#}
{# htmlInbox = htmlInboxStage + htmlInbox;#}
{# $("#order-stages").html(htmlInbox);#}
{# }#}
{# });#}
});
// Вытащить сообщения для конактов
@ -527,6 +494,10 @@
$("#chat").val("");
});
$('#order-review-add').on('click', function(){
alert('add review');
});
$('#order-chat-add-message').on('click', function () {
var chatMessage = $("#chat-order-add #chat").val();
var recipentId = $("#chat-order-add #recipentId").val();
@ -550,9 +521,6 @@
});
var userId = '{{ request.user.pk }}';
var SocketHandler = function () {
var url = 'ws://127.0.0.1:8888/chat/' + userId + '/';