diff --git a/assets/index.js b/assets/index.js index 3f467c4..52f0720 100644 --- a/assets/index.js +++ b/assets/index.js @@ -2,7 +2,49 @@ $(function() { - $('.-select2').select2() + //$('.-select2').select2({ + // language: 'ru', + //}) + + + $('.-select2').select2({ + ajax: { + url: "/api/specializations/", + dataType: 'json', + delay: 250, + + data: function(params) { + return { + 'name__icontains': params.term, + page: params.page, + } + }, + + processResults: function(data, params) { + params.page = params.page || 1 + + return { + results: _.map(function(item) { + return { + text: item.name, + id: item.id, + } + }, data.results), + + pagination: { + more: (params.page * 10) < data.count + }, + } + }, + + //cache: true + }, + + //escapeMarkup: function(markup) {return markup}, // let our custom formatter work + minimumInputLength: 1, + //templateResult: formatRepo, // omitted for brevity, see the source of this page + //templateSelection: formatRepoSelection // omitted for brevity, see the source of this page + }) }) diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index 74c6cc3..2d7cfd5 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -82,20 +82,21 @@
-->
+{#
#} +{# {{ form.specialization }}#} +{#
#} +
- {{ form.specialization }} +
- +
- +
- +