diff --git a/assets/css/extra.css b/assets/css/extra.css index c01a8ac..1e5a2b2 100644 --- a/assets/css/extra.css +++ b/assets/css/extra.css @@ -189,3 +189,54 @@ font-style: italic; } + +.trashedOrderBlock { + width: 100%; + float: left; + margin-bottom: -1px; + padding: 15px; + background-color: #F7F7F7; + border-top: 1px solid #72767C; + border-bottom: 1px solid #72767C; + position: relative; + cursor: pointer; + -webkit-transition: all 0.3s ease-out; + -moz-transition: all 0.3s ease-out; + transition: all 0.3s ease-out; +} + +.trashedOrderBlock:hover { + background-color: white; + border-top: 1px solid black; + border-bottom: 1px solid black; + -webkit-transform: scale(1.03); + -moz- transform: scale(1.03); + transform: scale(1.03); + box-shadow: 0 0 10px rgba(0,0,0,0.7); + z-index: 999; +} + + +.count-tab{ + margin-left: 10px; + width: 35px; + height: 35px; + border-radius: 100%; + line-height: 35px; + text-align: center; + font-size: 14px; + font-family: 'Arial-MT-Regular', sans-serif; + position: absolute; + top: 14px; + cursor: pointer; + -webkit-transition: all 0.3s ease-out; + -moz-transition: all 0.3s ease-out; + transition: all 0.3s ease-out; + background-color: #ebebeb; +} + +li a:active .count-tab, li a:hover .count-tab{ + background-color: #FF0027; + color: white; +} + diff --git a/assets/css/main.css b/assets/css/main.css index 74e4f76..62ed7f3 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -827,9 +827,8 @@ footer:after { box-shadow: 0 0 10px rgba(0,0,0,0.7); } -.projectPro:hover .titlePro { - color: #fb2c2d; - text-decoration: underline; +.titlePro a:hover { + text-decoration: underline !important; } .projectPro:hover .leftPro:before { @@ -2279,14 +2278,14 @@ input[type="checkbox"]:checked + span { height: 22px; background: url('../img/listExecutor.png') no-repeat left; background-size: cover; - background-position: 0 -18px; + background-position: 0 -19px; } .listExecutor li:last-child a:before { height: 19px; background: url('../img/listExecutor.png') no-repeat left; background-size: cover; - background-position: 0 -47px; + background-position: 0 -48px; } .doneBlock { @@ -2777,14 +2776,16 @@ input[type="checkbox"]:checked + span { cursor: move; } -.compTable tr:hover:not(:first-child) { +.compTable tr:hover { z-index: 999; - display: flex; + display: table-row; position: relative; - -webkit-transform: scale(1.04); - -moz-transform: scale(1.04); - transform: scale(1.04); - box-shadow: 0 0 10px rgba(0,0,0,0.8); + -webkit-transform: scale(1.02); + -moz-transform: scale(1.02); + transform: scale(1.02); + /*box-shadow: 0 0 10px rgba(0,0,0,0.8);*/ + outline: 1px solid #DAD9D9; + cursor: move; } .compTable tr:hover td:first-child { @@ -2804,10 +2805,15 @@ input[type="checkbox"]:checked + span { border-bottom: 1px solid #DAD9D9 !important; } -.compTable tr th, .compTable tr td { - display: block; +/*.compTable tr th, .compTable tr td { + display: block float: left; text-align: center; +}*/ +.compTable tr th, .compTable tr td { + display: table-cell; + vertical-align: middle; + text-align: center; } .compTable tr th:first-child, @@ -2909,7 +2915,7 @@ input[type="checkbox"]:checked + span { .compTable tr td:nth-child(6) ul { float: left; - margin: 29px 0 0 72px; + margin: 0px 0 0 72px; } .compTable tr td:nth-child(6) ul li { @@ -2974,7 +2980,6 @@ input[type="checkbox"]:checked + span { font-weight: bold; font-family: Arial, Verdana, Helvetica, sans-serif; position: relative; - margin-bottom: 20px; position: relative; width: 100%; float: left; @@ -3711,7 +3716,7 @@ input[type="checkbox"]:checked + span { height: 11px; background: url('../img/delDoc.png') no-repeat center; background-size: cover; - right: -40px; + right: -20px !important; top: 2px; cursor: pointer; } @@ -4868,6 +4873,7 @@ input[type="checkbox"]:checked + span { .inset-mb { display: table; float: left; + margin-left: 15px; } .inset-mb:first-child { @@ -5059,7 +5065,7 @@ input[type="radio"]:checked + span { .list-summ li:nth-child(3):before { width: 22px; height: 22px; - background: url('../img/chat.png') no-repeat center; + background: url('../img/skype.png') no-repeat center; background-size: cover; left: -42px; top: 0; @@ -5998,7 +6004,7 @@ a.linkS2[data-target="#withdraw-money"]{ } input[type="radio"]{ - opacity: 1; + opacity: 0; } .wr-inset-pluss{ @@ -6020,8 +6026,6 @@ input[type="radio"]{ } .welcomeMain{ line-height: 48px; - font-family: 'pfdintextcomppro-regular', sans-serif; - font-size: 43.5px; } .menuUser > div{ padding: 10px 0; @@ -6048,4 +6052,60 @@ input[type="radio"]{ -moz-transform: scale(1.04); transform: scale(1.04); } +.new-rass2 .btn-submit-link{ + display: table; + margin: 15px 0px 15px -15px !important; +} +button[data-id="stagesSelect"], button[data-id="stagesSelect"]:hover{ + outline: 1px solid #ccc !important; + margin-top: 13px; +} +.polsF1 .linkS122, .polsF1 .linkS122:hover{ + font-family: 'pfdintextcomppro-regular', sans-serif; + letter-spacing: 2px; + text-transform: uppercase; + border: none; + border-radius: 40px; + display: inline-block; + color: #fff; + padding: 12px 30px; + font-size: 15px; + margin-bottom: 20px; + background-color: #FE0029 !important; + width: 300px; + margin-bottom: 0; +} +#paymentfromSite, #paymentfromSite:hover{ + font-family: 'pfdintextcomppro-regular', sans-serif; + letter-spacing: 2px; + text-transform: uppercase; + border: 1px solid #BEBEBE; + border-radius: 40px; + display: inline-block; + color: #373737; + padding: 12px 30px; + font-size: 15px; + margin-top: 20px; + margin-bottom: 20px; + background: transparent; + width: 300px; +} +li.officeList.icon_tml > a > p{ + display: inline-block; + padding: 5px 7px 3px 7px; + background: #ff0000; + border-radius: 35px; + position: absolute; + right: -34px; + top: -4px; +} +.comm44 > div{ + padding: 15px; +} +.logo + .badge{ + padding: 7px; + margin-top: 5px; + border-radius: 15px; + background-color: #00BB7B; +} /*end_new*/ diff --git a/assets/js/chat.js b/assets/js/chat.js index 3bb7d75..e47ffb5 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -64,7 +64,7 @@ var SocketHandler = function () { } else if (message.answer_type == 'approve_stages') { var resOrderId = message.order_id; $.jGrowl(message.msg, { - life: 4000 + life: 15000 }); setTimeout(function () { $("#orderBlock" + resOrderId).trigger('click'); @@ -185,51 +185,6 @@ function dialog (message, yesCallback, notCallback) { } - - $(".messageBlock").on('click','.trashedOrderBlock',function(){ - $("#chat-order-add").css("display", "none"); - $('.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 = ''; - var orderId = $(this).attr('data-id'); - location.hash = '#order' + orderId; - - $.ajax({ - url: '/api/message', - type: 'GET', - data: {csrfmiddlewaretoken: csrftoken, '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(); - - }); - // Информация о заказе $(".messageBlock").on('click','.full-order-info', function (e) { e.preventDefault(); @@ -608,15 +563,14 @@ function dialog (message, yesCallback, notCallback) { var recipentId = $("#chat-order-add #recipentId").val(); var senderId = $("#chat-order-add #senderId").val(); var orderId = $("#chat-order-add #orderId").val(); - - if (chatMessage) { - var sendLinks = $("#document-send-order a"); + var sendLinks = $("#document-send-order a"); + if (chatMessage || sendLinks.length > 0) { var sendLinkIds = ""; var documentLinks = ""; var documentAttachFiles = ""; $.each(sendLinks, function (i, v) { sendLinkIds += $(this).attr('data-id') + ';'; - documentLinks += 'Входящий файл:
'+ $(this).text() +'
'; + documentLinks += 'Приложенный файл. скачать:
'+ $(this).text() +'
'; documentAttachFiles += '
  • ' + '' + $(this).text() + '' + '
  • '; @@ -650,16 +604,18 @@ function dialog (message, yesCallback, notCallback) { var chatMessage = $("#chat").val(); var recipentId = $("#recipentContactId").val(); var senderId = $("#senderContactId").val(); - if (chatMessage) { + var sendLinks = $("#document-send-contact a"); + + if (chatMessage || sendLinks.length > 0) { $("#contact-chat-form .errorEmptyMessage").hide(); - var sendLinks = $("#document-send-contact a"); + var sendLinkIds = ""; var documentLinks = ""; var documentAttachFiles = ""; $.each(sendLinks, function (i, v) { sendLinkIds += $(this).attr('data-id') + ';'; - documentLinks += 'Входящий файл:
    '+ $(this).text() +'
    '; + documentLinks += 'Приложенный файл. скачать:
    '+ $(this).text() +'
    '; documentAttachFiles += '
  • ' + '' + $(this).text() + '' + '
  • '; diff --git a/assets/js/chat_contractor.js b/assets/js/chat_contractor.js index 5ba73f1..778baa0 100644 --- a/assets/js/chat_contractor.js +++ b/assets/js/chat_contractor.js @@ -588,15 +588,14 @@ $(function () { var orderId = $("#team-chat-form #orderTeamId").val(); var documentSendIds = $("#documentSendIds").val(); var teamIds = $("#team-chat-form #teamIds").val(); - - if (chatMessage) { - var sendLinks = $("#document-send a"); + var sendLinks = $("#document-send a"); + if (chatMessage || sendLinks.length > 0) { var sendLinkIds = ""; var documentLinks = ""; var documentAttachFiles = ""; $.each(sendLinks, function (i, v) { sendLinkIds += $(this).attr('data-id') + ';'; - documentLinks += 'Входящий файл:
    ' + $(this).text() + '
    '; + documentLinks += 'Приложенный файл. скачать:
    ' + $(this).text() + '
    '; documentAttachFiles += '
  • ' + '' + $(this).text() + '' + '
  • '; @@ -622,6 +621,8 @@ $(function () { $("#team-chat-form #chatText").val(""); $("#document-send").html(""); $("#documentSendIds").val(""); + } else { + $("#team-chat-form .errorEmptyMessage").show(); } }); diff --git a/assets/js/chat_customer.js b/assets/js/chat_customer.js index 97779b4..988eeb7 100644 --- a/assets/js/chat_customer.js +++ b/assets/js/chat_customer.js @@ -137,7 +137,7 @@ $(function () { '

    Этап

    ' + '

    ' + '

    ' + - '

    ' + + '

    ' + '' + '' + '

    ' + @@ -303,6 +303,7 @@ $(function () { $(".new-stages-form").each(function (i, v) { var _this = $(this); + console.log($(this).serialize()); $.ajax({ url: '/api/stages/', type: 'POST', @@ -332,7 +333,7 @@ $(function () { $(".update-stages-form").each(function (i, v) { var _this = $(this); var currentStageId = parseInt($(this).attr('data-stage-id')); - + console.log($(this).serialize()); $.ajax({ url: '/api/stages/' + currentStageId + '/', type: 'PUT', @@ -366,6 +367,7 @@ $(function () { "msg": "Этапы для заказа " + currentOrderId + " изменены", } }); + $.jGrowl("Этапы для заказа изменены и отправлены исполнителю", { life: 15000}); }); @@ -390,7 +392,7 @@ $(function () { '' + '

    ' + '

    ' + - '
    '; + ''; lastFormStage.after(addFormTemplate); } @@ -408,7 +410,7 @@ $(function () { } }); - + // Нажимаем на кнопку архивные сообщения $("#trashed-button").on('click',function(e){ e.preventDefault(); var state = $(this).attr('data-show'); @@ -452,6 +454,50 @@ $(function () { }); + // Нажимаем на заказ в архмвных заказах + $(".messageBlock").on('click','.trashedOrderBlock',function(){ + $("#chat-order-add").css("display", "none"); + $('.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 = ''; + var orderId = $(this).attr('data-id'); + location.hash = '#order' + orderId; + + $.ajax({ + url: '/api/message', + type: 'GET', + data: {csrfmiddlewaretoken: csrftoken, '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(); + }); // Для заказов все вытащить $('.order-block').on('click', function () { diff --git a/chat/chat.py b/chat/chat.py index 3d6ab48..57786f5 100644 --- a/chat/chat.py +++ b/chat/chat.py @@ -24,12 +24,13 @@ class ChatHandler(websocket.WebSocketHandler): waiters = set() def open(self, *args, **kwargs): - self.user_id = kwargs.get('user_id',1) + self.user_id = kwargs.get('user_id', 1) self.waiters.add((self.user_id, self)) # @gen.coroutine def on_message(self, message): parsed = escape.json_decode(message) + if 'dummy' in parsed: return @@ -50,9 +51,10 @@ class ChatHandler(websocket.WebSocketHandler): # order_id = data['data'].get('order_id') # message = data['data'].get('msg', 'Этапы обновлены') # answer_type = data['format_type'] - # waiters = tuple(w for c, w in self.waiters if c == recipent_id or c == sender_id) + # waiters = tuple(w for c, w in self.waiters if c == recipent_id) # for waiter in waiters: - # waiter.write_message({'msg': message, 'order_id': order_id, 'answer_type': answer_type}) + # print(waiter) + # # waiter.write_message({'msg': message, 'order_id': order_id, 'answer_type': answer_type}) @gen.coroutine def add_message(self, message_data): @@ -127,7 +129,11 @@ class ChatHandler(websocket.WebSocketHandler): if docs_links: message += '

    ' + docs_links; - waiters = tuple(w for c, w in self.waiters if c == recipent_id or c == sender_id) + if message_type: + waiters = tuple(w for c, w in self.waiters if c == recipent_id) + else: + waiters = tuple(w for c, w in self.waiters if c == recipent_id or c == sender_id) + for waiter in waiters: waiter.write_message({'msg': message, 'msg_time': msg_time, diff --git a/chat/serializers.py b/chat/serializers.py index 31c153c..3a38ce3 100644 --- a/chat/serializers.py +++ b/chat/serializers.py @@ -63,7 +63,7 @@ class MessageSerializer(ModelSerializer): out = obj.text documents = obj.documents.all() if len(documents)>0: - documents_str = '
    '.join(['Входящий файл:
    ' + doc.file.name + '' for doc in documents]) + documents_str = '
    '.join(['Приложенный файл. скачать:
    ' + doc.file.name + '' for doc in documents]) out += '

    ' + documents_str return out diff --git a/chat/templates/chat_contractor.html b/chat/templates/chat_contractor.html index 095e7fd..75d7a3d 100644 --- a/chat/templates/chat_contractor.html +++ b/chat/templates/chat_contractor.html @@ -1,12 +1,13 @@ {% extends 'partials/base.html' %} {% load staticfiles %} {% load thumbnail %} +{% load user_tags %} {% block content %} {% include 'partials/header.html' %}
    -

    Чат {{ request.user }} {{ request.user.pk }}

    +

    Чат

    @@ -16,15 +17,15 @@ @@ -56,8 +57,8 @@

    Контакты - - 0 + + {% get_new_count_for_contact contact request.user %} Удалить контакт @@ -320,6 +321,7 @@ +
    diff --git a/chat/templates/chat_customer.html b/chat/templates/chat_customer.html index 629f840..f95ad57 100644 --- a/chat/templates/chat_customer.html +++ b/chat/templates/chat_customer.html @@ -1,12 +1,13 @@ {% extends 'partials/base.html' %} {% load staticfiles %} {% load thumbnail %} +{% load user_tags %} {% block content %} {% include 'partials/header.html' %}
    -

    Чат {{ request.user.get_score }}

    +

    Чат

    @@ -14,10 +15,11 @@ @@ -52,7 +54,9 @@ Контакты - 0 + + {% get_new_count_for_contact contact request.user %} + Удалить контакт diff --git a/chat/templates/reverse_stage_modal.html b/chat/templates/reverse_stage_modal.html index e761baf..6cd9b82 100644 --- a/chat/templates/reverse_stage_modal.html +++ b/chat/templates/reverse_stage_modal.html @@ -37,7 +37,7 @@
    -
    @@ -45,8 +45,8 @@

    Резервирование средств

    {% csrf_token %} -
    @@ -82,21 +84,27 @@
    - {{ form.term_type }} +
    + {{ form.term_type }} +
    -
    -

    Вид строительства {{ form.construction_type.errors.as_text }}

    - {{ form.construction_type }} +
    +
    +

    Вид строительства {{ form.construction_type.errors.as_text }}

    + {{ form.construction_type }} +
    -
    -

    Классификация здания {{ form.building_classification.errors.as_text }}

    - {{ form.building_classification }} +
    +
    +

    Классификация здания {{ form.building_classification.errors.as_text }}

    + {{ form.building_classification }} +
    @@ -130,13 +138,13 @@
    - - @@ -144,7 +152,7 @@
    -