Преглед изворни кода

Add description and verified to video cards

Zed пре 4 година
родитељ
комит
b8a3ffb0c4
4 измењених фајлова са 7 додато и 2 уклоњено
  1. 3 0
      src/parser.nim
  2. 1 1
      src/sass/tweet/card.scss
  3. 1 1
      src/views/general.nim
  4. 2 0
      src/views/tweet.nim

+ 3 - 0
src/parser.nim

@@ -135,6 +135,9 @@ proc parseVideo(js: JsonNode): Video =
   with title, js{"additional_media_info", "title"}:
     result.title = title.getStr
 
+  with description, js{"additional_media_info", "description"}:
+    result.description = description.getStr
+
   for v in js{"video_info", "variants"}:
     result.variants.add VideoVariant(
       videoType: parseEnum[VideoType](v{"content_type"}.getStr("summary")),

+ 1 - 1
src/sass/tweet/card.scss

@@ -37,7 +37,7 @@
     @include ellipsis;
     white-space: unset;
     font-weight: bold;
-    font-size: 1.15em;
+    font-size: 1.1em;
 }
 
 .card-description {

+ 1 - 1
src/views/general.nim

@@ -43,7 +43,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
   let opensearchUrl = getUrlPrefix(cfg) & "/opensearch"
 
   buildHtml(head):
-    link(rel="stylesheet", type="text/css", href="/css/style.css?v=6")
+    link(rel="stylesheet", type="text/css", href="/css/style.css?v=7")
     link(rel="stylesheet", type="text/css", href="/css/fontello.css?v=2")
 
     if theme.len > 0:

+ 2 - 0
src/views/tweet.nim

@@ -202,6 +202,8 @@ proc renderAttribution(profile: Profile): VNode =
   buildHtml(a(class="attribution", href=("/" & profile.username))):
     renderMiniAvatar(profile)
     strong: text profile.fullname
+    if profile.verified:
+      icon "ok", class="verified-icon", title="Verified account"
 
 proc renderMediaTags(tags: seq[Profile]): VNode =
   buildHtml(tdiv(class="media-tag-block")):