diff --git a/assets/index.js b/assets/index.js index eb6b5ec..12a62af 100644 --- a/assets/index.js +++ b/assets/index.js @@ -196,6 +196,43 @@ function initSimpleSpecSelect2($select, specId) { +// Team invitation contractor select ------------------------------- + + +var contractorSelectOptions = { + language: 'ru', + placeholder: 'Выберите пользователя', // Required by `allowClear` + allowClear: true, +} + +function initContractorSelect($select) { + return $.ajax({url: '/api/users/?is_contractor=true', method: 'GET', dataType: 'json'}) + .then(function(res) { + var contractors = res.results + + $select.select2(_.merge(contractorSelectOptions, { + data: _.map(function(contractor) { + return { + id: contractor.id, + text: contractor.username, + origItem: contractor, + } + }, contractors), + })) + }) +} + + + + + + + + + + + + // Location select ---------------------------------------------- diff --git a/assets/js/chat.js b/assets/js/chat.js index f38847e..320f51c 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -1,6 +1,6 @@ var SocketHandler = function () { domain = domain.replace(':' + port, ''); - var url = 'ws://' + domain + '/chat/' + userId + '/'; + var url = 'ws://' + domain + ':8888/chat/' + userId + '/'; var sock = new WebSocket(url); var intervalId; sock.onopen = function () { diff --git a/common/migrations/0014_auto_20160906_1713.py b/common/migrations/0014_auto_20160906_1713.py new file mode 100644 index 0000000..b71874c --- /dev/null +++ b/common/migrations/0014_auto_20160906_1713.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-09-06 14:13 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0013_liveimageupload'), + ] + + operations = [ + migrations.AlterModelOptions( + name='liveimageupload', + options={'verbose_name': 'Живая загрузка изображений', 'verbose_name_plural': 'Живая загрузка изображений'}, + ), + ] diff --git a/common/views.py b/common/views.py index ca08433..7dce5a1 100644 --- a/common/views.py +++ b/common/views.py @@ -111,7 +111,7 @@ class LiveImageUploadDeleteView(NoCsrfMixin, LoginRequiredMixin, View): live_img.delete() return JsonResponse({'status': 'success'}) else: - return JsonResponse({'status': 'failure'}) + return JsonResponse({'status': 'error'}) class CustomRegistrationView(RegistrationView): diff --git a/templates/partials/base.html b/templates/partials/base.html index 4c32a99..6d947d1 100644 --- a/templates/partials/base.html +++ b/templates/partials/base.html @@ -87,7 +87,7 @@ if ((queryString.indexOf('/chat') != 0) && (queryString.indexOf('/users/contractor-office/510/work-projects') != 0)) { domain = domain.replace(':' + port, ''); - var url = 'ws://' + domain + '/chat/' + userId + '/'; + var url = 'ws://' + domain + ':8888/chat/' + userId + '/'; var sock = new WebSocket(url); var intervalId; sock.onopen = function () { diff --git a/templates/test.html b/templates/test.html index fe6da23..b09ae45 100644 --- a/templates/test.html +++ b/templates/test.html @@ -15,7 +15,7 @@