{% macro formatIdentifier(identifier) %} {{identifier}} {% endmacro %} {% macro formatAuthorPermlink(author, permlink) %} {{ formatIdentifier("@" + author + "/" + permlink) }} {% endmacro %} {% macro formatOp(op) %} {% if op[0] == "transfer" %} {{op[1]["amount"]}} {{formatUser(op[1]["from"])}} {{formatUser(op[1]["to"])}}: {{op[1]["memo"]}} {% elif op[0] == "vote" %} {% if op[1]["weight"] > 0 %} {% else %} {% endif %} {{ formatUser(op[1]["voter"]) }} {{ formatAuthorPermlink(op[1]["author"], op[1]["permlink"]) }} {% elif op[0] == "transfer_to_vesting" %} {{op[1]["amount"]}} {{formatUser(op[1]["from"])}} {{formatUser(op[1]["to"])}}: {% elif op[0] == "comment" %} {{ formatAuthorPermlink(op[1]["author"], op[1]["permlink"]) }} {% elif op[0] == "interest" %} {{ op[1]["interest"] }} {% elif op[0] == "account_create" %} account created: {{ formatUser(op[1]["name"]) }} {% elif op[0] == "curate_reward" %} {{op[1]["reward"]}} {{ formatAuthorPermlink(op[1]["comment_author"], op[1]["comment_permlink"]) }} {% elif op[0] == "comment_reward" %} {{op[1]["sbd_payout"]}} {{op[1]["vesting_payout"]}} {{ formatAuthorPermlink(op[1]["author"], op[1]["permlink"]) }} {% else %} {{ op }} {% endif %} {% endmacro %} {% macro formatBody(post, type) %} {% if type == "full" or type == "reply" %} {{ post.body | parseBody | markdown }} {% else %} {{ post.body | excert | parseBody | markdown }} ... {% endif %} {% endmacro %} {% macro formatUser(user) %} {{user}} {% endmacro %} {% macro showPost(post, type) %} {% set voted = checkvotes(post) %} {% set upvoted = voted[0] %} {% set downvoted = voted[1] %}
{% if post.title %}
{% if post.depth == 0 %} {% endif %} {{ post.title }}
{% endif %} {% if type == "reply" %} {% endif %} {% if type != "title" %}
{{ formatBody(post, type) }}
{{post.total_payout_reward}} {{post.created | age}} ago by {{ formatUser(post.author) }} in {{post.category}} {{ post.active_votes | length }} {{ post.children }}
{% endif %}
{% endmacro %} {% macro recursiveComments(post) %}
{{ showPost(post, "full") }} {% if post.children %}
{% for comment in post.get_comments() %} {{ recursiveComments(comment) }} {% endfor %}
{% endif %}
{% endmacro %} {% macro show_form_errors(f) %} {% for k in f %} {% if k.errors[0] %}
{{k.errors[0]}}
{% endif %} {% endfor %} {% endmacro %} {% macro render_field_with_errors(field) %}
{{ field.label }}
{{ field(**kwargs)|safe }}
{% if field.errors %} {% endif %} {% endmacro %} {% macro render_field(field) %}

{{ field(**kwargs)|safe }}

{% endmacro %}