mirror of
https://github.com/zedeus/nitter.git
synced 2026-04-15 02:02:11 -04:00
Make "Tweet unavailable" clickable and consistent
This commit is contained in:
@@ -53,7 +53,7 @@ proc renderThread(thread: Tweets; prefs: Prefs; path: string): VNode =
|
||||
let show = i == thread.high and sortedThread[0].id != tweet.threadId
|
||||
let header = if tweet.pinned or tweet.retweet.isSome: "with-header " else: ""
|
||||
renderTweet(tweet, prefs, path, class=(header & "thread"),
|
||||
index=i, last=(i == thread.high), showThread=show)
|
||||
index=i, last=(i == thread.high))
|
||||
|
||||
proc renderUser(user: User; prefs: Prefs): VNode =
|
||||
buildHtml(tdiv(class="timeline-item", data-username=user.username)):
|
||||
@@ -96,7 +96,7 @@ proc renderTimelineTweets*(results: Timeline; prefs: Prefs; path: string;
|
||||
|
||||
if not prefs.hidePins and pinned.isSome:
|
||||
let tweet = get pinned
|
||||
renderTweet(tweet, prefs, path, showThread=tweet.hasThread)
|
||||
renderTweet(tweet, prefs, path)
|
||||
|
||||
if results.content.len == 0:
|
||||
if not results.beginning:
|
||||
@@ -116,11 +116,9 @@ proc renderTimelineTweets*(results: Timeline; prefs: Prefs; path: string;
|
||||
tweet.pinned and prefs.hidePins:
|
||||
continue
|
||||
|
||||
var hasThread = tweet.hasThread
|
||||
if retweetId != 0 and tweet.retweet.isSome:
|
||||
retweets &= retweetId
|
||||
hasThread = get(tweet.retweet).hasThread
|
||||
renderTweet(tweet, prefs, path, showThread=hasThread)
|
||||
renderTweet(tweet, prefs, path)
|
||||
else:
|
||||
renderThread(thread, prefs, path)
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ proc renderQuoteMedia(quote: Tweet; prefs: Prefs; path: string): VNode =
|
||||
proc renderQuote(quote: Tweet; prefs: Prefs; path: string): VNode =
|
||||
if not quote.available:
|
||||
return buildHtml(tdiv(class="quote unavailable")):
|
||||
tdiv(class="unavailable-quote"):
|
||||
a(class="unavailable-quote", href=getLink(quote, focus=false)):
|
||||
if quote.tombstone.len > 0:
|
||||
text quote.tombstone
|
||||
elif quote.text.len > 0:
|
||||
@@ -271,14 +271,14 @@ proc renderLocation*(tweet: Tweet): string =
|
||||
return $node
|
||||
|
||||
proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
||||
last=false; showThread=false; mainTweet=false; afterTweet=false): VNode =
|
||||
last=false; mainTweet=false; afterTweet=false): VNode =
|
||||
var divClass = class
|
||||
if index == -1 or last:
|
||||
divClass = "thread-last " & class
|
||||
|
||||
if not tweet.available:
|
||||
return buildHtml(tdiv(class=divClass & "unavailable timeline-item", data-username=tweet.user.username)):
|
||||
tdiv(class="unavailable-box"):
|
||||
a(class="unavailable-box", href=getLink(tweet)):
|
||||
if tweet.tombstone.len > 0:
|
||||
text tweet.tombstone
|
||||
elif tweet.text.len > 0:
|
||||
@@ -345,10 +345,6 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
||||
if not prefs.hideTweetStats:
|
||||
renderStats(tweet.stats)
|
||||
|
||||
if showThread:
|
||||
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
||||
text "Show this thread"
|
||||
|
||||
proc renderTweetEmbed*(tweet: Tweet; path: string; prefs: Prefs; cfg: Config; req: Request): string =
|
||||
let node = buildHtml(html(lang="en")):
|
||||
renderHead(prefs, cfg, req)
|
||||
|
||||
Reference in New Issue
Block a user