diff --git a/assets/js/build/init_create_worksell.js b/assets/js/build/init_create_worksell.js index 881f927..69096f3 100644 --- a/assets/js/build/init_create_worksell.js +++ b/assets/js/build/init_create_worksell.js @@ -887,19 +887,24 @@ this._fillOptionsData(); this._bindEvents(); } + }, { + key: 'setElementById', + value: function setElementById(id) { + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), 'setElementById', this).call(this, id); + this.selectedContainer.add(id); + } }, { key: '_onclickOptionsElement', value: function _onclickOptionsElement(e) { - var id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); - + // this.selectedEl.id = id; + // this.selectedEl.value = $(e.target).html(); + // this.$searchInput.val($(e.target).html()); + // + // this.$buttonAddOptions.show(); + // this.$optionsBox.hide(); + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), '_onclickOptionsElement', this).call(this, e); this.clear(); - this.selectedContainer.add(id); + // let id = $(e.target).data("id"); e.preventDefault(); return false; } @@ -1313,13 +1318,20 @@ $(this).find('.header').hide(); }); } + }, { + key: "setElementById", + value: function setElementById(id) { + var value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } }, { key: "_onclickOptionsElement", value: function _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + var id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/js/build/init_customer_project_create.js b/assets/js/build/init_customer_project_create.js index 4ba46b1..2801975 100644 --- a/assets/js/build/init_customer_project_create.js +++ b/assets/js/build/init_customer_project_create.js @@ -171,7 +171,12 @@ sb_realty_top.setHeader("Объект"); sb_realty_top.connectSelectedContainer(select_realty); sb_realty_top.dataPromise.then(function () { - if (!sb_realty_top.dataTree.data.length) sb_realty_top.hide(); + if (!sb_realty_top.dataTree.data.length) { + sb_realty_top.hide(); + } else { + var id = window.location.hash.replace("#", ""); + sb_realty_top.setElementById(id); + } }); select_realty.on("add", function (args) { //TODO: Костыли!!! @@ -922,19 +927,24 @@ this._fillOptionsData(); this._bindEvents(); } + }, { + key: 'setElementById', + value: function setElementById(id) { + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), 'setElementById', this).call(this, id); + this.selectedContainer.add(id); + } }, { key: '_onclickOptionsElement', value: function _onclickOptionsElement(e) { - var id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); - + // this.selectedEl.id = id; + // this.selectedEl.value = $(e.target).html(); + // this.$searchInput.val($(e.target).html()); + // + // this.$buttonAddOptions.show(); + // this.$optionsBox.hide(); + _get(NoTreeSelect.prototype.__proto__ || Object.getPrototypeOf(NoTreeSelect.prototype), '_onclickOptionsElement', this).call(this, e); this.clear(); - this.selectedContainer.add(id); + // let id = $(e.target).data("id"); e.preventDefault(); return false; } @@ -1348,13 +1358,20 @@ $(this).find('.header').hide(); }); } + }, { + key: "setElementById", + value: function setElementById(id) { + var value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } }, { key: "_onclickOptionsElement", value: function _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + var id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/js/src/init_customer_project_create.js b/assets/js/src/init_customer_project_create.js index 3b94199..a4cfd7f 100644 --- a/assets/js/src/init_customer_project_create.js +++ b/assets/js/src/init_customer_project_create.js @@ -110,7 +110,12 @@ $(function () { sb_realty_top.setHeader("Объект"); sb_realty_top.connectSelectedContainer(select_realty); sb_realty_top.dataPromise.then(function () { - if (!sb_realty_top.dataTree.data.length) sb_realty_top.hide(); + if (!sb_realty_top.dataTree.data.length) { + sb_realty_top.hide() + }else{ + let id = window.location.hash.replace("#", ""); + sb_realty_top.setElementById(id); + } }); select_realty.on("add", (args)=> { //TODO: Костыли!!! diff --git a/assets/lib/proekton-components/js/src/NoTreeSelect.js b/assets/lib/proekton-components/js/src/NoTreeSelect.js index 69b4bb2..035af52 100644 --- a/assets/lib/proekton-components/js/src/NoTreeSelect.js +++ b/assets/lib/proekton-components/js/src/NoTreeSelect.js @@ -15,17 +15,14 @@ export default class NoTreeSelect extends AbsBaseSelect{ this._bindEvents(); } - _onclickOptionsElement(e) { - let id = $(e.target).data("id"); - this.selectedEl.id = id; - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - - this.$buttonAddOptions.show(); - this.$optionsBox.hide(); + setElementById(id) { + super.setElementById(id); + this.selectedContainer.add(id); + } + _onclickOptionsElement(e) { + super._onclickOptionsElement(e); this.clear(); - this.selectedContainer.add(id); e.preventDefault(); return false; } diff --git a/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js b/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js index 5d9937d..d1c830c 100644 --- a/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js +++ b/assets/lib/proekton-components/js/src/base/AbsBaseSelect.js @@ -364,11 +364,17 @@ export default class AbsBaseSelect { }) } + setElementById(id) { + let value = this.dataTree.getElementById(id).name; + this.selectedEl.id = id; + this.selectedEl.value = value; + this.$searchInput.val(value); + this.updateEditableContainer(id); + } + _onclickOptionsElement(e) { - this.selectedEl.id = $(e.target).data("id"); - this.selectedEl.value = $(e.target).html(); - this.$searchInput.val($(e.target).html()); - this.updateEditableContainer($(e.target).data("id")); + let id = $(e.target).data("id"); + this.setElementById(id); this.$buttonAddOptions.show(); this.$optionsBox.hide(); } diff --git a/assets/sass/components/custom-components.sass b/assets/sass/components/custom-components.sass index 873cd8a..ba9c82e 100644 --- a/assets/sass/components/custom-components.sass +++ b/assets/sass/components/custom-components.sass @@ -10,8 +10,9 @@ label font-weight: normal -li.active - border-top: 2px solid black +.nav + li.active + border-top: 3px solid black .simple-input height: 51px @@ -112,14 +113,13 @@ textarea.description -webkit-font-smoothing: antialiased .icon-edit - //padding-left: 30px //content: '' display: inline-block width: 40px - height: 20px + height: 16px background: image: url("#{$static}/img/menuUser.png") - //color: #00A66E + size: 60% repeat: no-repeat position: 0 0 diff --git a/projects/templates/customer_project_create.html b/projects/templates/customer_project_create.html index bc6e0a1..20438ab 100644 --- a/projects/templates/customer_project_create.html +++ b/projects/templates/customer_project_create.html @@ -56,6 +56,7 @@
 
Нет нужной специальности хочу добавить
diff --git a/projects/views.py b/projects/views.py index ee444ce..e981d76 100644 --- a/projects/views.py +++ b/projects/views.py @@ -377,7 +377,7 @@ class ProjectFilterView(BaseMixin, View): def get_context(self, request): context = request.dict() - projects = Project.objects.filter(state='active') + projects = Project.objects.filter(state='active', order__status='created') projects = self.filter(projects, request) num_results = projects.count() projects = self.sort_by(projects) diff --git a/users/models.py b/users/models.py index 2f8d01e..b7d3c89 100644 --- a/users/models.py +++ b/users/models.py @@ -189,7 +189,7 @@ class User(AbstractBaseUser, PermissionsMixin): return self.email def get_full_name(self): - full_name = '{last_name} {first_name} {patronym}'.format(**self.__dict__) + full_name = '{first_name} {patronym} {last_name}'.format(**self.__dict__) # full_name = self.first_name + ' ' + self.last_name + ' ' + self.patronym return full_name or self.username diff --git a/users/static/sass/customer-profile.sass b/users/static/sass/customer-profile.sass index 4cbd5a3..9b9efd7 100644 --- a/users/static/sass/customer-profile.sass +++ b/users/static/sass/customer-profile.sass @@ -4,18 +4,19 @@ .avatar border: 15px solid #F1F1F1 -.count - display: inline-block - width: 32px - height: 32px - border-radius: 100% - text-align: center - line-height: 32px - font-family: 'Arial-MT-Regular', sans-serif - overflow: hidden - color: black - background-color: #ccc - margin-left: 10px +.nav-tabs + .count + display: inline-block + width: 32px + height: 32px + border-radius: 100% + text-align: center + line-height: 32px + font-family: 'Arial-MT-Regular', sans-serif + overflow: hidden + color: black + background-color: #ccc + margin-left: 10px .projects_count display: inline-block diff --git a/users/templates/customer_profile.html b/users/templates/customer_profile.html index 286f8eb..c0fc79b 100644 --- a/users/templates/customer_profile.html +++ b/users/templates/customer_profile.html @@ -17,10 +17,10 @@
-
+
{% include 'partials/tabs/tab-objects.html' %}
-
+
{% include 'partials/tabs/tab-open_projects.html' %}
diff --git a/users/templates/partials/inc-customer_profile-info.html b/users/templates/partials/inc-customer_profile-info.html index 9bd0387..b49257f 100644 --- a/users/templates/partials/inc-customer_profile-info.html +++ b/users/templates/partials/inc-customer_profile-info.html @@ -2,7 +2,7 @@ {% load staticfiles %} {% load specializtions_tags %} {% load user_tags %} -
+
{% if customer.avatar %} @@ -15,7 +15,7 @@
-
+
{{ customer.get_full_name }}
[{{ customer.username }}]
@@ -34,14 +34,14 @@
{% if request.user == customer %} + style="padding: 8px 20px; font-size: 11pt; letter-spacing: 1px"> редактировать профиль {% endif %}
- +
-
Рейтинг:
@@ -62,7 +62,7 @@
Отзывы:
+ {{ reviews_p }} {{ reviews_n }} {{ reviews_m }} @@ -71,28 +71,32 @@
-
+
-
+
{% endfor %} + {% if not reviews %} +
+ Нет отзывов +
+ + {% endif %}
\ No newline at end of file