{% from 'vote.html' import vote %} {% extends 'layout.html' %} {# Set variables for base layour #} {% set active_page = '' %} {% set title = post.title %} {% block content %}
{% if post.link and post.link|length > 0 %} {{ post.title }} {% else %} {{ post.title }} {% endif %}
{% if post.link %}
{{ post.link|netloc }}
{% endif %}
{% for topic in topics %} {{ topic.name }} {% endfor %}
{{ vote ('post', post, user) }} {{ post.username }} — {{ post.vote }} votes, {{ post.commentsCount }} comments — {% if not show_source %} Source {% endif%} {% if user and post.userId == user.id %} Edit {% endif %}
{% if show_source %}
{{ post.text }}
{% else %} {{ post.text|md2html|safe }} {% endif %}
{# "shortcut-submit" is a class used exclusively from javascript # to submit the form when a key (Ctrl+Enter) is pressed. #}
{# id="" used as anchor #}
{% for comment in comments %} {# The id="" is used as anchor #}
{{ vote ('comment', comment, user) }} {# Username #} {{ comment.username }} {# DateTime #} {% if user %} — {# Reply #} Reply {# Edit #} {% if comment.userId == user.id %} Edit {% endif %} {% endif %}
{% if show_source %}
{{ comment.text }}
{% else %} {{ comment.text|md2html|safe }} {% endif %}
{% endfor %}
{% endblock %}