瀏覽代碼

description -> bio

Zed 7 年之前
父節點
當前提交
2c2d2c767e
共有 3 個文件被更改,包括 18 次插入18 次删除
  1. 14 14
      src/parser.nim
  2. 1 1
      src/types.nim
  3. 3 3
      src/views/user.nim

+ 14 - 14
src/parser.nim

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

+ 1 - 1
src/types.nim

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

+ 3 - 3
src/views/user.nim

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