{% macro search_box(settings, id=False, prefix=None, target=None, placeholder=_('Search questions, articles, or topics (example: saving passwords in Firefox)'), params=None) %}
{% if params %} {% for k, v in params.items() %} {% endfor %} {% endif %}
{% endmacro %} {% macro sumo_banner(id, text, modifier_class=None, image=None, button_text=None, button_link=None) %}
{% if image %} {% endif %}

{{ text }}

{% if button_text %} {{ button_text }} {% endif %}
{% endmacro %} {% macro scam_banner() %}
{% include 'includes/icons/alert-icon.svg'%}

{{ _('Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.') }}

{{ _('Learn More') }}
{% endmacro %} {% macro browse_by_topic(product=True) %} {% set row_one_left_slug="settings" %} {% set row_one_right_slug="installation-and-updates" %} {% set row_two_left_slug="email-and-messaging" %} {% set row_two_right_slug="performance-and-connectivity" %} {% set row_three_left_slug="privacy-and-security" %} {% set row_three_right_slug="browse" %} {% if product %} {% set link_name = "main-menu.topic-home" %} {% set row_one_left_url = url('products.topic_documents', topic_slug=row_one_left_slug ) %} {% set row_one_right_url = url('products.topic_documents', topic_slug=row_one_right_slug ) %} {% set row_two_left_url = url('products.topic_documents', topic_slug=row_two_left_slug ) %} {% set row_two_right_url = url('products.topic_documents', topic_slug=row_two_right_slug ) %} {% set row_three_left_url = url('products.topic_documents', topic_slug=row_three_left_slug ) %} {% set row_three_right_url = url('products.topic_documents', topic_slug=row_three_right_slug ) %} {% else %} {% set link_name = "main-menu.support-forum-home" %} {% set row_one_left_url = url('questions.list_by_topic', topic_slug=row_one_left_slug ) %} {% set row_one_right_url = url('questions.list_by_topic', topic_slug=row_one_right_slug ) %} {% set row_two_left_url = url('questions.list_by_topic', topic_slug=row_two_left_slug ) %} {% set row_two_right_url = url('questions.list_by_topic', topic_slug=row_two_right_slug ) %} {% set row_three_left_url = url('questions.list_by_topic', topic_slug=row_three_left_slug ) %} {% set row_three_right_url = url('questions.list_by_topic', topic_slug=row_three_right_slug ) %} {% endif %} {% endmacro %} {% macro aux_nav(user, hide_aaq_link=False) %}
  • {{ _('Explore Help Articles') }}
  • {{ _('Community Forums') }}

    {{ _('Browse all forum threads by topic') }}

    {{ browse_by_topic(product=False) }}
  • {{ _('Ask a Question') }}
  • {% if not user.is_authenticated or not is_contributor(user) %}
  • {{ _('Contribute') }}
  • {% else %}
  • {{ _('Contribute') }}

    {{ _('Contributor discussions') }}

      {{ _discussion_nav_links(user, default_language, active) }}

    {{ _('Contributor tools') }}

      {{ _tools_nav_links(user, default_language, active, context="main-menu") }}
  • {% endif %} {% endmacro %} {% macro profile_nav(user, hide_aaq_link=False) %} {% if not hide_header_search %}
  • {{ search_box(settings, id='support-search', params=search_params) }} {% if show_header_fx_download() %} {# show-fx-download.js will remove the 'hidden' class below if the visitor is *NOT* using Firefox #} {% endif %}
  • {% endif %}
  • {% if user.is_authenticated %} {{ display_name(user) }}
    Avatar for Username {% if unread_message_count > 0 %}
    {% endif %}
    {% elif not request.path == url('users.auth') %} {{ _('Sign In/Up') }} {% endif %}
  • {% endmacro %} {% macro content_editor(field) %}
    {{ field|safe }}
    {{ field.errors }}
    {% endmacro %} {% macro list_view_item(url, label, class=None, icon_url=None) %}
  • {% if icon_url %} {% endif %} {{ label }}
  • {% endmacro %} {% macro for_contributors_sidebar(user, default_language, active=None, menu="contributor-discussions", locale=None, is_collapsible=False) -%} {% if user.is_authenticated %} {% endif %} {%- endmacro %} {% macro _discussion_nav_links(user, default_language, active=None, context="main-menu") -%}
  • {{ _('SUMO community discussions') }}
  • {{ _('Support forum discussions') }}
  • {{ _('Article discussions') }}
  • {{ _('Localization discussions') }}
  • {% if context == "main-menu" %}
  • {{ _('View all discussions') }}
  • {% endif %} {% if context == "sidebar-menu" %}
  • {{ _('Knowledge base discussions') }}
  • {% if user.has_perm('flagit.can_moderate') %}
  • {{ _('Forum moderator discussions') }}
  • {% endif %}
  • {{ _('Off topic discussions') }}
  • {{ _('Lost thread discussions') }}
  • {% endif %} {% endmacro %} {% macro _tools_nav_links(user, default_language, active=None, context="main-menu", locale=None, is_collapsible=False) -%} {% if user.has_perm('flagit.can_moderate') %}
  • {{ _('Moderate forum content') }}
  • {% endif %}
  • {{ _('Knowledge base dashboards') }}
  • {{ _('Guides') }}
  • {% if context == "sidebar-menu" %}
  • {{ _('Templates') }}
  • {% endif %}
  • {{ _('Media gallery') }}
  • {{ _('Recent revisions') }}
  • {{ _('Community hub') }}
  • {% if context == "sidebar-menu" %}
  • {{ _('Locales') }}
  • {{ _('Locale metrics') }}
  • {{ _('Aggregated metrics') }}
  • {% endif %} {% if is_collapsible %} {{ _('Show More') }} {% endif %} {% endmacro %} {# This is designed to be used like this: {% call announcement_bar('foo', 'info') %} This is the contents of the bar. {% endcall %} #} {% macro announcement_bar(id, level, close_memory="", close_type="") -%} {% set content = caller() %} {% if content %}

    {{ content }}

    {% endif %} {% endmacro %} {% macro favicon() %} {% endmacro %} {% macro download_firefox() %} {# show-fx-download.js will remove the 'hidden' class below if the visitor is *NOT* using Firefox #} {% endmacro %} {% macro field(field=None, extra_classes=None) %}
    {{ field }} {# Entire input field is generated by Django #} {% if field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %} {% if field.help_text %}

    {{ field.help_text|safe }}

    {% endif %}
    {% endmacro %} {% macro checkbox(field=None, extra_classes=None) %}
    {{ field }} {# Entire input field is generated by Django #} {% if field.errors %} {% for error in field.errors %} {{ error }} {% endfor %} {% endif %} {% if field.help_text %}

    {{ field.help_text|safe }}

    {% endif %}
    {% endmacro %} {% macro featured_articles(articles, new_tab=False) %}
    {% for doc in articles %}
    {{ doc.title }}

    {{ doc.title }}

    {{ doc.current_revision.summary }}

    {% endfor %}
    {% endmacro %}