Rearchitect profile, support pins, Profile -> User
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user