#? stdtmpl(subsChar = '$', metaChar = '#') #import xmltree, strutils, uri, htmlgen #import ../types, ../formatters, ../utils #import ./tweet # #proc renderProfileCard*(profile: Profile): string = #let pic = profile.getUserpic().getSigUrl("pic") #let smallPic = profile.getUserpic("_200x200").getSigUrl("pic")
${linkUser(profile, "h1", class="profile-card-name", username=false)} ${linkUser(profile, "h2", class="profile-card-username")}
#if profile.bio.len > 0:

${linkifyText(xmltree.escape(profile.bio))}

#end if
#end proc # #proc renderBanner(profile: Profile): string = #if "#" in profile.banner:
#else: #let url = getSigUrl(profile.banner, "pic") #end if #end proc # #proc renderTimeline*(tweets: Tweets; profile: Profile; beginning: bool): string =
#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 #var retweets: Tweets #for tweet in tweets: #if tweet in retweets: continue #elif tweet.retweetBy.isSome: retweets.add tweet #end if ${renderTweet(tweet, "timeline-tweet")} #end for #if tweets.len > 0:
#let retweet = tweets[^1].retweetId.get("") #let id = if retweet.len > 0: retweet else: tweets[^1].id Load older tweets
#else:

No tweets found.

#end if
#end proc # #proc renderProfile*(profile: Profile; tweets: Tweets; beginning: bool): string =
${renderBanner(profile)}
${renderProfileCard(profile)}
${renderTimeline(tweets, profile, beginning)}
#end proc