diff --git a/assets/css/bootstrap.css b/assets/css/bootstrap.css index b561aab..2dec3e0 100644 --- a/assets/css/bootstrap.css +++ b/assets/css/bootstrap.css @@ -3610,13 +3610,13 @@ tbody.collapse.in { right: 0; left: auto; } -.dropup .caret, +/*.dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; content: ""; -} +}*/ .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; diff --git a/assets/css/main.css b/assets/css/main.css index 209a229..a7244a3 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1115,7 +1115,7 @@ footer:after { } .titleF1 { - margin: 0 0 23px 0; + margin: 23px 0 0 0; } .titleF1, .polsF1, .searchF1, .resSearchF1, .sro { @@ -1133,7 +1133,7 @@ footer:after { .polsF1 .btn-group .btn { width: 100% !important; - padding: 15px 105px 15px 18px; + padding: 15px 30px 15px 18px; border-radius: 0 !important; border: none; font-size: 15px; @@ -1220,9 +1220,9 @@ footer:after { margin-bottom: 0; } -.polsF1 .dropdown-menu li:first-child { +/*.polsF1 .dropdown-menu li:first-child { margin-top: -6px; -} +}*/ .polsF1 .dropdown-menu li:last-child { margin-bottom: 2px; @@ -5441,7 +5441,7 @@ input[type="radio"]:checked + span { position: absolute; font-family: 'Glyphicons Halflings'; right: -6.5px; - top: -21px; + top: -19px; font-size: 12px; } @@ -5600,7 +5600,12 @@ input[type="radio"]:checked + span { background-color: white; } .select2-container .select2-choice .select2-arrow{ - display: none; + background: #fff; + border: none; +} +.select2-container .select2-choice .select2-arrow b{ + position: relative; + top: 9px; } .select2-container .select2-choice > .select2-chosen { margin-right: 6px; @@ -5676,4 +5681,26 @@ input[type="radio"]:checked + span { .progress-bar-success { background-color: #c2c2c2; } +.bootstrap-select.btn-group .dropdown-menu li { + position: relative; + float: left; + width: 100%; +} +#order-stages label{ + margin-bottom: 0; + margin-top: 8px; +} +#order-stages .checkbox label{ + margin-top: 0; +} +#order-stages > div { + display: table; + width: 100%; + padding-bottom: 14px; + border-bottom: 1px solid #2c2c2c; + margin-bottom: 14px; +} +#order-stages > div:nth-last-child(2), #order-stages > div:last-child{ + border: none; +} /*end_new*/ \ No newline at end of file diff --git a/chat/templates/chat_customer.html b/chat/templates/chat_customer.html index babae49..98980f0 100644 --- a/chat/templates/chat_customer.html +++ b/chat/templates/chat_customer.html @@ -24,7 +24,7 @@
- +
- + - +
@@ -117,9 +138,9 @@

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

- - Не более 10 файлов с общим объемом 500мб - + + Не более 10 файлов с общим объемом 500мб +
отправить
@@ -136,79 +157,51 @@

-{#
#} -{#

#} -{# Какое кол-во этапов подразумевает работа? #} -{#

#} -{# #} -{##} -{#
#} -{# #} - -
+
-

2 / Резервирование

-

- Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на сайте. -

+

2 / Резервирование

+

+ Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на + сайте. +

+ Зарезирвировать +
-
+
-
@@ -238,38 +293,133 @@ var form = document.getElementById('message_form'); var csrftoken = getCookie('csrftoken'); + function 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 = '

Какое кол-во этапов подразумевает работа? ' + + '

'; + + if (stageCount == 0) { + htmlInboxStage += '
' + + '

Этап 1

' + + '' + + '' + + // ' />' + + '' + + '' + + '
'; + } + var statusNotAgreed = true; + $.each(json.results, function (i, v) { + if (v.status == "not_agreed") { + htmlInbox += '
' + + '

Этап

' + + '' + + '' + + '' + + '' + + '' + + '
'; + } else { + statusNotAgreed = false; + htmlInboxStage = ""; + htmlInbox += '
' + + '

Этап ' + v.pos + '' + v.name + '

' + + '

Результаты этапа:' + v.result + '

' + + '

до 16.03.2015

' + v.cost + '
'; + + } + }); + + if (statusNotAgreed) { + htmlInbox += '
Перейти в режим безопасной сделки' + + '
' + + 'отправить на согласование
'; + } + htmlInbox = htmlInboxStage + htmlInbox; + $("#order-stages").html(htmlInbox); + } + }); + } + + setTimeout(function () { + $(".user-block").first().trigger('click'); + }, 10); + + setTimeout(function () { + $(".order-block").first().trigger('click'); + }, 100); - $("#order-stages").on('click', "#addStagesForm", function(){ - $(".new-stages-form").each(function(i,v){ - console.log($(this).serialize()); - alert($(this).serialize()); + $("#order-stages").on('click', "#addStagesForm", function (e) { + e.preventDefault(); + $(".new-stages-form").each(function (i, v) { + console.log($(this).serialize()); - $.ajax({ + $.ajax({ url: '/api/stages/', type: 'POST', beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) }, - data:$(this).serialize(), + data: $(this).serialize(), + dataType: 'json', + success: function (json) { + console.log(json); + + }, + error: function (e) { + console.log('error'); + console.log(e); + } + }); + + }); + + $(".update-stages-form").each(function (i, v) { + var currentStageId = parseInt($(this).attr('data-stage-id')); + $.ajax({ + url: '/api/stages/' + currentStageId + '/', + type: 'PUT', + beforeSend: function (xhr) { + xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) + }, + data: $(this).serialize(), dataType: 'json', success: function (json) { console.log(json); }, - error: function(e){ + error: function (e) { console.log('error'); console.log(e); } }); + }); + + + var currentOrderId = $(this).attr('data-order-id'); + currentOrderId = parseInt(currentOrderId); + getStages(currentOrderId); + - }); }); - $('#order-stages-tab').on('change', '#countStage', function(){ + $('#order-stages-tab').on('change', '#countStage', function () { var countStage = parseInt($(this).val()); var updateFormStages = $(".update-stages-form"); - - alert(updateFormStages.length); - alert(typeof updateFormStages.length); var limitCount = countStage + 1; for (var i = 2; i < limitCount; i++) { var stageCopy = $("#stage1").clone().attr("id", "stage" + i).addClass("stages_form"); @@ -277,10 +427,9 @@ } }); - $('.order-block').on('click', function () { $("#chat-order-add").css("display", "block"); - $("#formsetStage").css("display","block"); + $("#formsetStage").css("display", "block"); $('.order-block').each(function () { $(this).removeClass('orAct'); @@ -290,6 +439,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'); @@ -315,71 +466,9 @@ }); } }); - - $.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 = '

Какое кол-во этапов подразумевает работа? ' + - '

'; - - if (stageCount == 0){ - htmlInboxStage += '
' + - '

Этап 1

' + - '' + - '' + - ' />' + - '' + - '' + - '
'; - } - var statusNotAgreed = true; - $.each(json.results, function (i, v) { - if (v.status == "not_agreed") { - htmlInbox += '
' + - '

Этап

' + - '' + - '' + - '' + - '' + - '' + - '
'; - } else { - statusNotAgreed = false; - htmlInboxStage = ""; - htmlInbox += '
' + - '

Этап ' + v.pos + '' + v.name + '

' + - '

Результаты этапа:' + v.result + '

' + - '

до 16.03.2015

' + v.cost + '
'; - - } - }); - - if (statusNotAgreed) { - htmlInbox += '
Перейти в режим безопасной сделки' + - '
' + - 'отправить на согласование
'; - } - htmlInbox = htmlInboxStage + htmlInbox; - $("#order-stages").html(htmlInbox); - } - }); - - + getStages(orderId); }); - // Вытащить сообщения для конактов $('.user-block').on('click', function () { var userId = $(this).attr('data-id'); @@ -430,6 +519,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(); @@ -452,10 +545,13 @@ }); - var userId = '{{ request.user.pk }}'; + var userId = '{{ request.user.pk }}'; var SocketHandler = function () { - var url = 'ws://127.0.0.1:8888/chat/' + userId + '/'; + var domain = '{{ request.META.HTTP_HOST }}'; + var port = '{{ request.META.SERVER_PORT }}'; + domain = domain.replace(':' + port, ''); + var url = 'ws://' + domain + ':8888/chat/' + userId + '/'; var sock = new WebSocket(url); var intervalId; sock.onopen = function () {