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. 373
      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() {
var self = this;
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 data = clearString.split(',').filter(function (el) {
return el;
});
console.log(" restore 3) ", data);
this.elements_id = [];
if (this.$input) this.$input.val(this.elements_id.join(','));
data.forEach(function (el) {
@ -241,9 +237,6 @@ var SelectedContainer = (_class = function () {
}, {
key: 'add',
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 self = this;
if (this.onlyOne) {
@ -396,6 +389,10 @@ var TreeSelect = function (_AbsBaseSelect) {
}, {
key: '_onButtonAddOptions',
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);
this.clearAllNext();
this.clearAllPrev();

@ -1,220 +1,317 @@
{% extends 'partials/base.html' %}
{% load staticfiles %}
{% 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>
<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">
<div class="row mainContent">
<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="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>
<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">
<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">
<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="col-lg-9 divCol9">
<div class="row">
<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">
<input value="{{ form.last_name.value }}" name="{{ form.last_name.html_name }}"
class="simple-input" placeholder="Фамилия">
</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 }}">
<input value="{{ form.first_name.value }}" name="{{ form.first_name.html_name }}"
class="simple-input" placeholder="Имя">
</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 class="col-lg-4">
<input value="{{ form.patronym.value }}" name="{{ form.patronym.html_name }}"
class="simple-input" placeholder="Отчество">
</div>
{% endfor %}
<div class="col-lg-4">
<div class="vertical-child" id="sb-location-1">
</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 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 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> <!-- top -->
<div class="polsF1 disTab new-doubt">
<div class="col-lg-6 profile-building-classifications">
{{ form.contractor_building_classifications }}
<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 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 class="row">
<div class="col-lg-12">
<div class="" id="select-box-1">
</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="row">
<div class="col-lg-3">
{{ form.contractor_status }}
<div class="vertical-child" id="select-box-2">
</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 class="col-lg-3">
<div class="vertical-child" id="select-box-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 class="vertical-child" id="select-box-4">
</div>
</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 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">
<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="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">
<input type="text" name="{{ form.phone2.html_name }}" value="{{ form.phone2.value }}" class="box-sizing surr surr2" placeholder="+7 999 999 44 02">
<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="col-lg-12 make-new make-eed">
<label>{{ form.cro }}<span></span></label>
<p>Есть допуск СРО</p>
<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="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 class="searchF1 polsF1 polsFF links-filter">
<input class="btn-submit-link" type="submit" value="Сохранить">
</div>
{% endif %}
<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>
</form>
</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 %}

@ -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'
urlpatterns = [
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+)/financial-info/edit/$', UserFinancialInfoEditView.as_view(),
name='user-financial-info-edit'),
# urls.url(r'^(?P<pk>\d+)/edit/$', UserProfileEditView.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(),
# 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(),
name='customer-profile-open-projects'),

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

Loading…
Cancel
Save