{% 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 inbox_message_snippet(message) -%}
{%- endmacro -%} {%- macro moderation_queue_message(message) -%} {%- endmacro -%} {%- macro post_vote_buttons(post = None) -%}{{ revision.author.get_anonymous_name() }}
{% else %} {{ user_card(revision.author) }} {% endif %} {% if settings.GROUPS_ENABLED %} {{ user_primary_group(revision.author) }} {% endif %} {%- endmacro -%} {%- macro post_last_updater_and_creator_info(post) -%} {% if post.wiki %}{%- if post.post_type == 'question' -%} {{ settings.WORDS_ASKED|escape }} {% elif post.post_type == 'answer' %} {{ settings.WORDS_ANSWERED|escape }} {% else %} {%- trans %}posted{% endtrans %} {% endif %} {{ timeago(post.added_at) }}
{% trans %}This post is a wiki. Anyone with karma >{{wiki_min_rep}} is welcome to improve it.{% endtrans %}
{% set id = "id_" ~ name ~ "_" ~ choice[0] %}
{% endfor %} {%- endmacro -%} {%- macro question_summary(thread, question, extra_class=None, search_state=None, visitor = 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, max_comments = None, widget_id = None) -%} {% if post.comment_count > max_comments %} {% set remaining_comment_count = post.comment_count - max_comments %} {% else %} {% set remaining_comment_count = 0 %} {% endif %} {%- endmacro -%} {%- macro csrf_middleware_token(csrf_token) -%} {%- endmacro -%} {%- macro post_comments_widget( post=None, show_post = None, show_comment = None, show_comment_position = None, user=None, max_comments=None, csrf_token=None ) -%} {% spaceless %} {% if show_post == post and show_comment and show_comment_position > max_comments %} {% set comments = post.get_cached_comments()[:show_comment_position] %} {% else %} {% set comments = post.get_cached_comments()[:max_comments] %} {% endif %} {% set comments_count = comments|length %} {% if comments_count > 0 %} {% endif %} {% set widget_id = 'comments-for-' + post.post_type + '-' + post.id|string %} {{label}} ▲ {% elif current_sort_method == key_name + "-desc" %}{# "best first" #} {{label}} ▼ {% else %}{# default, when other button is active #} {{label}} {% endif %} {%- endmacro %} {%- macro checkbox_in_div(checkbox_field, class = 'checkbox') -%}
{%- endmacro -%}
{%- macro user_country_flag(user) -%}
{% if user.country and user.show_country %}
{% endif %}
{%- endmacro -%}
{%- macro user_country_name_and_flag(user) -%}
{% if user.country and user.show_country %}
{{ user.country.name }}
{{ user_country_flag(user) }}
{% endif %}
{%- endmacro -%}
{%- macro user_full_location(user) -%}
{% if user.location %}
{{ user.location|escape }},
{% endif %}
{{ user_country_name_and_flag(user) }}
{%- endmacro -%}
{% macro user_card(user) %}
{% include "widgets/user_card.html" %}
{% endmacro %}
{%- macro user_list(users) -%}
{% include "widgets/user_list.html" %}
{%- endmacro -%}
{#todo: rename this to avatar #}
{%- macro gravatar(user, size) -%}
{% spaceless %}
0 %}
alt="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}"
title="{% trans new=moderation_items['new_count'], seen=moderation_items['seen_count']%}{{new}} new flagged posts and {{seen}} previous{% endtrans %}"
{% else %}
alt="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}"
title="{% trans new=moderation_items['new_count'] %}{{new}} new flagged posts{% endtrans %}"
{% endif %}
/>
{% elif moderation_items['seen_count'] > 0 %}
{% endif %}
{% endif %}
{%- endmacro -%}
{%- macro timeago(datetime_object) -%}
{{datetime_object.replace(microsecond=0)|add_tz_offset}}
{%- endmacro -%}
{% macro one_shot_form_js(form=None, submit_button=None) %}
{% endmacro %}
{% macro form_field_with_errors(field) %}
{% if field.errors %}
{{ field.errors|join(", ") }}
{% endif %} {{ field }} {% endmacro %}
{% trans %}This post is awaiting moderation{% endtrans %}
{% endif %}{% trans %}edit{% endtrans %}