Skip to content

Commit

Permalink
Merge pull request #612 from kabalin/profile-followups
Browse files Browse the repository at this point in the history
Profile changes followups
  • Loading branch information
kabalin authored Aug 2, 2023
2 parents 5f9faf4 + c826a16 commit e27d6bc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
18 changes: 18 additions & 0 deletions migrations/20230802115942-fix-gender.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright: The PastVu contributors.
* GNU Affero General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/agpl.txt)
*/

/**
* Fix missing 'sex' user object property to users whose gender was matching
* default one (it was not set in database, issue #611).
*/
module.exports = {
async up(db/*, client*/) {
await db.collection('users').updateMany({ 'sex': { $exists: false } }, { $set: { 'sex': 'm' } });
},

async down(/*db, client*/) {
// Not required.
},
};
10 changes: 5 additions & 5 deletions views/module/user/profile.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
.form-group(data-bind="style: {display: canBeEdit() || u.firstName().length || u.lastName().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inName") Реальное имя
.col-sm-3.col-md-2
input.form-control(type="text", id="inName", data-bind="attr: {size: u.firstName().length, disabled: !editMode()}, value: u.firstName, valueUpdate: 'afterkeydown'", placeholder='Имя')
input.form-control(type="text", id="inName", data-bind="attr: {size: u.firstName().length, disabled: !editMode(), placeholder: !editMode() ? '' : 'Имя'}, value: u.firstName, valueUpdate: 'afterkeydown'")
.col-sm-3.col-md-2
input.form-control(type="text", id="inLastName", data-bind="attr: {disabled: !editMode()}, value: u.lastName, valueUpdate: 'afterkeydown'", placeholder='Фамилия')
.form-group
input.form-control(type="text", id="inLastName", data-bind="attr: {disabled: !editMode(), placeholder: !editMode() ? '': 'Фамилия'}, value: u.lastName, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.birthdate().length ? '' : 'none'}")
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'")
Expand All @@ -33,9 +33,9 @@
.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") Откуда
.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='Страна')
input.form-control(type="text", id='inResidence', data-bind="attr: {disabled: !editMode(), placeholder: !editMode() ? '': 'Страна'}, size: u.country().length, value: u.country, valueUpdate: 'afterkeydown'")
.col-sm-3.col-md-2
input.form-control(type="text", id="inResidence2", data-bind="attr: {disabled: !editMode()}, value: u.city, valueUpdate: 'afterkeydown'", placeholder='Город')
input.form-control(type="text", id="inResidence2", data-bind="attr: {disabled: !editMode(), placeholder: !editMode() ? '': 'Город'}, value: u.city, valueUpdate: 'afterkeydown'")
.form-group(data-bind="style: {display: canBeEdit() || u.work().length > 0 ? '' : 'none'}")
label.col-sm-3.col-md-2.control-label(for="inInterested") Деятельность
.col-sm-3.col-md-2
Expand Down

0 comments on commit e27d6bc

Please sign in to comment.