{% load extra_filters_jinja %} {%- macro share(site = None, site_label = None, icon = False) -%} {% if icon == False %}{% if site_label %}{{ site_label }}{% else %}{{ site }}{% endif %}{% endif %} {%- endmacro -%} {%- macro follow_toggle(follow, name, alias, id) -%} {# follow - boolean; name - object type name; alias - e.g. users name; id - object id #}
{{ user.get_anonymous_name() }}
{% else %} {% endif %} {%- endmacro -%} {%- macro post_last_updater_and_creator_info(post, min_rep_to_edit_wiki) -%} {{ post_contributor_info(post, "original_author", post.wiki, min_rep_to_edit_wiki) }} {{ post_contributor_info(post, "last_updater", post.wiki, min_rep_to_edit_wiki) }} {%- endmacro -%} {%- macro post_contributor_info(post, contributor_type, is_wiki, wiki_min_rep) -%} {# there is a whole bunch of trickery here, probably indicative of poor design of the data or methods on data objects #} {% if contributor_type=="original_author" %}{%- if post.post_type == 'question' -%} {%- trans %}Asked{% endtrans %} {% elif post.post_type == 'answer' %} {%- trans %}Answered{% endtrans %} {% else %} {%- trans %}Posted{% endtrans %} {% endif %} {{post.added_at|diff_date}}
{% trans %}This post is a wiki. Anyone with karma >{{wiki_min_rep}} is welcome to improve it.{% endtrans %}
{% else %}{% set id = "id_" ~ name ~ "_" ~ choice[0] %}
{% endfor %} {%- endmacro -%} {%- macro question_summary(thread, question, extra_class=None, search_state=None) -%} {%include "widgets/question_summary.html" %} {%- endmacro -%} {# Warning! Any changes to the comment markup here must be duplicated in post.js for the purposes of the AJAX comment editor #} {%- macro add_or_show_comments_button(post = None, can_post = None, max_comments = None, widget_id = None) -%} {% if post.comment_count > max_comments %} {% set remaining_comments = post.comment_count - max_comments %} {% if can_post %} {% trans %}add comment{% endtrans %} / {% trans counter=remaining_comments %}see {{counter}} more{% pluralize %}see {{counter}} more{% endtrans %} {% else %} {% trans counter=remaining_comments %}see {{counter}} more comment{% pluralize %}see {{counter}} more comments {% endtrans %} {% endif %} {% elif can_post %} {% trans %}add comment{% endtrans %} {% endif %} {%- endmacro -%} {%- macro post_comments_widget( post=None, show_post = None, show_comment = None, show_comment_position = None, user=None, max_comments=None ) -%} {% spaceless %} {% set widget_id = 'comments-for-' + post.post_type + '-' + post.id|string %}