diff --git a/api/views.py b/api/views.py index 27d998f..7fa861a 100755 --- a/api/views.py +++ b/api/views.py @@ -91,6 +91,7 @@ class ProjectViewSet(ModelViewSet): queryset = Project.objects.all() serializer_class = ProjectSerializer filter_class = ProjectFilterSet + # permission_classes = (permissions.IsAuthenticatedOrReadOnly,) class NoteViewSet(ModelViewSet): diff --git a/assets/css/extra.css b/assets/css/extra.css index ff82042..c01a8ac 100644 --- a/assets/css/extra.css +++ b/assets/css/extra.css @@ -164,3 +164,28 @@ top: 1px; } + + +.deleteOrder:after { + content: ''; + position: absolute; + width: 13px; + height: 13px; + background: url('../img/btn3.png') no-repeat center; + background-size: cover; + left: -30px; + top: 2px; +} + + +.deleteOrder, .deleteOrder:link, .deleteOrder:visited { + color: #5a5a5a; + font-size: 14px; + font-family: Arial, Verdana, Helvetica, sans-serif; + text-decoration: underline; + position: relative; + float: left; + margin: 0 0 0 35px; + font-style: italic; +} + diff --git a/assets/css/main.css b/assets/css/main.css index 1302101..46f23b6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -3416,6 +3416,19 @@ input[type="checkbox"]:checked + span { margin: 10px 0 20px 0; } +.textAreaBlock2 a, .textAreaBlock2 a:link, .textAreaBlock2 a:visited { + border: 1px solid #bebebe; + border-radius: 40px; + color: #373737; + display: inline-block; + font-family: "pfdintextcomppro-regular",sans-serif; + font-size: 15px; + letter-spacing: 2px; + margin-bottom: 20px; + padding: 12px 30px; + text-transform: uppercase; +} + .textAreaBlock2 a:not(.cke_button, .cke_combo_button, .cke_path_item), .textAreaBlock2 a:link:not(.cke_button, .cke_combo_button, .cke_path_item), .textAreaBlock2 a:visited:not(.cke_button, .cke_combo_button, .cke_path_item) { @@ -3692,7 +3705,7 @@ input[type="checkbox"]:checked + span { top: 0; } -.documentsChat ul li div { +.documentsChat ul li div , .remove-document{ position: absolute; width: 11px; height: 11px; diff --git a/assets/js/chat.js b/assets/js/chat.js index 5ee15de..b4f47b1 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -1,3 +1,34 @@ +window.confirm = function (message, callback, caption) { + caption = caption || '' + + $(document.createElement('div')).attr({ + title: caption, + 'class': 'dialog' + }).html(message).dialog({ + modal: true, + resizable: false, + height: "auto", + width: 400, + + buttons: { + "Отмена": function () { + $(this).dialog('close'); + return false; + }, + "OK": function () { + $(this).dialog('close'); + callback() + return true; + } + + }, + close: function () { + $(this).remove(); + }, + + }); +}; + var SocketHandler = function () { domain = domain.replace(':' + port, ''); var url = 'ws://' + domain + '/chat/' + userId + '/'; @@ -78,30 +109,47 @@ var socket = new SocketHandler(); var csrftoken = getCookie('csrftoken'); + +function test_dialog(message){ + var resStatus; + $("#dialog_delete .modal-title").html(message); + $("#dialog_delete").modal('show'); + $("#btnYes").click(function (e) { + $("#dialog_delete").modal('hide'); + resStatus = true; + }); + $("#btnNot").click(function (e) { + $("#dialog_delete").modal('hide'); + resStatus = false; + }); + return resStatus; +} + $(function () { - function dialog(message, yesCallback, notCallback) { +function dialog (message, yesCallback, notCallback) { $("#dialog_delete .modal-title").html(message); - var dialog = $("#dialog_delete").modal('show'); - $("#btnYes").click(function () { + $("#dialog_delete").modal('show'); + $("#btnYes").click(function (e) { + e.preventDefault(); yesCallback(); $("#dialog_delete").modal('hide'); }); - $("#btnNot").click(function () { + $("#btnNot").click(function (e) { + e.preventDefault(); notCallback(); $("#dialog_delete").modal('hide'); }); - } - +} var currentHash = URI(location.href).hash(); $('a[data-toggle="tab"]').on('show.bs.tab', function (e) { var activeTab = $(this).attr('href').substring(1); var liveHash = URI(location.href).hash(); - switch(activeTab){ + switch (activeTab) { case 'tab1': setTimeout(function () { - if(liveHash.indexOf("#user") == 0) { + if (liveHash.indexOf("#user") == 0) { var userHashId = liveHash.replace("#user", ""); $("#userBlock" + userHashId).trigger('click'); } else { @@ -112,7 +160,7 @@ $(function () { case 'tab2': setTimeout(function () { - if(liveHash.indexOf("#order") == 0) { + if (liveHash.indexOf("#order") == 0) { var ordHashId = liveHash.replace("#order", ""); $("#orderBlock" + ordHashId).trigger('click'); } else { @@ -123,18 +171,18 @@ $(function () { case 'tab3': setTimeout(function () { - if(liveHash.indexOf("#teamorder") == 0) { + if (liveHash.indexOf("#teamorder") == 0) { var teamHashId = liveHash.replace("#teamorder", ""); $("#teamOrderBlock" + teamHashId).trigger('click'); - } else if(liveHash.indexOf("#myteam") == 0){ + } else if (liveHash.indexOf("#myteam") == 0) { var teamHashId = liveHash.replace("#myteam", ""); $("#teamMyBlock" + teamHashId).trigger('click'); } else { var firstTeamBlock = $(".team-block").first(); var firstTeamOrder = $(".team-order-block").first(); - if (firstTeamOrder.length == 1){ + if (firstTeamOrder.length == 1) { firstTeamOrder.trigger('click'); - } else if(firstTeamBlock.length == 1){ + } else if (firstTeamBlock.length == 1) { firstTeamBlock.trigger('click'); } } @@ -146,7 +194,7 @@ $(function () { if (currentHash.indexOf("#order") == 0) { $("a[href='#tab2']").trigger('click'); - } else if(currentHash.indexOf("#user") == 0){ + } else if (currentHash.indexOf("#user") == 0) { $("a[href='#tab1']").trigger('click'); } else if (currentHash.indexOf("#teamorder") == 0 || currentHash.indexOf("#myteam") == 0) { $("a[href='#tab3']").trigger('click'); @@ -154,6 +202,33 @@ $(function () { $("a[href='#tab1']").trigger('click'); } + $("#trashed-button").on('click',function(e){ + e.preventDefault(); + var trashedOrderHtml = ""; + $.ajax({ + url: '/api/orders/', + type: 'GET', + dataType: 'json', + success: function(json){ + console.log(json.results); + $.each(json.results, function(i, v){ + var temp = '
'+ v.project.name +'
' + + 'Исполнитель:
' + + '' + + 'Полное описание заказаСрок сдачи ' + stage.term + ' ' + stage.cost + '
Этап ожидает завершения статуса от заказчика
Какое кол-во этапов подразумевает работа? ' + + '
'; + + if (stageCount == 0) { + htmlInboxStage += 'Этап 1
Этап
Этап ' + v.pos + '' + v.name + '
' + + 'Результаты этапа:' + v.result + '
Срок до ' + v.term + '
' + v.cost + '' + + 'Cрок заказа рассчитывается с момента резервирования средств
' + + '' + statusName + '
В работе ' + stage.name + '
Результат этапа : ' + stage.result + '
Срок сдачи ' + stage.term + '
' + stage.cost + 'Этап ' + pos + '
' + senderName + '
' + v.created + '' + v.text + '
Архивные заказы
+ +