PR-46-mod Модификация профиля заказчика(Доработки)

Исправлены графические недоработки
Добавлен функционал создания Заказа с автовыбором Объекта
remotes/origin/PR-58
booblegum 9 years ago
parent 778282ea7f
commit f0cfbd3e9e
  1. 38
      assets/js/build/init_create_worksell.js
  2. 45
      assets/js/build/init_customer_project_create.js
  3. 7
      assets/js/src/init_customer_project_create.js
  4. 15
      assets/lib/proekton-components/js/src/NoTreeSelect.js
  5. 14
      assets/lib/proekton-components/js/src/base/AbsBaseSelect.js
  6. 8
      assets/sass/components/custom-components.sass
  7. 1
      projects/templates/customer_project_create.html
  8. 2
      projects/views.py
  9. 2
      users/models.py
  10. 1
      users/static/sass/customer-profile.sass
  11. 4
      users/templates/customer_profile.html
  12. 20
      users/templates/partials/inc-customer_profile-info.html
  13. 2
      users/templates/partials/inc-objects.html
  14. 6
      users/templates/partials/tabs/tab-rewiews.html

@ -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();
}

@ -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();
}

@ -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: Костыли!!!

@ -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;
}

@ -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();
}

@ -10,8 +10,9 @@
label
font-weight: normal
.nav
li.active
border-top: 2px solid black
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

@ -56,6 +56,7 @@
<div class="header">&nbsp;</div>
<div href="#" onclick="return false" data-toggle="modal"
data-target="#projectWorkTypeSuggestionModal"
style="text-transform: none; line-height: 115%"
class="btn btn-simple btn-plus">Нет нужной специальности хочу добавить
</div>
</div>

@ -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)

@ -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

@ -4,6 +4,7 @@
.avatar
border: 15px solid #F1F1F1
.nav-tabs
.count
display: inline-block
width: 32px

@ -17,10 +17,10 @@
<div class="row">
<div class="col-lg-12">
<div class="tab-content">
<div id="objects" class="tab-pane fade in active">
<div id="objects" class="tab-pane fade {% if request.user == customer %}in active{% endif %}">
{% include 'partials/tabs/tab-objects.html' %}
</div>
<div id="open_projects" class="tab-pane fade">
<div id="open_projects" class="tab-pane fade {% if request.user != customer %}in active{% endif %}">
{% include 'partials/tabs/tab-open_projects.html' %}
</div>
<div id="in_work_projects" class="tab-pane fade">

@ -2,7 +2,7 @@
{% load staticfiles %}
{% load specializtions_tags %}
{% load user_tags %}
<div class="row">
<div class="row mod-row-eq-height" style="position: relative">
<div class="col-lg-3">
<div class="avatar">
{% if customer.avatar %}
@ -15,7 +15,7 @@
</div>
</div>
<div class="col-lg-9">
<div class="row mod-row-eq-height" style="padding-bottom: 30px">
<div class="row mod-row-eq-height">
<div class="col-lg-5">
<span class="user_name">{{ customer.get_full_name }} <br>[{{ customer.username }}]</span>
<table style="margin-top: 10px; margin-bottom: 10px">
@ -34,14 +34,14 @@
</table>
{% if request.user == customer %}
<a href="{% url 'users:user-profile-edit' pk=pk %}" class="btn btn-simple mod-align-center-inline"
style="padding: 8px 20px; font-size: 12pt">
style="padding: 8px 20px; font-size: 11pt; letter-spacing: 1px">
<span type="submit" class="icon-edit"> </span> редактировать профиль
</a>
{% endif %}
</div>
<div class="col-lg-7" style="border-bottom: 1px solid gainsboro; border-top: 1px solid gainsboro">
<table class="ratings" style="float: right">
<table class="ratings" style="float: right; margin-top: 7px">
<tr>
<td>
<div class="icon-rating">Рейтинг:</div>
@ -62,7 +62,7 @@
<td>
<div class="icon-reviews">Отзывы:</div>
</td>
<td>
<td style="letter-spacing: 4px">
<span class="positive"> {{ reviews_p }}</span>
<span class="neutral"> {{ reviews_n }}</span>
<span class="negative"> {{ reviews_m }}</span>
@ -71,28 +71,32 @@
</table>
</div>
</div>
<div class="row">
<div class="row" style="position: absolute;bottom: 0">
<div class="col-lg-12">
<div class="profileTabs2 tabs-new">
<div class="tabs">
<ul class="nav nav-tabs nav-justified">
{% if request.user == customer %}
<li class="active">
<a data-toggle="tab" href="#objects">
<div class="mod-align-center-inline"> Объекты <span
class="count">{{ objects.count }}</span></div>
</a>
</li>
<li>
{% endif %}
<li class="{% if request.user != customer %}active{% endif %}">
<a data-toggle="tab" href="#open_projects">
<div class="mod-align-center-inline"> Открытые заказы <span
class="count">{{ open_projects.count }}</span></div>
</a>
</li>
{% if request.user == customer %}
<li>
<a data-toggle="tab" href="#in_work_projects">
<div class="mod-align-center-inline"> Заказы в работе <span
class="count">{{ projects_in_work.count }}</span></div>
</a>
</li>
{% endif %}
<li>
<a data-toggle="tab" href="#rewiews">
<div class="mod-align-center-inline"> Отзывы <span

@ -34,7 +34,7 @@
<span class="text">Посмотреть</span>
</button>
{% if request.user == customer %}
<a href="{% url 'projects:customer-project-create' %}"
<a href="{% url 'projects:customer-project-create' %}#{{ object.id }}"
class="btn btn-simple -small">
Добавить заказ
</a>

@ -26,4 +26,10 @@
</div>
</div>
{% endfor %}
{% if not reviews %}
<div style="width: 100%; text-align: center; margin-top: 20px">
<span style="font-size: 16pt">Нет отзывов</span>
</div>
{% endif %}
</div>
Loading…
Cancel
Save