From 787e89c24d722a5984671a26198a8ec311190556 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 22 Oct 2020 21:38:35 +0000 Subject: [PATCH] twitterchiver/viewer: support quoted tweets --- go/twitterchiver/viewer/templates/tweets.html | 44 +++++++-- go/twitterchiver/viewer/viewer.go | 94 +++++++++++++------ 2 files changed, 105 insertions(+), 33 deletions(-) diff --git a/go/twitterchiver/viewer/templates/tweets.html b/go/twitterchiver/viewer/templates/tweets.html index 13bce68900..cf47d92ce0 100644 --- a/go/twitterchiver/viewer/templates/tweets.html +++ b/go/twitterchiver/viewer/templates/tweets.html @@ -14,12 +14,12 @@ html, body { display: block; padding-top: 8px; padding-bottom: 8px; - border-bottom: 1px solid rgb(136, 153, 166); + border-bottom: 1px solid rgb(56, 68, 77); width: clamp(calc(45ch+64px), 100%, calc(75ch+64px)); } .tweet-list-item:first-of-type { margin-top: 8px; - border-top: 1px solid rgb(136, 153, 166); + border-top: 1px solid rgb(56, 68, 77); } .tweet { margin-left: 64px; @@ -53,10 +53,10 @@ a:hover { .byline-link:hover .byline-name { text-decoration: underline; } -.byline-name { +.byline-name, .quoted-byline-name { color: white; } -.byline, .retweeted-byline, .retweeted-icon { +.byline, .retweeted-byline, .retweeted-icon, .quoted-byline { color: rgb(136, 153, 166); } .retweeted-byline { @@ -95,6 +95,24 @@ a:hover { .media-video { width: 100%; } + +.quoted-tweet { + border-radius: 15px; + border-color: rgb(56, 68, 77); + border-width: 1px; + border-style: solid; + margin-top: 10px; + padding: 8px; +} +.quoted-byline { + margin-bottom: 6px; +} +.quoted-tweet-author-img { + border-radius: 100%; + height: 20px; + vertical-align: bottom; + margin-right: 2px; +}

Twitterchiver: {{.TwitterUsername}}

{{if .Query}} @@ -127,9 +145,23 @@ a:hover {
{{call $.FormatTweetText $status.full_text $status}}
- {{if .Object.extended_entities}} + {{if .QuotedObject}} +
+ +
{{if .QuotedObject.full_text}}{{.QuotedObject.full_text}}{{else}}{{.QuotedObject.text}}{{end}}
+
+ {{end}} + {{if $status.extended_entities}}
- {{range $entity := .Object.extended_entities.media}} + {{range $entity := $status.extended_entities.media}}
{{if eq $entity.type "video"}}