From 33e98baaaf5eed01e9b7cac604d5ff5a44feae4d Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 1 Aug 2023 20:34:15 +0100 Subject: [PATCH 1/3] Change ru ranslation for "residence" and "website" --- views/module/user/profile.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/module/user/profile.pug b/views/module/user/profile.pug index 297746d7..6ee973bb 100644 --- a/views/module/user/profile.pug +++ b/views/module/user/profile.pug @@ -28,7 +28,7 @@ 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 @@ -38,7 +38,7 @@ .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'}") From 810164c0db2be22589c44efb9a08cc0e0d9261b1 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 1 Aug 2023 21:33:36 +0100 Subject: [PATCH 2/3] Add "not specified" default gender value to user profile. --- models/User.js | 2 +- public/js/model/User.js | 2 +- views/module/user/profile.pug | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/models/User.js b/models/User.js index 913e5b88..33b6fcc1 100755 --- a/models/User.js +++ b/models/User.js @@ -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; diff --git a/public/js/model/User.js b/public/js/model/User.js index 8020a48a..e2fbd4a9 100644 --- a/public/js/model/User.js +++ b/public/js/model/User.js @@ -43,7 +43,7 @@ define(['jquery', 'underscore', 'Utils', 'knockout', 'knockout.mapping', 'Params // profile birthdate: '', - sex: 'm', + sex: '', country: '', city: '', work: '', diff --git a/views/module/user/profile.pug b/views/module/user/profile.pug index 6ee973bb..09eb7482 100644 --- a/views/module/user/profile.pug +++ b/views/module/user/profile.pug @@ -16,11 +16,14 @@ 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()}") |  Мужчина From 7a101100a0abb6b24593deb5e38a47e03b33f74e Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 1 Aug 2023 21:46:20 +0100 Subject: [PATCH 3/3] Clean up profile fields from the template. This will need follow up change to remove fields from model and relevant methods. --- views/module/user/profile.pug | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/views/module/user/profile.pug b/views/module/user/profile.pug index 09eb7482..950f2e56 100644 --- a/views/module/user/profile.pug +++ b/views/module/user/profile.pug @@ -44,30 +44,6 @@ 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