#? stdtmpl(subsChar = '$', metaChar = '#') #import xmltree, strutils, uri #import ../types, ../formatters, ../utils #include "tweet.nimf" # #proc renderProfileCard*(profile: Profile): string =
${genImg(profile.getUserpic("_200x200"))}
${linkUser(profile, class="profile-card-fullname")} ${linkUser(profile, class="profile-card-username")}
#if profile.bio.len > 0:

${linkifyText(profile.bio)}

#end if
#end proc # #proc renderBanner(profile: Profile): string = #if "#" in profile.banner:
#else: #let url = getSigUrl(profile.banner, "pic") ${genImg(profile.banner)} #end if #end proc # #proc renderTimeline*(timeline: Timeline; profile: Profile; beginning: bool): string = #var retweets: Tweets
#if profile.protected:

This account's Tweets are protected.

Only confirmed followers have access to @${profile.username}'s Tweets.

#end if # #if not beginning:
Load newest tweets
#end if # #for tweet in timeline.tweets: #if tweet in retweets: continue #elif tweet.retweetBy.isSome: retweets.add tweet #end if ${renderTweet(tweet, "timeline-tweet")} #end for # #if timeline.hasMore:
Load older tweets
#else:

No more tweets.

#end if # #if timeline.tweets.len == 0:

No tweets found.

#end if
#end proc # #proc renderProfile*(profile: Profile; timeline: Timeline; beginning: bool): string =
${renderBanner(profile)}
${renderProfileCard(profile)}
${renderTimeline(timeline, profile, beginning)}
#end proc # #proc renderConversation*(conversation: Conversation): string =
#if conversation.before.len > 0:
#for tweet in conversation.before: ${renderTweet(tweet)} #end for
#end if
#let afterClass = if conversation.after.len > 0: "thread" else: "" ${renderTweet(conversation.tweet, class=afterClass)}
#if conversation.after.len > 0:
#for i, tweet in conversation.after: ${renderTweet(tweet, last=(i == conversation.after.high))} #end for
#end if
#if conversation.replies.len > 0:
#for thread in conversation.replies:
#for i, tweet in thread: ${renderTweet(tweet, last=(i == thread.high))} #end for
#end for
#end if
#end proc