Merge branch 'PR-5'

remotes/origin/HEAD
booblegum 9 years ago
commit 2f29393664
  1. 140
      assets/js/build/user_profile_edit.js
  2. 66
      assets/js/src/seeds/user_check_statuses.js
  3. 4
      assets/js/src/user_profile_edit.js
  4. 43
      assets/sass/components/custom-components.sass
  5. 46
      users/forms.py
  6. 75
      users/migrations/0023_auto_20170105_1706.py
  7. 85
      users/migrations/0024_auto_20170105_1808.py
  8. 37
      users/migrations/0025_auto_20170109_1202.py
  9. 54
      users/models.py
  10. 146
      users/static/css/user_profile_edit.css
  11. 130
      users/static/sass/user-profile-edit.sass
  12. 418
      users/templates/partials/tabs/tab-user-financial_info.html
  13. 92
      users/templates/partials/tabs/tab-user-info.html
  14. 119
      users/templates/user_profile_edit.html
  15. 2
      users/urls.py
  16. 336
      users/views.py

@ -49,12 +49,54 @@
var _avatar_upload = __webpack_require__(29); var _avatar_upload = __webpack_require__(29);
var _bootstrap_tabs = __webpack_require__(16);
var _user_check_statuses = __webpack_require__(30);
$(function () { $(function () {
(0, _avatar_upload.avatarUploadInit)(); (0, _avatar_upload.avatarUploadInit)();
(0, _bootstrap_tabs.tabsHashInit)();
(0, _user_check_statuses.checkBoxBindingInit)();
}); });
/***/ }, /***/ },
/***/ 16:
/***/ function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function tabsHashInit() {
// store the currently selected tab in the hash value
$("a[data-toggle=tab]").on("shown.bs.tab", function (e) {
var target = $(e.target);
if (target.hasClass("tab-inserted")) {
target.siblings(".active").removeClass("active");
target.addClass("active");
return;
}
var id = target.attr("href").substr(1);
var scrollmem = $('body').scrollTop() || $('html').scrollTop();
window.location.hash = id;
$('html,body').scrollTop(scrollmem);
});
}
function restoreTab() {
// on load of the page: switch to the currently selected tab
var hash = window.location.hash;
var a = $("a[data-toggle=\"tab\"][href=\"" + hash + "\"]");
hash && a.tab('show');
}
exports.tabsHashInit = tabsHashInit;
exports.restoreTab = restoreTab;
/***/ },
/***/ 29: /***/ 29:
/***/ function(module, exports) { /***/ function(module, exports) {
@ -106,6 +148,104 @@
exports.avatarUploadInit = avatarUploadInit; exports.avatarUploadInit = avatarUploadInit;
/***/ },
/***/ 30:
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function checkBoxBindingInit() {
/*
Скрываем/Показываем формы/части форм, взависимости от выбранных checkBox'ов
*/
var $residency_checkBoxes = $('input[name=fin_info-residency]');
var $legal_status_checkBoxes = $('input[name=fin_info-legal_status]');
var $legal_status_boxes = $legal_status_checkBoxes.closest('div');
var $fin_infos = $('.js-fin-info');
var shows = {
'russian_resident': ['individual', 'entity', 'employed'],
'non_russian_resident': ['individual', 'entity'],
'russian_stay_permit': ['individual']
};
$fin_infos.hide();
$('.-russian_stay_permit-individual').hide();
$residency_checkBoxes.on("click", function (e) {
$legal_status_checkBoxes.first().trigger("click");
});
$residency_checkBoxes.on("change", function (e) {
$legal_status_boxes.hide();
var value = $(e.target).val();
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = shows[value][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var legal_status = _step.value;
$('input[value=' + legal_status + ']').closest('div').show();
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
var fin_info_id = '';
fin_info_id += '-' + $residency_checkBoxes.filter(':checked').val();
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
if (fin_info_id == '-non_russian_resident-individual') {
$('.-non_russian_resident-individual').hide();
$('.-non_russian_resident-individual').children('input').val('');
} else {
$('.-non_russian_resident-individual').show();
}
if (fin_info_id == '-russian_stay_permit-individual') {
$('.-russian_stay_permit-individual').show();
} else {
$('.-russian_stay_permit-individual').hide();
$('.-russian_stay_permit-individual').children('input').val('');
}
});
$legal_status_checkBoxes.on("click", function (e) {
$fin_infos.each(function (ind, el) {
$(el).find('input').val('');
});
});
$legal_status_checkBoxes.on("change", function (e) {
$fin_infos.hide();
var fin_info_id = '';
fin_info_id += '-' + $residency_checkBoxes.filter(':checked').val();
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
if (fin_info_id != '-non_russian_resident-entity') {
fin_info_id = '-russian_resident';
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
}
$('#' + fin_info_id).show();
});
$residency_checkBoxes.first().trigger("change");
$legal_status_checkBoxes.first().trigger("change");
}
exports.checkBoxBindingInit = checkBoxBindingInit;
/***/ } /***/ }
/******/ }); /******/ });

@ -0,0 +1,66 @@
function checkBoxBindingInit() {
/*
Скрываем/Показываем формы/части форм, взависимости от выбранных checkBox'ов
*/
let $residency_checkBoxes = $('input[name=fin_info-residency]');
let $legal_status_checkBoxes = $('input[name=fin_info-legal_status]');
let $legal_status_boxes = $legal_status_checkBoxes.closest('div');
const $fin_infos = $('.js-fin-info');
let shows = {
'russian_resident': ['individual', 'entity', 'employed'],
'non_russian_resident': ['individual', 'entity'],
'russian_stay_permit': ['individual'],
};
$fin_infos.hide();
$('.-russian_stay_permit-individual').hide();
$residency_checkBoxes.on("click", function (e) {
$legal_status_checkBoxes.first().trigger("click");
});
$residency_checkBoxes.on("change", function (e) {
$legal_status_boxes.hide();
let value = $(e.target).val();
for (let legal_status of shows[value]) {
$(`input[value=${legal_status}]`).closest('div').show();
}
let fin_info_id = '';
fin_info_id += '-' + $residency_checkBoxes.filter(':checked').val();
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
if (fin_info_id == '-non_russian_resident-individual') {
$('.-non_russian_resident-individual').hide();
$('.-non_russian_resident-individual').children('input').val('');
} else {
$('.-non_russian_resident-individual').show()
}
if (fin_info_id == '-russian_stay_permit-individual') {
$('.-russian_stay_permit-individual').show();
} else {
$('.-russian_stay_permit-individual').hide();
$('.-russian_stay_permit-individual').children('input').val('');
}
});
$legal_status_checkBoxes.on("click", function (e) {
$fin_infos.each(function (ind, el) {
$(el).find('input').val('');
});
});
$legal_status_checkBoxes.on("change", function (e) {
$fin_infos.hide();
let fin_info_id = '';
fin_info_id += '-' + $residency_checkBoxes.filter(':checked').val();
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
if (fin_info_id != '-non_russian_resident-entity') {
fin_info_id = '-russian_resident';
fin_info_id += '-' + $legal_status_checkBoxes.filter(':checked').val();
}
$(`#${fin_info_id}`).show();
});
$residency_checkBoxes.first().trigger("change");
$legal_status_checkBoxes.first().trigger("change");
}
export {checkBoxBindingInit}

@ -1,5 +1,9 @@
import {avatarUploadInit} from './seeds/avatar_upload' import {avatarUploadInit} from './seeds/avatar_upload'
import {tabsHashInit, restoreTab} from './seeds/bootstrap_tabs'
import {checkBoxBindingInit} from './seeds/user_check_statuses'
$(function () { $(function () {
avatarUploadInit(); avatarUploadInit();
tabsHashInit();
checkBoxBindingInit();
}); });

@ -234,6 +234,10 @@ textarea.description
width: 20px width: 20px
height: 20px height: 20px
label.fin_statuses
font-style: italic
color: #6b6868
.custom-check .custom-check
cursor: pointer cursor: pointer
display: inline-block display: inline-block
@ -499,3 +503,42 @@ textarea.description
background: none !important background: none !important
color: #2c2c2c color: #2c2c2c
opacity: 0.8 opacity: 0.8
.rad
cursor: pointer
user-select: none
-webkit-user-select: none
-webkit-touch-callout: none
>
input
/* HIDE ORG RADIO & CHECKBOX
visibility: hidden
position: absolute
i
/* DEFAULT <i> STYLE
display: inline-block
vertical-align: middle
width: 24px
height: 24px
border-radius: 50%
transition: 0.2s
box-shadow: inset 0 0 0 16px #fff
border: 1px solid #cccccc
background: #cccccc
margin-right: 5px
&:hover > i
/* HOVER <i> STYLE
box-shadow: inset 0 0 0 3px #fff
background: #cccccc
> input:checked + i
/* (RADIO CHECKED) <i> STYLE
box-shadow: inset 0 0 0 3px #fff
background: #cccccc
/* RADIO & CHECKBOX STYLES
/* CHECKBOX OVERWRITE STYLES
label.rad
font-style: italic
color: #606060

@ -202,36 +202,56 @@ class UserFinancialInfoEditForm(forms.ModelForm):
model = UserFinancialInfo model = UserFinancialInfo
fields = ( fields = (
'address', 'residency',
'credit_card_number', 'legal_status',
'date_of_birth',
'fio', 'fio',
'date_of_birth',
'phone',
'postal_address',
'registration_address',
'credit_card_number',
'inn', 'inn',
'legal_status',
'passport_issue_date', 'passport_issue_date',
'passport_issued_by', 'passport_issued_by',
'passport_number', 'passport_number',
'passport_scan',
'passport_series', 'passport_series',
'phone',
'residency',
'subdivision_code', 'subdivision_code',
'yandex_money', 'yandex_money',
'web_money',
# Юридические данные
'correspondent_account',
'bank_bic',
'bank_inn',
'checking_account',
'bank_name',
'authorized_bank_name',
'ppc',
'psrn',
'organization_name',
'organization_registered_address',
'organization_postal_address',
'organization_reg_number'
) )
widgets = { widgets = {
# 'date_of_birth': forms.TextInput(attrs={'class': 'datepicker'}), 'date_of_birth': forms.DateInput(attrs={'class': 'datepicker box-sizing simple-input'}),
# 'passport_issue_date': forms.TextInput(attrs={'class': 'datepicker'}), 'passport_issue_date': forms.DateInput(attrs={'class': 'datepicker box-sizing simple-input'}),
'legal_status': forms.RadioSelect(),
'residency': forms.RadioSelect(),
} }
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.request = kwargs.pop('request') self.request = kwargs.pop('request')
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields['residency'].choices = self.fields['residency'].choices[1:] # self.fields['residency'].choices = self.fields['residency'].choices[1:]
self.fields['legal_status'].choices = self.fields['legal_status'].choices[1:] # self.fields['legal_status'].choices = self.fields['legal_status'].choices[1:]
# self.fields['residency'].empty_label = None # self.fields['residency'].empty_label = None
# self.fields['residency'].widget.choices = self.fields['residency'].choices # self.fields['residency'].widget.choices = self.fields['residency'].choices

@ -0,0 +1,75 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-01-05 14:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0022_user_organization_name'),
]
operations = [
migrations.AddField(
model_name='userfinancialinfo',
name='postal_address',
field=models.CharField(blank=True, max_length=255, verbose_name='Почтовый адрес'),
),
migrations.AddField(
model_name='userfinancialinfo',
name='registration_address',
field=models.CharField(blank=True, max_length=255, verbose_name='Адрес регистрации'),
),
migrations.AddField(
model_name='userfinancialinfo',
name='web_money',
field=models.CharField(blank=True, max_length=50),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='credit_card_number',
field=models.CharField(blank=True, max_length=50),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='fio',
field=models.CharField(blank=True, max_length=255),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='inn',
field=models.CharField(blank=True, max_length=100),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='legal_status',
field=models.CharField(choices=[('individual', 'Физическое лицо'), ('entity', 'Юридическое лицо'), ('employed', 'Частный предприниматель')], max_length=30),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='passport_issued_by',
field=models.CharField(max_length=255, verbose_name='Кем выдан'),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='phone',
field=models.CharField(blank=True, max_length=30),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='residency',
field=models.CharField(choices=[('russian_resident', 'Резидент РФ'), ('non_russian_resident', 'Нерезидент РФ'), ('russian_stay_permit', 'Вид на жительство')], max_length=50),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='subdivision_code',
field=models.CharField(max_length=10, verbose_name='Код подразделения'),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='yandex_money',
field=models.CharField(blank=True, max_length=50),
),
]

@ -0,0 +1,85 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-01-05 15:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0023_auto_20170105_1706'),
]
operations = [
migrations.AddField(
model_name='userfinancialinfo',
name='bank_bic',
field=models.CharField(default='', max_length=32, verbose_name='БИК банка'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='bank_inn',
field=models.CharField(default='', max_length=32, verbose_name='ИНН банка'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='bank_name',
field=models.CharField(default='', max_length=32, verbose_name='Название банка'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='checking_account',
field=models.CharField(default='', max_length=64, verbose_name='Расчетный счет'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='correspondent_account',
field=models.CharField(default='', max_length=32, verbose_name='Корреспондентский счет'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='organization_name',
field=models.CharField(default='', max_length=32, verbose_name='Название организации'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='organization_postal_address',
field=models.CharField(default='', max_length=255, verbose_name='Почтовый адрес'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='organization_registered_address',
field=models.CharField(default='', max_length=255, verbose_name='Юридический адрес'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='ppc',
field=models.CharField(default='', max_length=32, verbose_name='КПП'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='psrn',
field=models.CharField(default='', max_length=32, verbose_name='ОГРН'),
preserve_default=False,
),
migrations.AlterField(
model_name='userfinancialinfo',
name='date_of_birth',
field=models.DateField(blank=True, null=True),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='passport_issue_date',
field=models.DateField(blank=True, null=True),
),
]

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-01-09 09:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0024_auto_20170105_1808'),
]
operations = [
migrations.AddField(
model_name='userfinancialinfo',
name='authorized_bank_name',
field=models.CharField(default='', max_length=32, verbose_name='Название уполномоченного банка в РФ'),
preserve_default=False,
),
migrations.AddField(
model_name='userfinancialinfo',
name='organization_reg_number',
field=models.CharField(default='', max_length=64, verbose_name='Регистрационный номер в налоговом органе'),
preserve_default=False,
),
migrations.AlterField(
model_name='userfinancialinfo',
name='inn',
field=models.CharField(blank=True, max_length=100, verbose_name='ИНН'),
),
migrations.AlterField(
model_name='userfinancialinfo',
name='legal_status',
field=models.CharField(choices=[('individual', 'Физическое лицо'), ('entity', 'Юридическое лицо'), ('employed', 'Индивидуальный предприниматель')], max_length=30),
),
]

@ -56,30 +56,54 @@ class UserFinancialInfo(models.Model):
RESIDENCIES = ( RESIDENCIES = (
('russian_resident', 'Резидент РФ'), ('russian_resident', 'Резидент РФ'),
('non_russian_resident', 'Нерезидент РФ'), ('non_russian_resident', 'Нерезидент РФ'),
('refugee', 'Беженец'),
('russian_stay_permit', 'Вид на жительство'), ('russian_stay_permit', 'Вид на жительство'),
) )
LEGAL_STATUSES = ( LEGAL_STATUSES = (
('individual', 'Физическое лицо'), ('individual', 'Физическое лицо'),
('legal_entity', 'ИП и юридическое лицо'), ('entity', 'Юридическое лицо'),
('employed', 'Индивидуальный предприниматель'),
) )
address = models.CharField(max_length=1000) residency = models.CharField(max_length=50, choices=RESIDENCIES)
credit_card_number = models.CharField(max_length=50)
date_of_birth = models.DateField()
fio = models.CharField(max_length=255)
inn = models.CharField(max_length=100)
legal_status = models.CharField(max_length=30, choices=LEGAL_STATUSES) legal_status = models.CharField(max_length=30, choices=LEGAL_STATUSES)
passport_issue_date = models.DateField()
passport_issued_by = models.CharField(max_length=255) fio = models.CharField(max_length=255, blank=True)
passport_number = models.CharField(max_length=10) date_of_birth = models.DateField(null=True, blank=True)
phone = models.CharField(max_length=30, blank=True)
# @deprecated
address = models.CharField(max_length=1000, blank=True)
postal_address = models.CharField(max_length=255, verbose_name='Почтовый адрес', blank=True)
registration_address = models.CharField(max_length=255, verbose_name='Адрес регистрации', blank=True)
credit_card_number = models.CharField(max_length=50, blank=True)
inn = models.CharField(max_length=100, blank=True, verbose_name='ИНН')
passport_issue_date = models.DateField(null=True, blank=True)
passport_issued_by = models.CharField(max_length=255, verbose_name="Кем выдан", blank=True)
passport_number = models.CharField(max_length=10, blank=True)
passport_scan = models.ImageField(upload_to='users/contractors/') passport_scan = models.ImageField(upload_to='users/contractors/')
passport_series = models.CharField(max_length=6) passport_series = models.CharField(max_length=6, blank=True)
phone = models.CharField(max_length=30) subdivision_code = models.CharField(max_length=10, verbose_name='Код подразделения', blank=True)
residency = models.CharField(max_length=50, choices=RESIDENCIES)
subdivision_code = models.CharField(max_length=10) yandex_money = models.CharField(max_length=50, blank=True)
yandex_money = models.CharField(max_length=50) web_money = models.CharField(max_length=50, blank=True)
# Юридические данные
correspondent_account = models.CharField(max_length=32, verbose_name='Корреспондентский счет', blank=True)
bank_bic = models.CharField(max_length=32, verbose_name='БИК банка', blank=True)
bank_inn = models.CharField(max_length=32, verbose_name='ИНН банка', blank=True)
checking_account = models.CharField(max_length=64, verbose_name='Расчетный счет', blank=True)
bank_name = models.CharField(max_length=32, verbose_name='Название банка', blank=True)
authorized_bank_name = models.CharField(max_length=32, verbose_name='Название уполномоченного банка в РФ', blank=True)
ppc = models.CharField(max_length=32, verbose_name='КПП', blank=True)
psrn = models.CharField(max_length=32, verbose_name='ОГРН', blank=True)
organization_name = models.CharField(max_length=32, verbose_name="Название организации", blank=True)
organization_registered_address = models.CharField(max_length=255, verbose_name="Юридический адрес", blank=True)
organization_postal_address = models.CharField(max_length=255, verbose_name="Почтовый адрес", blank=True)
organization_reg_number = models.CharField(max_length=64, verbose_name="Регистрационный номер в налоговом органе", blank=True)
def __str__(self): def __str__(self):
return self.fio return self.fio

@ -1,146 +0,0 @@
.mainContent {
padding: 43px 25px 40px 25px;
}
/*TODO: Привязать к ширине блока справа*/
.avatarInset {
width: 210px;
height: 210px;
}
.avatar {
background-color: #F1F1F1;
width: 228px;
height: 228px;
padding: 10px;
}
.simple-input, .simple-select {
height: 51px;
width: 100%;
border: 1px solid #cccccc;
outline: none;
padding: 5px 40px 5px 20px;
background-color: white;
margin-bottom: -1px;
}
.simple-input:-webkit-autofill, .simple-select:-webkit-autofill{
transition: background-color 5000s ease-in-out 0s
}
.simple-select select {
background-color: darkgray;
}
.simple-select {
display: flex;
align-items: center;
text-align: center;
}
.simple-select.fill{
background-color: #F2F2F2;
}
.simple-select .text{
color: #a3a3a3;
}
.toggle .btn {
padding: 14px 20px;
border-radius: 40px;
}
.bottom-line {
padding-bottom: 10px;
border-bottom: 1px solid #cccccc;
}
.top-line {
/*padding-bottom: 10px;*/
border-top: 1px solid #cccccc;
}
/* СУПЕР-костыльная кнопка. Не прикасаться!*/
.upload-new {
width: 50%;
height: 30px;
overflow: hidden;
cursor: pointer;
border-radius: 40px;
border: 1px solid #FF0029;
}
.upload-new:hover, .btn-simple:hover {
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
-webkit-transform: scale(1.04);
-moz-transform: scale(1.04);
transform: scale(1.04);
}
.upload-new, .btn-simple {
transition: all 0.3s;
cursor: pointer;
}
.upload-new input {
display: block !important;
width: 100% !important;
height: 30px !important;
opacity: 0 !important;
cursor: pointer;
}
.upload-new p {
line-height: 30px;
text-transform: uppercase;
margin: -30px 0 0 0;
/*padding: 0 5px 0 5px;*/
font-size: 12px;
text-align: center;
font-family: Myriad;
}
/** Конец супер-костыля**/
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.info {
background-color: #F2F2F2;
padding: 50px 40px;
margin-top: 20px;
}
.btn-simple {
border-radius: 40px;
padding: 10px 15px;
border: 1px solid #FF0029;
/*color: black;*/
background: none;
font-family: Myriad;
font-weight: normal;
font-style: normal;
font-size: 14pt;
}
.no-margin .selected-element {
margin: 0;
}
.-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;
}

@ -0,0 +1,130 @@
.mainContent
padding: 43px 25px 40px 25px
/*TODO: Привязать к ширине блока справа
.avatarInset
width: 210px
height: 210px
.avatar
background-color: #F1F1F1
width: 228px
height: 228px
padding: 10px
.simple-input, .simple-select
height: 51px
width: 100%
border: 1px solid #cccccc
outline: none
padding: 5px 40px 5px 20px
background-color: white
margin-bottom: -1px
.simple-input:-webkit-autofill
transition: background-color 5000s ease-in-out 0s
.simple-select
&:-webkit-autofill
transition: background-color 5000s ease-in-out 0s
select
background-color: darkgray
display: flex
align-items: center
text-align: center
&.fill
background-color: #F2F2F2
.text
color: #a3a3a3
.toggle .btn
padding: 14px 20px
border-radius: 40px
.bottom-line
padding-bottom: 10px
border-bottom: 1px solid #cccccc
.top-line
/*padding-bottom: 10px;
border-top: 1px solid #cccccc
/* СУПЕР-костыльная кнопка. Не прикасаться -)
.upload-new
width: 50%
height: 30px
overflow: hidden
cursor: pointer
border-radius: 40px
border: 1px solid #FF0029
&:hover
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2)
-webkit-transform: scale(1.04)
-moz-transform: scale(1.04)
transform: scale(1.04)
.btn-simple:hover
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2)
-webkit-transform: scale(1.04)
-moz-transform: scale(1.04)
transform: scale(1.04)
.upload-new, .btn-simple
transition: all 0.3s
cursor: pointer
.upload-new
input
display: block !important
width: 100% !important
height: 30px !important
opacity: 0 !important
cursor: pointer
p
line-height: 30px
text-transform: uppercase
margin: -30px 0 0 0
/*padding: 0 5px 0 5px;
font-size: 12px
text-align: center
font-family: Myriad
/** Конец супер-костыля*
.row-eq-height
display: -webkit-box
display: -webkit-flex
display: -ms-flexbox
display: flex
.info, .financial_info
background-color: #F2F2F2
padding: 30px 40px 50px
margin-top: 20px
.header
margin-top: 30px
.btn-simple
border-radius: 40px
padding: 10px 15px
border: 1px solid #FF0029
/*color: black;
background: none
font-family: Myriad
font-weight: normal
font-style: normal
font-size: 14pt
.no-margin .selected-element
margin: 0
.-live-image-avatar-upload-container
.-position-relative-parent
position: relative
.-live-image-delete
position: absolute
top: 0
right: 0
background-color: white

@ -0,0 +1,418 @@
<div class="row financial_info">
<div class="row">
<div class="col-lg-6">
<div class="header">Имя, Фамилия, Отчество</div>
<input name="{{ fin_info_form.fio.html_name }}" class="simple-input"
placeholder="Иванов Иван Иванович"
value="{{ fin_info_form.fio.value }}">
</div>
<div class="col-lg-3">
<div class="header"> Дата рождения</div>
{{ fin_info_form.date_of_birth }}
</div>
<div class="col-lg-3">
<div class="header">Телефон</div>
<input name="{{ fin_info_form.phone.html_name }}" class="simple-input phone"
placeholder="+7(909)999 00 00"
value="{{ fin_info_form.phone.value }}"
type="tel">
</div>
</div>
<div class="header">Резиденство</div>
<div class="row">
{% for residence in RESIDENCIES %}
<div class="{% if forloop.last %}col-lg-4{% else %}col-lg-3{% endif %}">
<label class="mod-align-center fin_statuses">
<input name="{{ fin_info_form.residency.html_name }}" class="custom-radio" type="radio"
{% if residence.0 == fin_info_form.residency.value %}checked {% endif %}
value="{{ residence.0 }}">
&nbsp; {{ residence.1 }}
</label>
</div>
{% endfor %}
</div>
<div class="header">Юридический статус</div>
<div class="row">
{% for legal_status in LEGAL_STATUSES %}
<div class="{% if forloop.last %}col-lg-4{% else %}col-lg-3{% endif %}">
<label class="mod-align-center fin_statuses">
<input name="{{ fin_info_form.legal_status.html_name }}" class="custom-radio" type="radio"
{% if legal_status.0 == fin_info_form.legal_status.value %}checked {% endif %}
value="{{ legal_status.0 }}">
&nbsp; {{ legal_status.1 }}
</label>
</div>
{% endfor %}
</div>
<div class="row">
<div class="col-lg-12">
<div class="separator">
<div class="border"></div>
</div>
</div>
</div>
<div class="js-fin-info" id="-russian_resident-individual" >
<div class="row">
<div class="col-lg-3">
<div class="header">Серия паспорта</div>
<input name="{{ fin_info_form.passport_series.html_name }}" class="simple-input passport_series"
placeholder="1234"
value="{{ fin_info_form.passport_series.value }}">
</div>
<div class="col-lg-3">
<div class="header">Номер паспорта</div>
<input name="{{ fin_info_form.passport_number.html_name }}" class="simple-input passport_number"
placeholder="567890"
value="{{ fin_info_form.passport_number.value }}">
</div>
<div class="col-lg-3 -non_russian_resident-individual">
<div class="header">Код подразделения</div>
<input name="{{ fin_info_form.subdivision_code.html_name }}" class="simple-input subdivision_code"
placeholder="321-645"
value="{{ fin_info_form.subdivision_code.value }}">
</div>
<div class="col-lg-3">
<div class="header">Дата выдачи</div>
{{ fin_info_form.passport_issue_date }}
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">Кем выдан</div>
<input name="{{ fin_info_form.passport_issued_by.html_name }}" class="simple-input"
placeholder="УВД Центрального района Московской области"
value="{{ fin_info_form.passport_issued_by.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">Почтовый адрес</div>
<input name="{{ fin_info_form.postal_address.html_name }}" class="simple-input"
placeholder="143500, Россия, Московская обл. Истринский р-н, д.Красновидово ул.Полевая д.65"
value="{{ fin_info_form.postal_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">Адрес регистрации</div>
<input name="{{ fin_info_form.registration_address.html_name }}" class="simple-input"
placeholder="143500, Россия, Московская обл. Истринский р-н, д.Красновидово ул.Полевая д.65"
value="{{ fin_info_form.registration_address.value }}">
</div>
</div>
<div class="row -russian_stay_permit-individual">
<div class="col-lg-12">
<div class="header">Адрес в стране, гражданином которой является иностранное физическое лицо</div>
<input name="{{ fin_info_form.country_address.html_name }}" class="simple-input"
placeholder=""
value="{{ fin_info_form.country_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="separator">
<div class="border"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="header">ИНН</div>
<input name="{{ fin_info_form.inn.html_name }}" class="simple-input inn"
placeholder="12345678912"
value="{{ fin_info_form.inn.value }}">
</div>
<div class="col-lg-3">
<div class="header">Номер карты</div>
<input name="{{ fin_info_form.credit_card_number.html_name }}" class="simple-input credit_card_number"
placeholder="4444-4444-4444-4448-444"
value="{{ fin_info_form.credit_card_number.value }}">
</div>
<div class="col-lg-3">
<div class="header">Яндекс.Деньги</div>
<input name="{{ fin_info_form.yandex_money.html_name }}" class="simple-input yandex_money"
placeholder="410012310862090"
value="{{ fin_info_form.yandex_money.value }}">
</div>
<div class="col-lg-3">
<div class="header">WebMoney</div>
<input name="{{ fin_info_form.web_money.html_name }}" class="simple-input yandex_money"
placeholder="410012310862090"
value="{{ fin_info_form.web_money.value }}">
</div>
</div>
</div>
<div class="js-fin-info" id="-russian_resident-entity" >
<div class="row">
<div class="col-lg-6">
<div class="header">{{ fin_info_form.correspondent_account.label }}</div>
<input name="{{ fin_info_form.correspondent_account.html_name }}" class="simple-input correspondent_account"
placeholder="30101810900000000181"
value="{{ fin_info_form.correspondent_account.value }}">
</div>
<div class="col-lg-3">
<div class="header">{{ fin_info_form.bank_bic.label }}</div>
<input name="{{ fin_info_form.bank_bic.html_name }}" class="simple-input bank_bic"
placeholder="044567899"
value="{{ fin_info_form.bank_bic.value }}">
</div>
<div class="col-lg-3">
<div class="header">{{ fin_info_form.bank_inn.label }}</div>
<input name="{{ fin_info_form.bank_inn.html_name }}" class="simple-input inn"
placeholder="1123456789"
value="{{ fin_info_form.bank_inn.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.checking_account.label }}</div>
<input name="{{ fin_info_form.checking_account.html_name }}" class="simple-input checking_account"
placeholder="11234567891234567890"
value="{{ fin_info_form.checking_account.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.bank_name.label }}</div>
<input name="{{ fin_info_form.bank_name.html_name }}" class="simple-input"
placeholder="'Возрождение'(ПАО) г.Москва"
value="{{ fin_info_form.bank_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="header">{{ fin_info_form.ppc.label }}</div>
<input name="{{ fin_info_form.ppc.html_name }}" class="simple-input"
placeholder="501701001"
value="{{ fin_info_form.ppc.value }}">
</div>
<div class="col-lg-6">
<div class="header">{{ fin_info_form.psrn.label }}</div>
<input name="{{ fin_info_form.psrn.html_name }}" class="simple-input"
placeholder="1065017025226"
value="{{ fin_info_form.psrn.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="separator">
<div class="border"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_name.label }}</div>
<input name="{{ fin_info_form.organization_name.html_name }}" class="simple-input"
placeholder="ООО Архитектура Проект Сервис"
value="{{ fin_info_form.organization_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_registered_address.label }}</div>
<input name="{{ fin_info_form.organization_registered_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_registered_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_postal_address.label }}</div>
<input name="{{ fin_info_form.organization_postal_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_postal_address.value }}">
</div>
</div>
</div>
<div class="js-fin-info" id="-non_russian_resident-entity" >
<div class="row">
<div class="col-lg-6">
<div class="header">Корр.счет вашего банка в уполномоченном банке</div>
<input name="{{ fin_info_form.correspondent_account.html_name }}" class="simple-input correspondent_account"
placeholder="30101810900000000181"
value="{{ fin_info_form.correspondent_account.value }}">
</div>
<div class="col-lg-3">
<div class="header">БИК уполномоченного банка</div>
<input name="{{ fin_info_form.bank_bic.html_name }}" class="simple-input bank_bic"
placeholder="044567899"
value="{{ fin_info_form.bank_bic.value }}">
</div>
<div class="col-lg-3">
<div class="header">ИНН уполномоченного банка</div>
<input name="{{ fin_info_form.bank_inn.html_name }}" class="simple-input inn"
placeholder="1123456789"
value="{{ fin_info_form.bank_inn.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.checking_account.label }} (IBAN)</div>
<input name="{{ fin_info_form.checking_account.html_name }}" class="simple-input checking_account"
placeholder="11234567891234567890"
value="{{ fin_info_form.checking_account.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">Название вашего банка</div>
<input name="{{ fin_info_form.bank_name.html_name }}" class="simple-input"
placeholder="'Возрождение'(ПАО) г.Москва"
value="{{ fin_info_form.bank_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">Название уполномоченного банка в РФ</div>
<input name="{{ fin_info_form.authorized_bank_name.html_name }}" class="simple-input"
placeholder="'Возрождение'(ПАО) г.Москва"
value="{{ fin_info_form.authorized_bank_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="separator">
<div class="border"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_name.label }}</div>
<input name="{{ fin_info_form.organization_name.html_name }}" class="simple-input"
placeholder="ООО Архитектура Проект Сервис"
value="{{ fin_info_form.organization_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_registered_address.label }}</div>
<input name="{{ fin_info_form.organization_registered_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_registered_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_postal_address.label }}</div>
<input name="{{ fin_info_form.organization_postal_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_postal_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_reg_number.label }}</div>
<input name="{{ fin_info_form.organization_reg_number.html_name }}" class="simple-input"
placeholder=""
value="{{ fin_info_form.organization_reg_number.value }}">
</div>
</div>
</div>
<div class="js-fin-info" id="-russian_resident-employed">
<div class="row">
<div class="col-lg-6">
<div class="header">{{ fin_info_form.correspondent_account.label }}</div>
<input name="{{ fin_info_form.correspondent_account.html_name }}" class="simple-input correspondent_account"
placeholder="30101810900000000181"
value="{{ fin_info_form.correspondent_account.value }}">
</div>
<div class="col-lg-6">
<div class="header">{{ fin_info_form.inn.label }}</div>
<input name="{{ fin_info_form.inn.html_name }}" class="simple-input inn"
placeholder="5017064770 Свидетельство 50№010352102 jn 19.06.2006г."
value="{{ fin_info_form.inn.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="header">{{ fin_info_form.checking_account.label }}</div>
<input name="{{ fin_info_form.checking_account.html_name }}" class="simple-input checking_account"
placeholder="11234567891234567890"
value="{{ fin_info_form.checking_account.value }}">
</div>
<div class="col-lg-6">
<div class="header">Номер карты Р/С</div>
<input name="{{ fin_info_form.credit_card_number.html_name }}" class="simple-input credit_card_number"
placeholder="4444-4444-4444-4448-444"
value="{{ fin_info_form.credit_card_number.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.bank_name.label }}</div>
<input name="{{ fin_info_form.bank_name.html_name }}" class="simple-input"
placeholder="'Возрождение'(ПАО) г.Москва"
value="{{ fin_info_form.bank_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="header">{{ fin_info_form.bank_bic.label }}</div>
<input name="{{ fin_info_form.bank_bic.html_name }}" class="simple-input bank_bic"
placeholder="501701001"
value="{{ fin_info_form.bank_bic.value }}">
</div>
<div class="col-lg-6">
<div class="header">{{ fin_info_form.psrn.label }}ИП</div>
<input name="{{ fin_info_form.psrn.html_name }}" class="simple-input"
placeholder="106501702522678"
value="{{ fin_info_form.psrn.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="separator">
<div class="border"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_name.label }}</div>
<input name="{{ fin_info_form.organization_name.html_name }}" class="simple-input"
placeholder="ООО Архитектура Проект Сервис"
value="{{ fin_info_form.organization_name.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_registered_address.label }}</div>
<input name="{{ fin_info_form.organization_registered_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_registered_address.value }}">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="header">{{ fin_info_form.organization_postal_address.label }}</div>
<input name="{{ fin_info_form.organization_postal_address.html_name }}" class="simple-input"
placeholder="143500, РФ, Московская область, Истринский район, г. Истра, ул.Адасько,д.9, оф.9"
value="{{ fin_info_form.organization_postal_address.value }}">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12" style="text-align: right">
<div style="display: block;" class="header">&nbsp;</div>
<input type="submit" class="btn btn-simple" value="СОХРАНИТЬ">
</div>
</div>
</div> <!-- financial_info -->
<script>
window.onload = function () {
$('.passport_series').mask('0000');
$('.passport_number').mask('000000');
$('.subdivision_code').mask('000-000');
$('.inn').mask('0#');
$('.yandex_money').mask('0#');
$('.web_money').mask('0#');
$('.bank_bic').mask('0#');
$('.correspondent_account').mask('0#');
$('.checking_account').mask('0#');
$('.credit_card_number').mask('0000-0000-0000-0000-0000');
$('.datepicker').mask('00.00.0000');
}
</script>

@ -0,0 +1,92 @@
<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">
{% if request.user.is_contractor %}
<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>
{% else %}
<div class="header">{{ form.organization_name.label }}</div>
<input name="organization_name" class="simple-input"
placeholder="Название организации"
{# autocomplete="False"#}
value="{{ form.organization_name.value }}">
{% endif %}
</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">
<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">
<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">
<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" style="text-align: center">
<div style="display: block;" class="header">&nbsp;</div>
<input type="submit" class="btn btn-simple" value="СОХРАНИТЬ">
</div>
</div>

@ -5,17 +5,13 @@
{#{% block old_css %}{% endblock %}#} {#{% block old_css %}{% endblock %}#}
{% block personal_css %} {% block personal_css %}
<link rel='stylesheet' href='{% sass_src "lib/proekton-components/sass/components.sass" %}'> <link rel='stylesheet' href='{% sass_src "lib/proekton-components/sass/components.sass" %}'>
<link rel='stylesheet' href='{% sass_src "sass/old_main.sass" %}'> <link rel='stylesheet' href='{% sass_src "sass/components/custom-components.sass" %}'>
<link rel='stylesheet' href='{% static "css/project_filter.css" %}'>{# other #} <link rel='stylesheet' href='{% sass_src "sass/user-profile-edit.sass" %}'>
<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 %} {% endblock %}
{% block content %} {% block content %}
<div class="container main-scope"> <div class="container main-scope">
<div class="row main-content"> <div class="row main-content">
{# <div class="old-main">#}
<form method="POST" enctype="multipart/form-data" novalidate> <form method="POST" enctype="multipart/form-data" novalidate>
{% csrf_token %} {% csrf_token %}
{% if request.user.is_customer %} {% if request.user.is_customer %}
@ -116,7 +112,7 @@
<div class="col-lg-8"> <div class="col-lg-8">
<div class="selected-container horizontal vertical-child no-margin" <div class="selected-container horizontal vertical-child no-margin"
id="selected-location"> id="selected-location">
<div class="header">&nbsp;</div> <div class="header" style="display: block">&nbsp;</div>
<input type="hidden" name="location" <input type="hidden" name="location"
value="{{ form.location.value }}"> value="{{ form.location.value }}">
</div> </div>
@ -215,113 +211,31 @@
<div class="col-lg-12"> <div class="col-lg-12">
<div class="top-line" style="padding-top: 15px"> <div class="top-line" style="padding-top: 15px">
<div class="btn-group toggle" role="group" aria-label="..."> <div class="btn-group toggle" role="group" aria-label="...">
<a style="z-index: 0" href="#" <a data-toggle="tab" href="#info"
{# <a style="z-index: 0" href="{% url 'users:user-profile-edit' pk=pk %}"#}
role="button" role="button"
class="btn btn-default active">Общая информация</a> class="btn btn-default tab-inserted active">
<a href="#" Общая информация
class="btn btn-default" role="button">Финансовая информация</a> </a>
<a data-toggle="tab" href="#financial_info"
class="btn btn-default tab-inserted" role="button">
Финансоваяинформация
</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row info"> <div class="tab-content">
<div class="col-lg-3"> <div id="info" class="tab-pane fade in active">
<div class="header"> Дата рождения</div> {% include 'partials/tabs/tab-user-info.html' %}
<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">
{% if request.user.is_contractor %}
<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 id="financial_info" class="tab-pane fade">
{% include 'partials/tabs/tab-user-financial_info.html' %}
</div> </div>
</div> </div>
{% else %}
<div class="header">{{ form.organization_name.label }}</div>
<input name="organization_name" class="simple-input"
placeholder="Название организации"
{# autocomplete="False"#}
value="{{ form.organization_name.value }}">
{% endif %}
</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>
</div> <!-- bottom --> </div> <!-- bottom -->
</div> </div>
</form> </form>
{# </div>#}
</div> </div>
</div> </div>
@ -329,7 +243,6 @@
{% block personal_js %} {% block personal_js %}
{{ block.super }} {{ block.super }}
<script src='{% static "lib/proekton-components/js/build/init_user_profile.js" %}'></script> <script src='{% static "lib/proekton-components/js/build/init_user_profile.js" %}'></script>
<script src='{% static "projects-filter.js" %}'></script>
<script src='{% static "lib/jquery.fileupload/js/vendor/jquery.ui.widget.js" %}'></script> <script src='{% static "lib/jquery.fileupload/js/vendor/jquery.ui.widget.js" %}'></script>
<script src='{% static "lib/jquery-ui/jquery-ui.js" %}'></script> <script src='{% static "lib/jquery-ui/jquery-ui.js" %}'></script>
<script src='{% static "lib/jquery-ui/i18n/datepicker-ru.js" %}'></script> <script src='{% static "lib/jquery-ui/i18n/datepicker-ru.js" %}'></script>

@ -17,8 +17,6 @@ from .views import (
CustomerProfileTrashedProjectsView, CustomerProfileTrashedProjectsView,
TeamCreateView, TeamCreateView,
TeamProfileView, TeamProfileView,
UserFinancialInfoEditView,
UserProfileEditView,
UserProfileEditViewFull, UserProfileEditViewFull,
) )

@ -21,7 +21,7 @@ _.map = _.map_;
_.filter = _.filter_ _.filter = _.filter_
from .forms import TeamForm, ContractorResumeFilesForm, ContractorResumeForm, CustomerProfileForm from .forms import TeamForm, ContractorResumeFilesForm, ContractorResumeForm, CustomerProfileForm
from .models import User, Team, ContractorResume, ContractorResumeFiles, TeamInvitation from .models import User, Team, ContractorResume, ContractorResumeFiles, TeamInvitation, UserFinancialInfo
from archilance import util from archilance import util
from archilance.mixins import BaseMixin from archilance.mixins import BaseMixin
from common.mixins import ContractorRequiredMixin, NoCsrfMixin from common.mixins import ContractorRequiredMixin, NoCsrfMixin
@ -46,68 +46,69 @@ from .forms import (
) )
class UserProfileEditView(BaseMixin, View): # class UserProfileEditView(BaseMixin, View):
form_class = UserProfileEditForm # form_class = UserProfileEditForm
template_name = 'user_profile_edit.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:
raise PermissionDenied # raise PermissionDenied
#
def get(self, request, *args, **kwargs): # def get(self, request, *args, **kwargs):
context = self.get_context_data(**_.merge({}, request.GET, kwargs)) # context = self.get_context_data(**_.merge({}, request.GET, kwargs))
#
form = self.form_class(request=request, instance=request.user) # form = self.form_class(request=request, instance=request.user)
context.update({'form': form}) # context.update({'form': form})
#
return render(request, self.template_name, context) # return render(request, self.template_name, context)
#
def post(self, request, *args, **kwargs): # def post(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs) # context = self.get_context_data(**kwargs)
#
specs = request.POST.getlist('contractor_specializations') # specs = request.POST.getlist('contractor_specializations')
request.POST.setlist('contractor_specializations', _.compact(specs)) # Ignore empty input values # request.POST.setlist('contractor_specializations', _.compact(specs)) # Ignore empty input values
#
form = self.form_class(request.POST, request=request, instance=request.user) # form = self.form_class(request.POST, request=request, instance=request.user)
#
if form.is_valid(): # if form.is_valid():
user = form.save() # user = form.save()
#
live_image = form.cleaned_data.get('live_image') # live_image = form.cleaned_data.get('live_image')
#
if live_image: # if live_image:
new_image = ContentFile(live_image.file.read()) # new_image = ContentFile(live_image.file.read())
new_image.name = live_image.file.name # new_image.name = live_image.file.name
#
user.avatar = new_image # user.avatar = new_image
user.save() # user.save()
#
live_image.file.delete() # live_image.file.delete()
live_image.delete() # live_image.delete()
#
messages.info(request, 'Пользователь успешно отредактирован') # messages.info(request, 'Пользователь успешно отредактирован')
redirect_to = request.POST.get('next') # redirect_to = request.POST.get('next')
return redirect(redirect_to) # return redirect(redirect_to)
else: # else:
if form.errors: # if form.errors:
messages.info(request, ( # messages.info(request, (
'<p>Произошла ошибка (form)</p>' # '<p>Произошла ошибка (form)</p>'
'<pre>{form}</pre>' # '<pre>{form}</pre>'
).format(form=pformat(form.errors))) # ).format(form=pformat(form.errors)))
#
context.update({'form': form}) # context.update({'form': form})
return render(request, self.template_name, context) # return render(request, self.template_name, context)
class UserProfileEditViewFull(BaseMixin, View): class UserProfileEditViewFull(BaseMixin, View):
form_class = UserProfileEditFullForm form_class = UserProfileEditFullForm
fin_info_form_class = UserFinancialInfoEditForm
template_name = 'user_profile_edit.html' template_name = 'user_profile_edit.html'
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
@ -125,15 +126,25 @@ class UserProfileEditViewFull(BaseMixin, View):
context = self.get_context_data(**_.merge({}, request.GET, kwargs)) context = self.get_context_data(**_.merge({}, request.GET, kwargs))
form = self.form_class(instance=request.user) form = self.form_class(instance=request.user)
fin_info_form = self.fin_info_form_class(request=request, instance=request.user.financial_info,
prefix='fin_info')
# import code # import code
# code.interact(local=dict(globals(), **locals())) # code.interact(local=dict(globals(), **locals()))
context.update({'form': form}) context.update({
'form': form,
'fin_info_form': fin_info_form
})
context.update({
'RESIDENCIES': UserFinancialInfo.RESIDENCIES,
'LEGAL_STATUSES': UserFinancialInfo.LEGAL_STATUSES,
})
return render(request, self.template_name, context) return render(request, self.template_name, context)
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs) context = self.get_context_data(**kwargs)
# '1,3,4' --> ['1', '3', '4']
specs = tuple(filter(None, re.split(r'\s|,|;', request.POST.get('contractor_specializations', '')))) specs = tuple(filter(None, re.split(r'\s|,|;', request.POST.get('contractor_specializations', ''))))
request.POST.setlist('contractor_specializations', specs) request.POST.setlist('contractor_specializations', specs)
@ -143,10 +154,20 @@ class UserProfileEditViewFull(BaseMixin, View):
constructs = tuple(filter(None, re.split(r'\s|,|;', request.POST.get('contractor_construction_types', '')))) constructs = tuple(filter(None, re.split(r'\s|,|;', request.POST.get('contractor_construction_types', ''))))
request.POST.setlist('contractor_construction_types', constructs) request.POST.setlist('contractor_construction_types', constructs)
print("!)request.POST = ", request.POST)
# Отфильтровываем пустые значения
for key in request.POST.keys():
request.POST.setlist(key, list(filter(lambda el: el, request.POST.getlist(key, ''))))
form = self.form_class(request.POST, request=request, instance=request.user) form = self.form_class(request.POST, request=request, instance=request.user)
print("2)request.POST = ", request.POST)
fin_info_form = self.fin_info_form_class(request.POST, request=request,
instance=request.user.financial_info, prefix='fin_info')
if form.is_valid(): if form.is_valid() and fin_info_form.is_valid():
user = form.save() user = form.save()
fin_info = fin_info_form.save()
live_image = form.cleaned_data.get('live_image') live_image = form.cleaned_data.get('live_image')
@ -160,17 +181,22 @@ class UserProfileEditViewFull(BaseMixin, View):
live_image.file.delete() live_image.file.delete()
live_image.delete() live_image.delete()
user.financial_info = fin_info
user.save()
messages.info(request, 'Пользователь успешно отредактирован') messages.info(request, 'Пользователь успешно отредактирован')
redirect_to = request.POST.get('next') redirect_to = request.POST.get('next')
return redirect(redirect_to) return redirect(redirect_to)
else: else:
if form.errors: if form.errors or fin_info_form.errors:
messages.info(request, ( messages.info(request, (
'<p>Произошла ошибка (form)</p>' '<p>Произошла ошибка (form)</p>'
'<pre>{form}</pre>' '<pre>{form}</pre>'
).format(form=pformat(form.errors))) '<p>Произошла ошибка (fin_info_form)</p>'
'<pre>{fin_info_form}</pre>'
).format(form=pformat(form.errors), fin_info_form=pformat(fin_info_form.errors)))
context.update({'form': form}) context.update({'form': form, 'fin_info_form': fin_info_form})
return render(request, self.template_name, context) return render(request, self.template_name, context)
@ -252,188 +278,6 @@ class UserFinancialInfoEditView(BaseMixin, View):
return render(request, self.template_name, context) return render(request, self.template_name, context)
# class ContractorFilterViewOld(BaseMixin, View):
# template_name = 'contractor_filter.html'
# form_class = ContractorFilterForm
#
# def get(self, request, *args, **kwargs):
# form = self.form_class(request.GET, request=request)
# context = self.get_context_data(**_.merge({}, request.GET, kwargs))
# coll = []
#
# if form.is_valid():
# contractors = teams = None
# contr_count = team_count = None
# get_contractors = get_teams = None
# ord = None
#
# cro = form.cleaned_data.get('cro')
# specialization = form.cleaned_data.get('specialization')
# location = form.cleaned_data.get('location')
# work_type = form.cleaned_data.get('work_type')
# build_classif = form.cleaned_data.get('building_classification')
# constr_type = form.cleaned_data.get('construction_type')
#
# party_types = form.cleaned_data.get('party_types')
# last_party_types = form.cleaned_data.get('last_party_types')
#
# if party_types == 'all':
# get_contractors = get_teams = True
# elif party_types == 'contractors':
# get_contractors = True
# elif party_types == 'teams':
# get_teams = True
# elif not party_types:
# if last_party_types == 'contractors':
# get_contractors = True
# elif last_party_types == 'teams':
# get_teams = True
# else:
# get_contractors = get_teams = True
#
# if party_types:
# last_party_types = party_types
#
# context.update({'last_party_types': last_party_types})
#
# if get_contractors:
# contractors = User.contractor_objects.all()
#
# if cro:
# contractors = contractors.filter(cro=cro)
#
# if specialization:
# contractors = contractors.filter(
# contractor_specializations__lft__gte=specialization.lft,
# contractor_specializations__rght__lte=specialization.rght,
# )
#
# if location:
# contractors = contractors.filter(
# location__lft__gte=location.lft,
# location__rght__lte=location.rght,
# )
#
# if work_type:
# contractors = contractors.filter(orders__project__work_type=work_type)
#
# if build_classif:
# contractors = contractors.filter(Q(orders__project__realty__building_classification=build_classif) |
# Q(contractor_building_classifications=build_classif))
#
# if constr_type:
# contractors = contractors.filter(Q(orders__project__realty__construction_type=constr_type) |
# Q(contractor_construction_types=constr_type))
#
# if get_teams:
# teams = Team.objects.all()
#
# if cro:
# teams = teams.filter(Q(contractors__cro=cro) | Q(owner__cro=cro))
#
# if specialization:
# teams = teams.filter(
# (
# Q(contractors__contractor_specializations__lft__gte=specialization.lft)
# & Q(contractors__contractor_specializations__rght__lte=specialization.rght)
# ) | (
# Q(owner__contractor_specializations__lft__gte=specialization.lft)
# & Q(owner__contractor_specializations__rght__lte=specialization.rght)
# ),
# )
#
# if location:
# teams = teams.filter(
# (
# Q(contractors__location__lft__gte=location.lft)
# & Q(contractors__location__rght__lte=location.rght)
# ) | (
# Q(owner__location__lft__gte=location.lft)
# & Q(owner__location__rght__lte=location.rght)
# ),
# )
#
# if work_type:
# teams = teams.filter(
# Q(contractors__orders__project__work_type=work_type)
# | Q(owner__orders__project__work_type=work_type),
# )
#
# if build_classif:
# teams = teams.filter(
# Q(contractors__orders__project__realty__building_classification=build_classif)
# | Q(owner__orders__project__realty__building_classification=build_classif),
# )
#
# if constr_type:
# teams = teams.filter(
# Q(contractors__orders__project__realty__construction_type=constr_type)
# | Q(owner__orders__project__realty__construction_type=constr_type),
# )
#
# if get_contractors and get_teams:
# coll = tuple(itertools.chain(contractors.distinct(), teams.distinct()))
# count = len(coll)
# display_msg = 'Найдено %s элементов' % count if count > 0 else 'Ничего не найдено'
# elif get_contractors:
# coll = contractors.distinct()
# count = coll.count()
# display_msg = 'Найдено %s исполнителей' % count if count > 0 else 'Ничего не найдено'
# elif get_teams:
# coll = teams.distinct()
# count = coll.count()
# display_msg = 'Найдено %s групп' % count if count > 0 else 'Ничего не найдено'
#
# order_by = form.cleaned_data.get('order_by')
# last_order_by = form.cleaned_data.get('last_order_by')
# reverse_order = form.cleaned_data.get('reverse_order')
#
# if order_by:
# reverse_order = not reverse_order if order_by == last_order_by else False
# ord = order_by
# last_order_by = ord
# elif last_order_by:
# ord = last_order_by
#
# if ord:
# if ord == 'name':
# coll = natsort.natsorted(coll, key=lambda obj: getattr(obj, 'username', None) or obj.name,
# reverse=reverse_order)
# elif ord == 'created':
# coll = natsort.natsorted(coll, key=lambda obj: obj.created, reverse=reverse_order)
#
# context.update({
# 'last_order_by': last_order_by,
# 'reverse_order': reverse_order,
# })
# else:
# display_msg = 'Пожалуйста, введите корректные данные'
#
# if form.errors:
# messages.info(request, (
# '<p>Произошла ошибка (form)</p>'
# '<pre>{form}</pre>'
# ).format(form=pformat(form.errors)))
#
# paginator = Paginator(coll, settings.PAGE_SIZE)
# page = request.GET.get('page')
#
# try:
# coll = paginator.page(page)
# except PageNotAnInteger:
# coll = paginator.page(1)
# except EmptyPage:
# coll = paginator.page(paginator.num_pages)
#
# context.update({
# 'form': form,
# 'coll': coll,
# 'is_paginated': True,
# 'page_obj': coll,
# 'display_msg': display_msg,
# })
#
# return render(request, self.template_name, context)
# TODO: не работает сортировка по reviews(не получилось создать отзывы) и views(не нашел счетчик просмотров) # TODO: не работает сортировка по reviews(не получилось создать отзывы) и views(не нашел счетчик просмотров)
class ContractorFilterView(BaseMixin, View): class ContractorFilterView(BaseMixin, View):

Loading…
Cancel
Save