-
-
Заказы
- {% for torder in team_orders %}
-
-
-
- {{ torder }}
-
-
-
-{# Заказчик: {{ torder.project.customer }}#}
- Исполнитель: {{ torder.team.name }}
-
-
- {% for tuser in torder.team.users.all %}
- - {{ tuser }}
- {% endfor %}
-
-
-
- Чаты:
- {% for tuser in torder.team.users.all %}
- {% if request.user.pk != tuser.pk %}
- {{ tuser.username }},
- {% endif %}
- {% endfor %}
-
-
-
- Полное описание заказа
-
-
+
+
+ {% if team_orders %}
+
+
+
+
+
Заказы
+ {% for torder in team_orders %}
+
+
+
+ {{ torder }}
+
+
+
+ {# Заказчик: {{ torder.project.customer }}#}
+ Исполнитель: {{ torder.team.name }}
+
+
+ {% for tuser in torder.team.users.all %}
+ - {{ tuser }}
+ {% endfor %}
+
+
+
+ Чаты:
+ {% for tuser in torder.team.users.all %}
+ {% if request.user.pk != tuser.pk %}
+ {{ tuser.username }},
+ {% endif %}
+ {% endfor %}
+
+
+
+ Полное описание заказа
+
+
+
+ {% endfor %}
- {% endfor %}
-
-
-
- {% endif %}
+
+ {% endif %}
{% include 'partials/footer.html' %}
@@ -256,7 +274,7 @@
var domain = '{{ request.META.HTTP_HOST }}';
var port = '{{ request.META.SERVER_PORT }}';
domain = domain.replace(':' + port, '');
- var url = 'ws://' + domain +':8888/chat/' + userId + '/';
+ var url = 'ws://' + domain + ':8888/chat/' + userId + '/';
var sock = new WebSocket(url);
var intervalId;
sock.onopen = function () {
@@ -274,7 +292,7 @@
inbox = document.getElementById('message-chat-space');
} else if (message.answer_type == 'order' || message.answer_type == 'add_message_order') {
inbox = document.getElementById('message-chat-order-space');
- } else if(message.answer_type == 'add_message_team'){
+ } else if (message.answer_type == 'add_message_team') {
inbox = document.getElementById('message-chat-team-space');
}
console.log(message.answer_type);
@@ -294,7 +312,7 @@
console.log(data);
};
- this.add_team_message = function(messageData){
+ this.add_team_message = function (messageData) {
console.log(messageData);
sock.send(JSON.stringify(messageData));
@@ -327,16 +345,16 @@
var form = document.getElementById('message_form');
var csrftoken = getCookie('csrftoken');
- setTimeout(function(){
- $(".user-block").first().trigger('click');
+ setTimeout(function () {
+ $(".user-block").first().trigger('click');
}, 10);
- setTimeout(function(){
- $(".order-block").first().trigger('click');
+ setTimeout(function () {
+ $(".order-block").first().trigger('click');
}, 100);
- setTimeout(function(){
- $(".team-order-block").first().trigger('click');
+ setTimeout(function () {
+ $(".team-order-block").first().trigger('click');
}, 1000);
@@ -354,12 +372,13 @@
}
},
dataType: 'json',
- done: function (e, data) {;
+ done: function (e, data) {
+ ;
$.each(data.result.files, function (index, file) {
var currentValue = $("#documentSendIds").val();
currentValue += file.id + ';';
$("#documentSendIds").val(currentValue);
- var htmlImg = '
'+ file.name+'
';
+ var htmlImg = '
' + file.name + '
';
var document_send = $(htmlImg).appendTo("#document-send");
});
},
@@ -374,23 +393,23 @@
.parent().addClass($.support.fileInput ? undefined : 'disabled');
- $("#order-stages").on('click',"#approve-stages",function(e){
+ $("#order-stages").on('click', "#approve-stages", function (e) {
e.preventDefault();
- $(".stage-block-approve").each(function(){
- var stageId = $(this).attr('data-id');
+ $(".stage-block-approve").each(function () {
+ var stageId = $(this).attr('data-id');
$.ajax({
url: '/api/stages/' + stageId + '/',
type: 'PATCH',
- beforeSend: function(xhr){
+ beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'))
},
data: "status=in_process",
- dataType:'json',
- success: function(json){
+ dataType: 'json',
+ success: function (json) {
console.log(json);
},
- error: function(e){
+ error: function (e) {
console.log('error');
console.log(e);
}
@@ -399,13 +418,13 @@
});
});
- $(".team-chat-user").on('click',function(e){
+ $(".team-chat-user").on('click', function (e) {
e.stopPropagation();
var recipentId = $(this).attr('data-id');
$("#team-chat-form #recipentId").val(recipentId);
});
- $(".team-order-block").on('click', function(){
+ $(".team-order-block").on('click', function () {
$('.team-order-block').each(function () {
$(this).removeClass('orAct');
@@ -423,7 +442,7 @@
$.ajax({
url: '/api/message',
type: 'GET',
- data: {csrfmiddlewaretoken: csrftoken, 'team': teamId,'order': orderId},
+ data: {csrfmiddlewaretoken: csrftoken, 'team': teamId, 'order': orderId},
dataType: 'json',
success: function (json) {
$.each(json.results, function (i, v) {
@@ -489,7 +508,7 @@
console.log(json.results);
var noteHtmlInbox = '';
$.each(json.results, function (i, v) {
- noteHtmlInbox += '
'+ v.text +'';
+ noteHtmlInbox += '' + v.text + '';
});
$(".notes-block").html(noteHtmlInbox);
@@ -508,15 +527,15 @@
if (json.results.length > 0) {
$.each(json.results, function (i, v) {
- if(v.is_paid){
- stagesReservedHtml += 'Сумма за этап '+ i +'.Зарезервирована.';
- }else{
- stagesReservedHtml += '
Сумма за этап '+ i +'.Не зарезервирована.';
+ if (v.is_paid) {
+ stagesReservedHtml += '
Сумма за этап ' + i + '.Зарезервирована.';
+ } else {
+ stagesReservedHtml += '
Сумма за этап ' + i + '.Не зарезервирована.';
}
htmlInbox += '
' +
'
Этап ' + v.pos + '' + v.name + '
' +
'
Результаты этапа:' + v.result + '
' +
- '
'+ v.status+'
' + v.cost + '';
+ '
' + v.status + '
' + v.cost + '