Skip to content

Commit

Permalink
Merge pull request #610 from kabalin/user-profile-cleanup
Browse files Browse the repository at this point in the history
User profile cleanup
  • Loading branch information
kabalin authored Aug 1, 2023
2 parents f29b32f + 7a10110 commit 671e2ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SALT_ROUNDS = 10;
const MAX_LOGIN_ATTEMPTS = 10;
const LOCK_TIME = ms('2m');

const sexes = ['m', 'f'];
const sexes = ['m', 'f', ''];

export let User = null;
export let UserConfirm = null;
Expand Down
2 changes: 1 addition & 1 deletion public/js/model/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define(['jquery', 'underscore', 'Utils', 'knockout', 'knockout.mapping', 'Params

// profile
birthdate: '',
sex: 'm',
sex: '',
country: '',
city: '',
work: '',
Expand Down
35 changes: 7 additions & 28 deletions views/module/user/profile.pug
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
label.col-sm-3.col-md-2.control-label(for="inBirthdate") Дата рождения
.col-sm-3.col-md-2
input#inBirthdate.form-control(type="text", data-bind="attr: {disabled: !editMode()}, value: u.birthdate, valueUpdate: 'keyup'")
.form-group
.form-group(data-bind="style: {display: canBeEdit() || u.sex().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inSex2") Пол
.col-sm-4.col-md-3
input.form-control(type="text", id="inSex2", disabled, data-bind="style: {display: (!canBeEdit() ? '' : 'none')}, value: u.sex()=='m' ? 'Male' : 'Female'")
input.form-control(type="text", id="inSex2", disabled, data-bind="style: {display: (!canBeEdit() ? '' : 'none')}, value: u.sex()=='m' ? 'Мужчина' : 'Женщина'")
div(data-bind="style: {display: canBeEdit() ? '' : 'none'}")
label.radio-inline
input(type="radio", id='inSex', name="sex", value="", data-bind="checked: u.sex, attr: {disabled: !editMode()}")
|  Не указан
label.radio-inline
input(type="radio", id='inSex', name="sex", value="m", data-bind="checked: u.sex, attr: {disabled: !editMode()}")
|  Мужчина
label.radio-inline
input(type="radio", id='inSex', name="sex", value="f", data-bind="checked: u.sex, attr: {disabled: !editMode()}")
|  Женщина
.form-group(data-bind="style: {display: canBeEdit() || u.country().length || u.city().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inResidence") Резиденция
label.col-sm-3.col-md-2.control-label(for="inResidence") Откуда
.col-sm-3.col-md-2
input.form-control(type="text", id='inResidence', data-bind="attr: {disabled: !editMode()}, size: u.country().length, value: u.country, valueUpdate: 'afterkeydown'", placeholder='Страна')
.col-sm-3.col-md-2
Expand All @@ -38,33 +41,9 @@
.col-sm-3.col-md-2
input.form-control(type="text", id='inInterested', data-bind="attr: {disabled: !editMode()}, value: u.work, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.www().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inWebsite") Website
label.col-sm-3.col-md-2.control-label(for="inWebsite") Веб-сайт
.col-sm-3.col-md-2
input.form-control(type="text", id='inWebsite', data-bind="attr: {disabled: !editMode()}, value: u.www, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.lj().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inLJ") ЖЖ
.col-sm-3.col-md-2
input.form-control(type="text", id='inLJ', data-bind="attr: {disabled: !editMode()}, value: u.lj, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.skype().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inSkype") Skype
.col-sm-3.col-md-2
input.form-control(type="text", id='inSkype', data-bind="attr: {disabled: !editMode()}, value: u.skype, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.icq().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inICQ") icq
.col-sm-3.col-md-2
input.form-control(type="text", id='inICQ', data-bind="attr: {disabled: !editMode()}, value: u.icq, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.aim().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inaim") aim
.col-sm-3.col-md-2
input.form-control(type="text", id='inaim', data-bind="attr: {disabled: !editMode()}, value: u.aim, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.flickr().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inflickr") flickr
.col-sm-3.col-md-2
input.form-control(type="text", id='inflickr', data-bind="attr: {disabled: !editMode()}, value: u.flickr, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.blogger().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inBlogger") Blogger
.col-sm-3.col-md-2
input.form-control(type="text", id='inBlogger', data-bind="attr: {disabled: !editMode()}, value: u.blogger, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.aboutme().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inaboutme") Обо мне
.col-sm-7.col-md-8
Expand Down

0 comments on commit 671e2ad

Please sign in to comment.