|
@@ -52,7 +52,7 @@
|
|
|
#end if
|
|
#end if
|
|
|
#end proc
|
|
#end proc
|
|
|
#
|
|
#
|
|
|
-#proc renderTimeline*(tweets: Tweets; profile: Profile; beginning: bool): string =
|
|
|
|
|
|
|
+#proc renderTimeline*(timeline: Timeline; profile: Profile; beginning: bool): string =
|
|
|
<div id="tweets">
|
|
<div id="tweets">
|
|
|
#if profile.protected:
|
|
#if profile.protected:
|
|
|
<div class="timeline-protected">
|
|
<div class="timeline-protected">
|
|
@@ -66,19 +66,22 @@
|
|
|
</div>
|
|
</div>
|
|
|
#end if
|
|
#end if
|
|
|
#var retweets: Tweets
|
|
#var retweets: Tweets
|
|
|
- #for tweet in tweets:
|
|
|
|
|
|
|
+ #for tweet in timeline.tweets:
|
|
|
#if tweet in retweets: continue
|
|
#if tweet in retweets: continue
|
|
|
#elif tweet.retweetBy.isSome: retweets.add tweet
|
|
#elif tweet.retweetBy.isSome: retweets.add tweet
|
|
|
#end if
|
|
#end if
|
|
|
${renderTweet(tweet, "timeline-tweet")}
|
|
${renderTweet(tweet, "timeline-tweet")}
|
|
|
#end for
|
|
#end for
|
|
|
- #if tweets.len > 0:
|
|
|
|
|
|
|
+ #if timeline.hasMore:
|
|
|
<div class="show-more">
|
|
<div class="show-more">
|
|
|
- #let retweet = tweets[^1].retweetId.get("")
|
|
|
|
|
- #let id = if retweet.len > 0: retweet else: tweets[^1].id
|
|
|
|
|
- <a href="/${profile.username}?after=${$id}">Load older tweets</a>
|
|
|
|
|
|
|
+ <a href="/${profile.username}?after=${timeline.minId}">Load older tweets</a>
|
|
|
</div>
|
|
</div>
|
|
|
#else:
|
|
#else:
|
|
|
|
|
+ <div class="timeline-protected">
|
|
|
|
|
+ <h2 class="timeline-end" style="text-align: center;">No more tweets.</h2>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ #end if
|
|
|
|
|
+ #if timeline.tweets.len == 0:
|
|
|
<div class="timeline-protected">
|
|
<div class="timeline-protected">
|
|
|
<h2 class="timeline-protected-header" style="text-align: center;">No tweets found.</h2>
|
|
<h2 class="timeline-protected-header" style="text-align: center;">No tweets found.</h2>
|
|
|
</div>
|
|
</div>
|
|
@@ -86,7 +89,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
#end proc
|
|
#end proc
|
|
|
#
|
|
#
|
|
|
-#proc renderProfile*(profile: Profile; tweets: Tweets; beginning: bool): string =
|
|
|
|
|
|
|
+#proc renderProfile*(profile: Profile; timeline: Timeline; beginning: bool): string =
|
|
|
<div class="profile-tabs">
|
|
<div class="profile-tabs">
|
|
|
<div class="profile-banner">
|
|
<div class="profile-banner">
|
|
|
${renderBanner(profile)}
|
|
${renderBanner(profile)}
|
|
@@ -95,7 +98,7 @@
|
|
|
${renderProfileCard(profile)}
|
|
${renderProfileCard(profile)}
|
|
|
</div>
|
|
</div>
|
|
|
<div class="timeline-tab">
|
|
<div class="timeline-tab">
|
|
|
- ${renderTimeline(tweets, profile, beginning)}
|
|
|
|
|
|
|
+ ${renderTimeline(timeline, profile, beginning)}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
#end proc
|
|
#end proc
|