Improve comment templating

This commit is contained in:
Omar Roth 2018-10-05 10:08:24 -05:00
parent 3830604e42
commit 650b44ade2

View file

@ -104,19 +104,20 @@ def template_youtube_comments(comments)
html += <<-END_HTML html += <<-END_HTML
<div class="pure-g"> <div class="pure-g">
<div class="pure-u-2-24"> <div class="pure-u-4-24 pure-u-md-2-24">
<img style="width:90%; padding-right:1em; padding-top:1em;" src="#{author_thumbnail}"> <img style="width:90%; padding-right:1em; padding-top:1em;" src="#{author_thumbnail}">
</div> </div>
<div class="pure-u-22-24"> <div class="pure-u-20-24 pure-u-md-22-24">
<p> <p>
<a href="javascript:void(0)" onclick="toggle(this)">[ - ]</a>
<i class="icon ion-ios-thumbs-up"></i> #{child["likeCount"]}
<b><a href="#{child["authorUrl"]}">#{child["author"]}</a></b> <b><a href="#{child["authorUrl"]}">#{child["author"]}</a></b>
- #{recode_date(Time.epoch(child["published"].as_i64))} ago <a href="javascript:void(0)" onclick="toggle(this)">[ - ]</a>
</p> <div>
<div> <p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p> #{recode_date(Time.epoch(child["published"].as_i64))} ago
#{replies_html} |
<i class="icon ion-ios-thumbs-up"></i> #{child["likeCount"]}
</p>
#{replies_html}
</div> </div>
</div> </div>
</div> </div>
@ -157,9 +158,9 @@ def template_reddit_comments(root)
content = <<-END_HTML content = <<-END_HTML
<p> <p>
<a href="javascript:void(0)" onclick="toggle(this)">[ - ]</a> <a href="javascript:void(0)" onclick="toggle(this)">[ - ]</a>
<i class="icon ion-ios-thumbs-up"></i> #{score}
<b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b> <b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b>
- #{recode_date(child.created_utc)} ago #{score} points
#{recode_date(child.created_utc)} ago
</p> </p>
<div> <div>
#{body_html} #{body_html}