PR-15 Профиль настроек исполнителя модификация

Реализация перемещена на рабочий url
remotes/origin/PR-15
booblegum 9 years ago
parent 7c96a8d748
commit e1ef2361ff
  1. 11
      assets/lib/proekton-components/js/build/init_user_profile.js
  2. 405
      users/templates/user_profile_edit.html
  3. 316
      users/templates/user_profile_edit_new.html
  4. 220
      users/templates/user_profile_edit_old.html
  5. 10
      users/urls.py
  6. 12
      users/views.py

@ -170,15 +170,11 @@ var SelectedContainer = (_class = function () {
value: function restoreElements() { value: function restoreElements() {
var self = this; var self = this;
if (this.$input && this.$input.val()) { if (this.$input && this.$input.val()) {
console.log(" restore 1) ", this.$input.val());
console.log(" restore 2) ", this.$input.val().replace(/[\[\]\'\'\"\"]/g, ''));
// console.log(" restore 2) alter ", JSON.parse(this.$input.val()));
var clearString = this.$input.val().replace(/[\[\]\'\'\"\"]/g, ''); var clearString = this.$input.val().replace(/[\[\]\'\'\"\"]/g, '');
var data = clearString.split(',').filter(function (el) { var data = clearString.split(',').filter(function (el) {
return el; return el;
}); });
console.log(" restore 3) ", data);
this.elements_id = []; this.elements_id = [];
if (this.$input) this.$input.val(this.elements_id.join(',')); if (this.$input) this.$input.val(this.elements_id.join(','));
data.forEach(function (el) { data.forEach(function (el) {
@ -241,9 +237,6 @@ var SelectedContainer = (_class = function () {
}, { }, {
key: 'add', key: 'add',
value: function add(_id, max_len) { value: function add(_id, max_len) {
console.log("id = ", _id);
// console.log("this = ", this);
// console.log("this.elements_id = ", this.elements_id);
var id = Number(_id); var id = Number(_id);
var self = this; var self = this;
if (this.onlyOne) { if (this.onlyOne) {
@ -396,6 +389,10 @@ var TreeSelect = function (_AbsBaseSelect) {
}, { }, {
key: '_onButtonAddOptions', key: '_onButtonAddOptions',
value: function _onButtonAddOptions(e) { value: function _onButtonAddOptions(e) {
// this._addToSelectedContainer(this.selectedEl.id);
// this.clear();
// e.preventDefault();
// return false;
_get(TreeSelect.prototype.__proto__ || Object.getPrototypeOf(TreeSelect.prototype), '_onButtonAddOptions', this).call(this, e); _get(TreeSelect.prototype.__proto__ || Object.getPrototypeOf(TreeSelect.prototype), '_onButtonAddOptions', this).call(this, e);
this.clearAllNext(); this.clearAllNext();
this.clearAllPrev(); this.clearAllPrev();

@ -1,220 +1,317 @@
{% extends 'partials/base.html' %} {% extends 'partials/base.html' %}
{% load staticfiles %}
{% load thumbnail %} {% load thumbnail %}
{% block head_css %} {% block head_css %}
<style> <link rel='stylesheet' href='{% static "lib/proekton-components/css/fonts.css" %}'>
.-live-image-avatar-upload-container .-position-relative-parent {position: relative} <link rel='stylesheet' href='{% static "lib/proekton-components/css/selected-container.css" %}'>
<link rel='stylesheet' href='{% static "lib/proekton-components/css/editable-container.css" %}'>
.-live-image-avatar-upload-container .-live-image-delete { <link rel='stylesheet' href='{% static "lib/proekton-components/css/select-box.css" %}'>
position: absolute; <link rel='stylesheet' href='{% static "css/project_filter.css" %}'>{# other #}
top: 0; <link rel='stylesheet' href='{% static "css/font-awesome.min.css" %}'>
right: 0; <link rel='stylesheet' href='{% static "css/user_profile_edit.css" %}'>
background-color: white; <link rel='stylesheet' href='{% static "css/custom-checkboxes.css" %}'>
}
</style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% include 'partials/header.html' %} {% include 'partials/header.html' %}
{# {% if request.user.is_customer %}#}
{# <input type="hidden" name="next"#}
{# value="{% url 'users:customer-profile-open-projects' pk=pk %}">#}
{# {% elif request.user.is_contractor %}#}
{# <input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}">#}
{# {% endif %}#}
<div class="container mainScore"> <div class="container mainScore">
<div class="row">
<div class="row mainContent">
<form method="POST" enctype="multipart/form-data" novalidate> <form method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}">
{% if request.user.is_customer %} <div class="col-lg-12">
<input type="hidden" name="next" value="{% url 'users:customer-profile-open-projects' pk=pk %}"> <div class="row row-eq-height">
{% elif request.user.is_contractor %} <div class="col-lg-3 -live-image-avatar-upload-container">
<input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}"> <div class="avatar" style="float: none">
{% endif %}
<div class="projectsBlock disTab">
<div class="col-lg-12">
<div class="col-lg-3 divCol3 -live-image-avatar-upload-container">
<div class="avatar">
<div class="avatarInset -position-relative-parent"> <div class="avatarInset -position-relative-parent">
<a href="#" onclick="return false" class="btn close -live-image-delete" style="display: none">&times;</a> <a href="#" onclick="return false" class="btn close -live-image-delete"
style="display: none">&times;</a>
{% if request.user.avatar %} {% if request.user.avatar %}
{% thumbnail request.user.avatar "235x224" crop="center" as avatar %} {% thumbnail request.user.avatar "235x224" crop="center" as avatar %}
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image"> <img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image" class="-avatar-image"> <img src="{% static 'img/profile.jpg' %}" alt="profile-image"
class="-avatar-image">
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div style="margin-top: 15px">
<div class="menuUser upload-img disTab"> <div class="upload-new">
<div class="upload2 up-l1"> {# <div class="upload2 up-l1">#}
<input type="file" name="image" class="-live-image-upload"> <input type="file" name="image" class="-live-image-upload">
<p>Загрузить фотографию</p> <p>Загрузить фотографию</p>
{# </div>#}
</div> </div>
</div> </div>
<div {% if not TESTING %}style="display: none"{% endif %}> <div {% if not TESTING %}style="display: none"{% endif %}>
<input type="text" name="live_image" class="-live-image-id"> <input type="text" name="live_image" class="-live-image-id">
</div> </div>
</div> </div>
<div class="col-lg-9">
<div class="col-lg-9 divCol9"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-12">
<p class="name-edit-p">ФИО</p> <div class="bottom-line">
<span class="header">
<input type="text" value="{{ form.last_name.value }}" name="{{ form.last_name.html_name }}" class="box-sizing inp-edit"> Параметры заполнения прифиля влияют на фильтр поиска специалистов, ранжирования в списке
<input type="text" value="{{ form.first_name.value }}" name="{{ form.first_name.html_name }}" class="box-sizing inp-edit"> <i class="fa fa-question-circle-o" aria-hidden="true" title=""></i>
<input type="text" value="{{ form.patronym.value }}" name="{{ form.patronym.html_name }}" class="box-sizing inp-edit"> </span>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12" style="padding-bottom: 10px">
<span class="header block-header">
Личная информация <i class="fa fa-question-circle-o" aria-hidden="true"
title=""></i>
</span>
</div>
</div> </div>
{% if request.user.is_contractor %} <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<p class="name-edit-p">Специализации</p> <input value="{{ form.last_name.value }}" name="{{ form.last_name.html_name }}"
class="simple-input" placeholder="Фамилия">
<div id="simpleSpecContainer"> </div>
<div class="polsF1 pols-edit disTab -simple-spec-widget" style="display: none"> <div class="col-lg-4">
<input type="hidden" class="-simple-spec-select" style="width: 100%"> <input value="{{ form.first_name.value }}" name="{{ form.first_name.html_name }}"
<input type="hidden" class="-chosen-simple-spec-id" name="{{ form.contractor_specializations.html_name }}"> class="simple-input" placeholder="Имя">
</div> </div>
<div class="col-lg-4">
{% for spec_id in form.contractor_specializations.value %} <input value="{{ form.patronym.value }}" name="{{ form.patronym.html_name }}"
<div class="polsF1 pols-edit disTab -simple-spec-widget"> class="simple-input" placeholder="Отчество">
<input type="hidden" class="-simple-spec-select" style="width: 100%"> </div>
<input type="hidden" class="-chosen-simple-spec-id" name="{{ form.contractor_specializations.html_name }}" value="{{ spec_id }}"> <div class="col-lg-4">
</div> <div class="vertical-child" id="sb-location-1">
{% endfor %}
</div> </div>
<a href="#" onclick="return false" class="add-edit" id="addSpec">
Добавить еще
</a>
</div> </div>
{% endif %} <div class="col-lg-4">
<div class="vertical-child" id="sb-location-2">
<div class="col-lg-4"> </div>
<p class="name-edit-p">Местоположение</p>
<div class="polsF1 pols-edit disTab">
<div><input type="hidden" class="-location-select -location-select-country" style="width: 100%"></div>
<div><input type="hidden" class="-location-select -location-select-region" style="width: 100%"></div>
<div><input type="hidden" class="-location-select -location-select-city" style="width: 100%"></div>
<input type="hidden" id="chosenLocationId" name="{{ form.location.html_name }}" value="{{ form.location.value }}">
</div> </div>
</div> <div class="col-lg-4">
</div> <div class="vertical-child" id="sb-location-3">
</div> </div>
</div>
<div class="buttonGP btn-edit disTab">
<div class="btn-group valProject valProject2" role="group">
<a href="{% url 'users:user-profile-edit' pk=pk %}"
class="btn btn-default {% if not request.experience_edit %}active{% endif %}">Общая информация</a>
<a href="{% url 'users:user-financial-info-edit' pk=pk %}" class="btn btn-default">Финансовая информация</a>
{% if request.user.is_contractor %}
<a href="{% url 'users:user-experience-edit' pk=pk %}"
class="btn btn-default {% if request.experience_edit %}active{% endif %}">Опыт</a>
{% endif %}
</div>
</div>
<div class="col-lg-12 col12 new-filter">
<div class="filter clearfix">
{% if request.experience_edit %}
<div class="titleF1 disTab">
<div class="col-lg-6">Классификация зданий</div>
<div class="col-lg-6">Виды строительства</div>
</div>
<div class="polsF1 disTab new-doubt">
<div class="col-lg-6 profile-building-classifications">
{{ form.contractor_building_classifications }}
</div> </div>
<div class="col-lg-8">
<div class="col-lg-6 profile-construction-types"> <div class="selected-container horizontal vertical-child no-margin"
{{ form.contractor_construction_types }} id="selected-location">
<div class="header">&nbsp;</div>
<input type="hidden" name="location"
value="{{ form.location.value }}">
</div>
</div> </div>
</div> </div>
</div>
<div class="searchF1 polsF1 polsFF links-filter"> </div> <!-- top -->
<input class="btn-submit-link" type="submit" value="Сохранить">
<div class="row">
<div style="padding-bottom: 10px" class="col-lg-12">
<div class="row">
<div class="col-lg-offset-3 col-lg-9">
<div class="top-line">
<span class="header block-header">
Мой опыт работы в проектировании / дизайне / сопровождении проектной документации
<i class="fa fa-question-circle-o" aria-hidden="true" title=""></i>
</span>
</div>
</div>
</div> </div>
{% else %} <div class="row">
<div class="titleF1 disTab"> <div class="col-lg-12">
<div class="col-lg-3">Дата рождения</div> <div class="" id="select-box-1">
<div class="col-lg-3">Пол</div> </div>
<div class="col-lg-3">Статус</div> </div>
</div> </div>
<div class="row">
<div class="polsF1 disTab"> <div class="col-lg-3">
<div class="col-lg-3 birth_edit_dat"> <div class="vertical-child" id="select-box-2">
{{ form.date_of_birth }} </div>
</div> </div>
<div class="col-lg-3">
<div class="col-lg-3 dog-new ed-new"> <div class="vertical-child" id="select-box-3">
{% for id, text in form.gender.field.choices %} </div>
<label> </div>
<input <div class="col-lg-3">
type="radio" <div class="vertical-child" id="select-box-4">
name="{{ form.gender.html_name }}" </div>
value="{{ id }}"
{% if form.gender.value == id %}checked{% endif %}>
<span></span>
</label>
<p>{{ text }}&nbsp;&nbsp;&nbsp;&nbsp;</p>
{% endfor %}
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
{{ form.contractor_status }} <div class="vertical-child" id="select-box-5">
</div>
</div> </div>
</div> </div>
<div class="row">
<div class="titleF1 titleF2 disTab"> <div class="col-lg-12">
<div class="col-lg-3">Сайт</div> <div class="selected-container horizontal" id="selected-spec">
<div class="col-lg-3">Skype</div> <input type="hidden" name="{{ form.contractor_specializations.html_name }}"
<div class="col-lg-3">Телефон</div> value="{{ form.contractor_specializations.value }}">
<div class="col-lg-3">Второй телефон</div> </div>
</div>
</div> </div>
<div class="row">
<div class="searchF1 polsF1 polsFF polsF3">
<div class="col-lg-3"> <div class="col-lg-3">
<input type="text" name="{{ form.website.html_name }}" value="{{ form.website.value }}" class="box-sizing surr surr2" placeholder="beeg.com"> <div class="vertical-child" id="sb-building-classification">
</div>
<div class="vertical-child" id="sb-building-sub-classification">
</div>
<div class="selected-container" id="selected-building-classification">
<input type="hidden"
name="{{ form.contractor_building_classifications.html_name }}"
value="{{ form.contractor_building_classifications.value }}">
</div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<input type="text" name="{{ form.skype.html_name }}" value="{{ form.skype.value }}" class="box-sizing surr surr2" placeholder="nokia770"> <div class="vertical-child" id="sb-construction-type">
</div>
<div class="selected-container" id="selected-construction-type">
<input type="hidden" name="{{ form.contractor_construction_types.html_name }}"
value="{{ form.contractor_construction_types.value }}">
</div>
</div> </div>
<div class="col-lg-3">
<div class="select-box-header vertical-child">
<span style="width: 180px" class="header">Требуется допуск (СРО)</span>
<i class="fa fa-question-circle-o" aria-hidden="true"
title="bla-bla-bla..."></i>
</div>
<div class="custom-check">
<div class="checked"></div>
<div style="display: none" class="not-checked"></div>
<input name="{{ form.cro.html_name }}" type="checkbox" hidden
{% if form.cro.value %} checked{% endif %}>
</div>
</div>
</div>
</div>
</div> <!-- center -->
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="top-line" style="padding-top: 15px">
<div class="btn-group toggle" role="group" aria-label="...">
<a style="z-index: 0" href="#"
{# <a style="z-index: 0" href="{% url 'users:user-profile-edit' pk=pk %}"#}
role="button"
class="btn btn-default active">Общая информация</a>
<a href="#"
class="btn btn-default" role="button">Финансовая информация</a>
</div>
</div>
</div>
</div>
<div class="row info">
<div class="col-lg-3"> <div class="col-lg-3">
<input type="text" name="{{ form.phone.html_name }}" value="{{ form.phone.value }}" class="box-sizing surr surr2" placeholder="+7 999 999 44 02"> <div class="header"> Дата рождения</div>
<div class="birth_edit_dat">
{{ form.date_of_birth }}
</div>
</div> </div>
<div class="col-lg-3">
<div style="position: relative" class="select-box-container custom-select"
id="gender">
<div class="select-box-header">
<div class="header">Пол</div>
</div>
<input class="simple-select" placeholder="Выберите"
value="{{ form.get_gender_display }}" readonly>
<input type="hidden" name="{{ form.gender.html_name }}" value="{{ form.gender.value }}">
<div class="select-box-options" style="width: 100%; display: none">
<div style="min-width: inherit" class="box-wrapper">
<ul>
{% for id, text in form.gender.field.choices %}
<li data-id="{{ id }}">{{ text }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
<div class="col-lg-3"> <div class="col-lg-3">
<input type="text" name="{{ form.phone2.html_name }}" value="{{ form.phone2.value }}" class="box-sizing surr surr2" placeholder="+7 999 999 44 02"> <div style="position: relative" class="select-box-container custom-select"
id="gender">
<div class="select-box-header">
<div class="header">Статус</div>
</div>
<input class="simple-select" placeholder="Выберите"
value="{{ form.get_status_display }}" readonly>
<input type="hidden" name="{{ form.contractor_status.html_name }}" value="{{ form.contractor_status.value }}">
<div class="select-box-options" style="width: 100%; display: none">
<div style="min-width: inherit" class="box-wrapper">
<ul>
{% for id, text in form.contractor_status.field.choices %}
<li data-id="{{ id }}">{{ text }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div> </div>
</div> <div class="col-lg-3">
<div class="header">Skype</div>
<div class="col-lg-12"> <input name="{{ form.skype.html_name }}" class="simple-input" placeholder="skype id"
<div class="col-lg-12 make-new make-eed"> value="{{ form.skype.value }}">
<label>{{ form.cro }}<span></span></label> </div>
<p>Есть допуск СРО</p> <div class="clearfix visible-lg"></div>
<div class="col-lg-3 vertical-child">
<div class="header">Сайт</div>
<input name="{{ form.website.html_name }}" class="simple-input"
placeholder="example.com"
value="{{ form.website.value }}">
</div>
<div class="col-lg-3 vertical-child">
<div class="header">Телефон</div>
<input name="{{ form.phone.html_name }}" class="simple-input phone"
placeholder="+7 909 999 00 00"
value="{{ form.phone.value }}"
type="tel">
</div>
<div class="col-lg-3 vertical-child">
<div class="header">Второй телефон</div>
<input name="{{ form.phone2.html_name }}" class="simple-input phone"
placeholder="+7 909 999 00 00"
value="{{ form.phone2.value }}"
type="tel">
</div>
<div class="col-lg-3 vertical-child" style="text-align: center">
<div class="header">&nbsp;</div>
<input type="submit" class="btn btn-simple" value="СОХРАНИТЬ">
</div> </div>
</div> </div>
<div class="searchF1 polsF1 polsFF links-filter"> </div>
<input class="btn-submit-link" type="submit" value="Сохранить"> </div> <!-- bottom -->
</div>
{% endif %}
</div>
</div> </div>
</form> </form>
</div>
<div class="row">
{% include 'partials/footer.html' %} {% include 'partials/footer.html' %}
</div> </div>
</div> </div>
{% endblock %}
{% block js_block %}
{{ block.super }}
<script src='{% static "lib/proekton-components/js/build/init_user_profile.js" %}'></script>
<script src='{% static "projects-filter.js" %}'></script>
<script src='{% static "js/jquery.mask.min.js" %}'></script>
<script>
$(function () {
$('.phone').mask('+7(000)000-00-00');
})
</script>
{% endblock %} {% endblock %}

@ -1,316 +0,0 @@
{% extends 'partials/base.html' %}
{% load staticfiles %}
{% load thumbnail %}
{% block head_css %}
<link rel='stylesheet' href='{% static "lib/proekton-components/css/fonts.css" %}'>
<link rel='stylesheet' href='{% static "lib/proekton-components/css/selected-container.css" %}'>
<link rel='stylesheet' href='{% static "lib/proekton-components/css/editable-container.css" %}'>
<link rel='stylesheet' href='{% static "lib/proekton-components/css/select-box.css" %}'>
<link rel='stylesheet' href='{% static "css/project_filter.css" %}'>{# other #}
<link rel='stylesheet' href='{% static "css/font-awesome.min.css" %}'>
<link rel='stylesheet' href='{% static "css/user_profile_edit.css" %}'>
<link rel='stylesheet' href='{% static "css/custom-checkboxes.css" %}'>
{% endblock %}
{% block content %}
{% include 'partials/header.html' %}
{# {% if request.user.is_customer %}#}
{# <input type="hidden" name="next"#}
{# value="{% url 'users:customer-profile-open-projects' pk=pk %}">#}
{# {% elif request.user.is_contractor %}#}
{# <input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}">#}
{# {% endif %}#}
<div class="container mainScore">
<div class="row mainContent">
<form method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %}
<input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}">
<div class="col-lg-12">
<div class="row row-eq-height">
<div class="col-lg-3 -live-image-avatar-upload-container">
<div class="avatar" style="float: none">
<div class="avatarInset -position-relative-parent">
<a href="#" onclick="return false" class="btn close -live-image-delete"
style="display: none">&times;</a>
{% if request.user.avatar %}
{% thumbnail request.user.avatar "235x224" crop="center" as avatar %}
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %}
{% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"
class="-avatar-image">
{% endif %}
</div>
</div>
<div style="margin-top: 15px">
<div class="upload-new">
{# <div class="upload2 up-l1">#}
<input type="file" name="image" class="-live-image-upload">
<p>Загрузить фотографию</p>
{# </div>#}
</div>
</div>
<div {% if not TESTING %}style="display: none"{% endif %}>
<input type="text" name="live_image" class="-live-image-id">
</div>
</div>
<div class="col-lg-9">
<div class="row">
<div class="col-lg-12">
<div class="bottom-line">
<span class="header">
Параметры заполнения прифиля влияют на фильтр поиска специалистов, ранжирования в списке
<i class="fa fa-question-circle-o" aria-hidden="true" title=""></i>
</span>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12" style="padding-bottom: 10px">
<span class="header block-header">
Личная информация <i class="fa fa-question-circle-o" aria-hidden="true"
title=""></i>
</span>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<input value="{{ form.last_name.value }}" name="{{ form.last_name.html_name }}"
class="simple-input" placeholder="Фамилия">
</div>
<div class="col-lg-4">
<input value="{{ form.first_name.value }}" name="{{ form.first_name.html_name }}"
class="simple-input" placeholder="Имя">
</div>
<div class="col-lg-4">
<input value="{{ form.patronym.value }}" name="{{ form.patronym.html_name }}"
class="simple-input" placeholder="Отчество">
</div>
<div class="col-lg-4">
<div class="vertical-child" id="sb-location-1">
</div>
</div>
<div class="col-lg-4">
<div class="vertical-child" id="sb-location-2">
</div>
</div>
<div class="col-lg-4">
<div class="vertical-child" id="sb-location-3">
</div>
</div>
<div class="col-lg-8">
<div class="selected-container horizontal vertical-child no-margin"
id="selected-location">
<div class="header">&nbsp;</div>
<input type="hidden" name="location"
value="{{ form.location.value }}">
</div>
</div>
</div>
</div>
</div> <!-- top -->
<div class="row">
<div style="padding-bottom: 10px" class="col-lg-12">
<div class="row">
<div class="col-lg-offset-3 col-lg-9">
<div class="top-line">
<span class="header block-header">
Мой опыт работы в проектировании / дизайне / сопровождении проектной документации
<i class="fa fa-question-circle-o" aria-hidden="true" title=""></i>
</span>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="" id="select-box-1">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="vertical-child" id="select-box-2">
</div>
</div>
<div class="col-lg-3">
<div class="vertical-child" id="select-box-3">
</div>
</div>
<div class="col-lg-3">
<div class="vertical-child" id="select-box-4">
</div>
</div>
<div class="col-lg-3">
<div class="vertical-child" id="select-box-5">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="selected-container horizontal" id="selected-spec">
<input type="hidden" name="{{ form.contractor_specializations.html_name }}"
value="{{ form.contractor_specializations.value }}">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="vertical-child" id="sb-building-classification">
</div>
<div class="vertical-child" id="sb-building-sub-classification">
</div>
<div class="selected-container" id="selected-building-classification">
<input type="hidden"
name="{{ form.contractor_building_classifications.html_name }}"
value="{{ form.contractor_building_classifications.value }}">
</div>
</div>
<div class="col-lg-3">
<div class="vertical-child" id="sb-construction-type">
</div>
<div class="selected-container" id="selected-construction-type">
<input type="hidden" name="{{ form.contractor_construction_types.html_name }}"
value="{{ form.contractor_construction_types.value }}">
</div>
</div>
<div class="col-lg-3">
<div class="select-box-header vertical-child">
<span style="width: 180px" class="header">Требуется допуск (СРО)</span>
<i class="fa fa-question-circle-o" aria-hidden="true"
title="bla-bla-bla..."></i>
</div>
<div class="custom-check">
<div class="checked"></div>
<div style="display: none" class="not-checked"></div>
<input name="{{ form.cro.html_name }}" type="checkbox" hidden
{% if form.cro.value %} checked{% endif %}>
</div>
</div>
</div>
</div>
</div> <!-- center -->
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="top-line" style="padding-top: 15px">
<div class="btn-group toggle" role="group" aria-label="...">
<a style="z-index: 0" href="{% url 'users:user-profile-edit' pk=pk %}"
role="button"
class="btn btn-default active">Общая информация</a>
<a href="{% url 'users:user-financial-info-edit' pk=pk %}"
class="btn btn-default" role="button">Финансовая информация</a>
</div>
</div>
</div>
</div>
<div class="row info">
<div class="col-lg-3">
<div class="header"> Дата рождения</div>
<div class="birth_edit_dat">
{{ form.date_of_birth }}
</div>
</div>
<div class="col-lg-3">
<div style="position: relative" class="select-box-container custom-select"
id="gender">
<div class="select-box-header">
<div class="header">Пол</div>
</div>
<input class="simple-select" placeholder="Выберите"
value="{{ form.get_gender_display }}" readonly>
<input type="hidden" name="{{ form.gender.html_name }}" value="{{ form.gender.value }}">
<div class="select-box-options" style="width: 100%; display: none">
<div style="min-width: inherit" class="box-wrapper">
<ul>
{% for id, text in form.gender.field.choices %}
<li data-id="{{ id }}">{{ text }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div style="position: relative" class="select-box-container custom-select"
id="gender">
<div class="select-box-header">
<div class="header">Статус</div>
</div>
<input class="simple-select" placeholder="Выберите"
value="{{ form.get_status_display }}" readonly>
<input type="hidden" name="{{ form.contractor_status.html_name }}" value="{{ form.contractor_status.value }}">
<div class="select-box-options" style="width: 100%; display: none">
<div style="min-width: inherit" class="box-wrapper">
<ul>
{% for id, text in form.contractor_status.field.choices %}
<li data-id="{{ id }}">{{ text }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="header">Skype</div>
<input name="{{ form.skype.html_name }}" class="simple-input" placeholder="skype id"
value="{{ form.skype.value }}">
</div>
<div class="clearfix visible-lg"></div>
<div class="col-lg-3 vertical-child">
<div class="header">Сайт</div>
<input name="{{ form.website.html_name }}" class="simple-input"
placeholder="example.com"
value="{{ form.website.value }}">
</div>
<div class="col-lg-3 vertical-child">
<div class="header">Телефон</div>
<input name="{{ form.phone.html_name }}" class="simple-input phone"
placeholder="+7 909 999 00 00"
value="{{ form.phone.value }}"
type="tel">
</div>
<div class="col-lg-3 vertical-child">
<div class="header">Второй телефон</div>
<input name="{{ form.phone2.html_name }}" class="simple-input phone"
placeholder="+7 909 999 00 00"
value="{{ form.phone2.value }}"
type="tel">
</div>
<div class="col-lg-3 vertical-child" style="text-align: center">
<div class="header">&nbsp;</div>
<input type="submit" class="btn btn-simple" value="СОХРАНИТЬ">
</div>
</div>
</div>
</div> <!-- bottom -->
</div>
</form>
</div>
<div class="row">
{% include 'partials/footer.html' %}
</div>
</div>
{% endblock %}
{% block js_block %}
{{ block.super }}
<script src='{% static "lib/proekton-components/js/build/init_user_profile.js" %}'></script>
<script src='{% static "projects-filter.js" %}'></script>
<script src='{% static "js/jquery.mask.min.js" %}'></script>
<script>
$(function () {
$('.phone').mask('+7(000)000-00-00');
})
</script>
{% endblock %}

@ -0,0 +1,220 @@
{% extends 'partials/base.html' %}
{% load thumbnail %}
{% block head_css %}
<style>
.-live-image-avatar-upload-container .-position-relative-parent {position: relative}
.-live-image-avatar-upload-container .-live-image-delete {
position: absolute;
top: 0;
right: 0;
background-color: white;
}
</style>
{% endblock %}
{% block content %}
{% include 'partials/header.html' %}
<div class="container mainScore">
<div class="row">
<form method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %}
{% if request.user.is_customer %}
<input type="hidden" name="next" value="{% url 'users:customer-profile-open-projects' pk=pk %}">
{% elif request.user.is_contractor %}
<input type="hidden" name="next" value="{% url 'users:contractor-profile' pk=pk %}">
{% endif %}
<div class="projectsBlock disTab">
<div class="col-lg-12">
<div class="col-lg-3 divCol3 -live-image-avatar-upload-container">
<div class="avatar">
<div class="avatarInset -position-relative-parent">
<a href="#" onclick="return false" class="btn close -live-image-delete" style="display: none">&times;</a>
{% if request.user.avatar %}
{% thumbnail request.user.avatar "235x224" crop="center" as avatar %}
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %}
{% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image" class="-avatar-image">
{% endif %}
</div>
</div>
<div class="menuUser upload-img disTab">
<div class="upload2 up-l1">
<input type="file" name="image" class="-live-image-upload">
<p>Загрузить фотографию</p>
</div>
</div>
<div {% if not TESTING %}style="display: none"{% endif %}>
<input type="text" name="live_image" class="-live-image-id">
</div>
</div>
<div class="col-lg-9 divCol9">
<div class="col-lg-4">
<p class="name-edit-p">ФИО</p>
<input type="text" value="{{ form.last_name.value }}" name="{{ form.last_name.html_name }}" class="box-sizing inp-edit">
<input type="text" value="{{ form.first_name.value }}" name="{{ form.first_name.html_name }}" class="box-sizing inp-edit">
<input type="text" value="{{ form.patronym.value }}" name="{{ form.patronym.html_name }}" class="box-sizing inp-edit">
</div>
{% if request.user.is_contractor %}
<div class="col-lg-4">
<p class="name-edit-p">Специализации</p>
<div id="simpleSpecContainer">
<div class="polsF1 pols-edit disTab -simple-spec-widget" style="display: none">
<input type="hidden" class="-simple-spec-select" style="width: 100%">
<input type="hidden" class="-chosen-simple-spec-id" name="{{ form.contractor_specializations.html_name }}">
</div>
{% for spec_id in form.contractor_specializations.value %}
<div class="polsF1 pols-edit disTab -simple-spec-widget">
<input type="hidden" class="-simple-spec-select" style="width: 100%">
<input type="hidden" class="-chosen-simple-spec-id" name="{{ form.contractor_specializations.html_name }}" value="{{ spec_id }}">
</div>
{% endfor %}
</div>
<a href="#" onclick="return false" class="add-edit" id="addSpec">
Добавить еще
</a>
</div>
{% endif %}
<div class="col-lg-4">
<p class="name-edit-p">Местоположение</p>
<div class="polsF1 pols-edit disTab">
<div><input type="hidden" class="-location-select -location-select-country" style="width: 100%"></div>
<div><input type="hidden" class="-location-select -location-select-region" style="width: 100%"></div>
<div><input type="hidden" class="-location-select -location-select-city" style="width: 100%"></div>
<input type="hidden" id="chosenLocationId" name="{{ form.location.html_name }}" value="{{ form.location.value }}">
</div>
</div>
</div>
</div>
</div>
<div class="buttonGP btn-edit disTab">
<div class="btn-group valProject valProject2" role="group">
<a href="{% url 'users:user-profile-edit' pk=pk %}"
class="btn btn-default {% if not request.experience_edit %}active{% endif %}">Общая информация</a>
<a href="{% url 'users:user-financial-info-edit' pk=pk %}" class="btn btn-default">Финансовая информация</a>
{% if request.user.is_contractor %}
<a href="{% url 'users:user-experience-edit' pk=pk %}"
class="btn btn-default {% if request.experience_edit %}active{% endif %}">Опыт</a>
{% endif %}
</div>
</div>
<div class="col-lg-12 col12 new-filter">
<div class="filter clearfix">
{% if request.experience_edit %}
<div class="titleF1 disTab">
<div class="col-lg-6">Классификация зданий</div>
<div class="col-lg-6">Виды строительства</div>
</div>
<div class="polsF1 disTab new-doubt">
<div class="col-lg-6 profile-building-classifications">
{{ form.contractor_building_classifications }}
</div>
<div class="col-lg-6 profile-construction-types">
{{ form.contractor_construction_types }}
</div>
</div>
<div class="searchF1 polsF1 polsFF links-filter">
<input class="btn-submit-link" type="submit" value="Сохранить">
</div>
{% else %}
<div class="titleF1 disTab">
<div class="col-lg-3">Дата рождения</div>
<div class="col-lg-3">Пол</div>
<div class="col-lg-3">Статус</div>
</div>
<div class="polsF1 disTab">
<div class="col-lg-3 birth_edit_dat">
{{ form.date_of_birth }}
</div>
<div class="col-lg-3 dog-new ed-new">
{% for id, text in form.gender.field.choices %}
<label>
<input
type="radio"
name="{{ form.gender.html_name }}"
value="{{ id }}"
{% if form.gender.value == id %}checked{% endif %}>
<span></span>
</label>
<p>{{ text }}&nbsp;&nbsp;&nbsp;&nbsp;</p>
{% endfor %}
</div>
<div class="col-lg-3">
{{ form.contractor_status }}
</div>
</div>
<div class="titleF1 titleF2 disTab">
<div class="col-lg-3">Сайт</div>
<div class="col-lg-3">Skype</div>
<div class="col-lg-3">Телефон</div>
<div class="col-lg-3">Второй телефон</div>
</div>
<div class="searchF1 polsF1 polsFF polsF3">
<div class="col-lg-3">
<input type="text" name="{{ form.website.html_name }}" value="{{ form.website.value }}" class="box-sizing surr surr2" placeholder="beeg.com">
</div>
<div class="col-lg-3">
<input type="text" name="{{ form.skype.html_name }}" value="{{ form.skype.value }}" class="box-sizing surr surr2" placeholder="nokia770">
</div>
<div class="col-lg-3">
<input type="text" name="{{ form.phone.html_name }}" value="{{ form.phone.value }}" class="box-sizing surr surr2" placeholder="+7 999 999 44 02">
</div>
<div class="col-lg-3">
<input type="text" name="{{ form.phone2.html_name }}" value="{{ form.phone2.value }}" class="box-sizing surr surr2" placeholder="+7 999 999 44 02">
</div>
</div>
<div class="col-lg-12">
<div class="col-lg-12 make-new make-eed">
<label>{{ form.cro }}<span></span></label>
<p>Есть допуск СРО</p>
</div>
</div>
<div class="searchF1 polsF1 polsFF links-filter">
<input class="btn-submit-link" type="submit" value="Сохранить">
</div>
{% endif %}
</div>
</div>
</form>
{% include 'partials/footer.html' %}
</div>
</div>
{% endblock %}

@ -24,12 +24,12 @@ from .views import (
app_name = 'users' app_name = 'users'
urlpatterns = [ urlpatterns = [
urls.url(r'^(?P<pk>\d+)/edit/$', UserProfileEditView.as_view(), name='user-profile-edit'), # urls.url(r'^(?P<pk>\d+)/edit/$', UserProfileEditView.as_view(), name='user-profile-edit'),
urls.url(r'^(?P<pk>\d+)/edit_full/$', UserProfileEditViewFull.as_view(), name='user-profile-edit'), urls.url(r'^(?P<pk>\d+)/edit/$', UserProfileEditViewFull.as_view(), name='user-profile-edit'),
urls.url(r'^(?P<pk>\d+)/financial-info/edit/$', UserFinancialInfoEditView.as_view(), # urls.url(r'^(?P<pk>\d+)/financial-info/edit/$', UserFinancialInfoEditView.as_view(),
name='user-financial-info-edit'), # name='user-financial-info-edit'),
urls.url(r'^(?P<pk>\d+)/experience/edit/$', UserProfileEditView.as_view(), name='user-experience-edit'), # urls.url(r'^(?P<pk>\d+)/experience/edit/$', UserProfileEditView.as_view(), name='user-experience-edit'),
urls.url(r'^customers/(?P<pk>\d+)/$', CustomerProfileOpenProjectsView.as_view(), urls.url(r'^customers/(?P<pk>\d+)/$', CustomerProfileOpenProjectsView.as_view(),
name='customer-profile-open-projects'), name='customer-profile-open-projects'),

@ -104,14 +104,14 @@ class UserProfileEditView(BaseMixin, View):
class UserProfileEditViewFull(BaseMixin, View): class UserProfileEditViewFull(BaseMixin, View):
form_class = UserProfileEditFullForm form_class = UserProfileEditFullForm
template_name = 'user_profile_edit_new.html' template_name = 'user_profile_edit.html'
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
if request.resolver_match.url_name == 'user-experience-edit': # if request.resolver_match.url_name == 'user-experience-edit':
if not request.user.is_contractor(): # if not request.user.is_contractor():
raise PermissionDenied # raise PermissionDenied
self.form_class = UserProfileExperienceEditForm # self.form_class = UserProfileExperienceEditForm
request.experience_edit = True # request.experience_edit = True
if request.user.is_authenticated() and request.user.pk == int(kwargs.get('pk')): if request.user.is_authenticated() and request.user.pk == int(kwargs.get('pk')):
return super().dispatch(request, *args, **kwargs) return super().dispatch(request, *args, **kwargs)
else: else:

Loading…
Cancel
Save