Add bio to user.

This commit is contained in:
Yang Luo 2021-08-25 08:07:08 +08:00
parent edf621f4d5
commit c6b2106c94
2 changed files with 12 additions and 1 deletions

View File

@ -40,6 +40,7 @@ type User struct {
Affiliation string `xorm:"varchar(100)" json:"affiliation"`
Title string `xorm:"varchar(100)" json:"title"`
Homepage string `xorm:"varchar(100)" json:"homepage"`
Bio string `xorm:"varchar(100)" json:"bio"`
Tag string `xorm:"varchar(100)" json:"tag"`
Region string `xorm:"varchar(100)" json:"region"`
Language string `xorm:"varchar(100)" json:"language"`
@ -159,7 +160,7 @@ func UpdateUser(id string, user *User) bool {
}
affected, err := adapter.Engine.ID(core.PK{owner, name}).Cols("owner", "display_name", "avatar",
"location", "address", "region", "language", "affiliation", "title", "homepage", "score", "tag", "is_admin", "is_global_admin", "is_forbidden",
"location", "address", "region", "language", "affiliation", "title", "homepage", "bio", "score", "tag", "is_admin", "is_global_admin", "is_forbidden",
"hash", "properties").Update(user)
if err != nil {
panic(err)

View File

@ -271,6 +271,16 @@ class UserEditPage extends React.Component {
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("user:Bio"), i18next.t("user:Bio - Tooltip"))} :
</Col>
<Col span={22} >
<Input value={this.state.user.bio} onChange={e => {
this.updateUserField('bio', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("user:Tag"), i18next.t("user:Tag - Tooltip"))} :