{% from "macros/icon.html" import icon, callout with context %} {% macro feed_post(p) %}

{{ p.title }}

Posted by @{{ p.author.username }} {% if p.guild %} on {{ p.guild.handle() }} {% else %} on their user page {% endif %} -
{{ feed_upvote(p.id, p.upvotes(), p.upvoted_by(current_user.user)) }} {{ comment_count(p.comment_count()) }}
{{ p.text_content | to_markdown }}
{% endmacro %} {% macro feed_upvote(postid, count, uservote=0) %}
{% if uservote > 0 %} {{ icon('upvote', True) }} {% else %} {{ icon('upvote') }} {% endif %} {{ count }} {% if uservote < 0 %} {{ icon('downvote', True) }} {% else %} {{ icon('downvote') }} {% endif %}
{% endmacro %} {% macro single_comment(comment) %}
{% if comment.is_removed %} {% call callout('delete') %}Removed comment{% endcall %} {% else %}
{% if comment.author_id %} {{ comment.author.handle() }} {% else %} deleted account {% endif %} {% if comment.author and comment.author_id == comment.parent_post.author_id %} (OP) {% endif %} {# TODO add is_distinguished i.e. official comment #} -
{{ comment.text_content | to_markdown }}
{% endif %}
{% endmacro %} {% macro comment_count(c) %}
{{ icon('comment') }} {{ c }}
{% endmacro %} {% macro stop_scrolling(page_n = 1) %} {% set choices1 = [ 'STOP SCROLLING!', 'Scrolling is bad for your health', 'You scrolled enough for today', 'There is grass out there', 'Scrolling turns you into an extremist', 'Is your time really worth this little?', 'You learn nothing from social media' ] %} {% set choices2 = [ 'Nevermind', 'I understand the risks', 'I can\'t touch grass', 'Get me some more anyway!', 'I can\'t quit right now', 'A little more~' ] %} {% set choice1 = choices1 | random %} {% set choice2 = choices2 | random %}

{{ choice1 }}

{{ choice2 }}

{% endmacro %} {% macro no_more_scrolling(page_n = 1) %} {% set choices1 = [ 'Congratulations, you are a no lifer', 'Grass is still waiting out there', 'You could have done something more productive tho' ] %}
  • You have reached the rock bottom {%- if page_n > 10 or page_n + (range(10) | random) > 10 -%} . {{ choices1 | random }} {% endif %}

  • {% endmacro %}