description -> bio

This commit is contained in:
Zed 2019-06-24 02:09:32 +02:00
parent 2e303719f2
commit 2c2d2c767e
3 changed files with 18 additions and 18 deletions

View file

@ -8,25 +8,25 @@ proc parsePopupProfile*(node: XmlNode): Profile =
if profile.isNil: return if profile.isNil: return
result = Profile( result = Profile(
fullname: profile.getName(".fullname"), fullname: profile.getName(".fullname"),
username: profile.getUsername(".username"), username: profile.getUsername(".username"),
description: profile.getBio(".bio"), bio: profile.getBio(".bio"),
userpic: profile.getAvatar(".ProfileCard-avatarImage"), userpic: profile.getAvatar(".ProfileCard-avatarImage"),
verified: isVerified(profile), verified: isVerified(profile),
protected: isProtected(profile), protected: isProtected(profile),
banner: getBanner(profile) banner: getBanner(profile)
) )
result.getPopupStats(profile) result.getPopupStats(profile)
proc parseIntentProfile*(profile: XmlNode): Profile = proc parseIntentProfile*(profile: XmlNode): Profile =
result = Profile( result = Profile(
fullname: profile.getName("a.fn.url.alternate-context"), fullname: profile.getName("a.fn.url.alternate-context"),
username: profile.getUsername(".nickname"), username: profile.getUsername(".nickname"),
description: profile.getBio("p.note"), bio: profile.getBio("p.note"),
userpic: profile.querySelector(".profile.summary").getAvatar("img.photo"), userpic: profile.querySelector(".profile.summary").getAvatar("img.photo"),
verified: not profile.querySelector("li.verified").isNil, verified: not profile.querySelector("li.verified").isNil,
protected: not profile.querySelector("li.protected").isNil, protected: not profile.querySelector("li.protected").isNil,
banner: getBanner(profile) banner: getBanner(profile)
) )
result.getIntentStats(profile) result.getIntentStats(profile)

View file

@ -8,7 +8,7 @@ db("cache.db", "", "", ""):
Profile* = object Profile* = object
username*: string username*: string
fullname*: string fullname*: string
description*: string bio*: string
userpic*: string userpic*: string
banner*: string banner*: string
following*: string following*: string

View file

@ -18,9 +18,9 @@
</div> </div>
<div class="profile-card-extra"> <div class="profile-card-extra">
<div class="profile-bio"> <div class="profile-bio">
#if profile.description.len > 0: #if profile.bio.len > 0:
<div class="profile-description"> <div class="profile-bio">
<p>${linkifyText(xmltree.escape(profile.description))}</p> <p>${linkifyText(xmltree.escape(profile.bio))}</p>
</div> </div>
#end if #end if
</div> </div>