Add "about" field to person table, display in person page

This commit is contained in:
fr33domlover 2019-01-26 23:39:13 +00:00
parent e9ac361f27
commit 577df6ddcf
4 changed files with 18 additions and 2 deletions

View file

@ -33,6 +33,7 @@ Person
verifiedKeyCreated UTCTime
resetPassKey Text
resetPassKeyCreated UTCTime
about Text
UniquePersonIdent ident
UniquePersonLogin login

View file

@ -487,7 +487,18 @@ instance AccountDB AccountPersistDB' where
return $ Left $ mr $ MsgUsernameExists name
Right sid -> do
let defTime = UTCTime (ModifiedJulianDay 0) 0
person = Person sid name pwd email False key now "" defTime
person = Person
{ personIdent = sid
, personLogin = name
, personPassphraseHash = pwd
, personEmail = email
, personVerified = False
, personVerifiedKey = key
, personVerifiedKeyCreated = now
, personResetPassKey = ""
, personResetPassKeyCreated = defTime
, personAbout = ""
}
pid <- insert person
return $ Right $ Entity pid person

View file

@ -132,6 +132,8 @@ changes =
, renameField "ProjectCollabAnon" "repo" "project"
-- 24
, renameField "ProjectCollabUser" "repo" "project"
-- 25
, addFieldPrimRequired "Person" ("" :: Text) "about"
]
migrateDB :: MonadIO m => ReaderT SqlBackend m (Either Text (Int, Int))

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis.
$#
$# Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
$# Written in 2016, 2018, 2019 by fr33domlover <fr33domlover@riseup.net>.
$#
$# ♡ Copying is an act of love. Please copy, reuse and share.
$#
@ -14,6 +14,8 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
^{avatarW secure $ emailText $ personEmail person}
<p>#{personAbout person}
<ul>
<li>
<a href=@{ProjectsR shr}>Projects