Rearchitect profile, support pins, Profile -> User

This commit is contained in:
Zed
2022-01-23 07:04:50 +01:00
parent 79b98a8081
commit 51ae076ea0
23 changed files with 374 additions and 285 deletions

View File

@@ -15,18 +15,18 @@ proc icon*(icon: string; text=""; title=""; class=""; href=""): VNode =
if text.len > 0:
text " " & text
proc linkUser*(profile: Profile, class=""): VNode =
proc linkUser*(user: User, class=""): VNode =
let
isName = "username" notin class
href = "/" & profile.username
nameText = if isName: profile.fullname
else: "@" & profile.username
href = "/" & user.username
nameText = if isName: user.fullname
else: "@" & user.username
buildHtml(a(href=href, class=class, title=nameText)):
text nameText
if isName and profile.verified:
if isName and user.verified:
icon "ok", class="verified-icon", title="Verified account"
if isName and profile.protected:
if isName and user.protected:
text " "
icon "lock", title="Protected account"