<commit_before>{# vim: set ts=2 et sts=2 sw=2: #}

{% macro search_box(settings, id=False, prefix=None, target=None,
                    params=None) %}
  {% if show_new_sumo(request) %}
    <form {% if id %}id="{{ id }}"{% endif %} action="{{ url('search') }}" method="get" {% if target %} target="{{ target }}"{% endif %}>
      {% if params %}
        {% for k, v in params.items() %}
          <input type="hidden" name="{{ k }}" value="{{ v }}" />
        {% endfor %}
      {% endif %}
      <input type="text" name="q" required="required" placeholder="{{ _('Search Mozilla Support') }}" />
      <button type="submit" title="{{ _('Search') }}">{{ _('Search') }}</button>
    </form>
  {% else %}
    <div class="support-search"{% if id %} id="{{ id }}"{% endif %} role="search">
      {% if prefix %}
        {{ prefix }}
      {% endif %}
      <form action="{{ url('search') }}" method="get" {% if target %} target="{{ target }}"{% endif %}>
        {% if params %}
          {% for k, v in params.items() %}
            <input type="hidden" name="{{ k }}" value="{{ v }}" />
          {% endfor %}
        {% endif %}
        <input type="text" class="text" name="q" required="required" />
        <input type="submit" class="btn-important" title="{{ _('Search') }}" value="{{ _('Search Mozilla Support') }}" />
      </form>
    </div>
  {% endif %}
{% endmacro %}

{% macro aux_nav(user) %}
  {% if not settings.READ_ONLY %}
    {% if show_new_sumo(request) %}
      {% if request.locale == settings.WIKI_DEFAULT_LANGUAGE %}
        {% set ask_url = url('questions.aaq_step1') %}
      {% else %}
        {% set ask_url = url('wiki.document', 'ask') %}
      {% endif %}
      <li><a href="{{ ask_url }}" class="ask">{{ _('Ask a question') }}</a></li>
      {% if user.is_authenticated() %}
        <li class="dropdown"><a href="{{ profile_url(user) }}" class="user">{{ user }}</a>
          <ul>
            <li><a href="{{ profile_url(user) }}">{{ _('View Profile') }}</a></li>
            <li><a href="{{ profile_url(user, edit=True) }}">{{ _('Edit Profile') }}</a></li>
            <li><a href="{{ url('dashboards.default') }}">{{ _('Dashboard') }}</a></li>
            <li><a href="{{ url('users.edit_settings') }}">{{ _('Settings') }}</a></li><commit_msg>[bug 792047] Link AAQ to community support page.<commit_after>{# vim: set ts=2 et sts=2 sw=2: #}

{% macro search_box(settings, id=False, prefix=None, target=None,
                    params=None) %}
  {% if show_new_sumo(request) %}
    <form {% if id %}id="{{ id }}"{% endif %} action="{{ url('search') }}" method="get" {% if target %} target="{{ target }}"{% endif %}>
      {% if params %}
        {% for k, v in params.items() %}
          <input type="hidden" name="{{ k }}" value="{{ v }}" />
        {% endfor %}
      {% endif %}
      <input type="text" name="q" required="required" placeholder="{{ _('Search Mozilla Support') }}" />
      <button type="submit" title="{{ _('Search') }}">{{ _('Search') }}</button>
    </form>
  {% else %}
    <div class="support-search"{% if id %} id="{{ id }}"{% endif %} role="search">
      {% if prefix %}
        {{ prefix }}
      {% endif %}
      <form action="{{ url('search') }}" method="get" {% if target %} target="{{ target }}"{% endif %}>
        {% if params %}
          {% for k, v in params.items() %}
            <input type="hidden" name="{{ k }}" value="{{ v }}" />
          {% endfor %}
        {% endif %}
        <input type="text" class="text" name="q" required="required" />
        <input type="submit" class="btn-important" title="{{ _('Search') }}" value="{{ _('Search Mozilla Support') }}" />
      </form>
    </div>
  {% endif %}
{% endmacro %}

{% macro aux_nav(user) %}
  {% if not settings.READ_ONLY %}
    {% if show_new_sumo(request) %}
      {% if request.locale == settings.WIKI_DEFAULT_LANGUAGE %}
        {% set ask_url = url('questions.aaq_step1') %}
      {% else %}
        {% set ask_url = url('wiki.document', 'get-community-support') %}
      {% endif %}
      <li><a href="{{ ask_url }}" class="ask">{{ _('Ask a question') }}</a></li>
      {% if user.is_authenticated() %}
        <li class="dropdown"><a href="{{ profile_url(user) }}" class="user">{{ user }}</a>
          <ul>
            <li><a href="{{ profile_url(user) }}">{{ _('View Profile') }}</a></li>
            <li><a href="{{ profile_url(user, edit=True) }}">{{ _('Edit Profile') }}</a></li>
            <li><a href="{{ url('dashboards.default') }}">{{ _('Dashboard') }}</a></li>
            <li><a href="{{ url('users.edit_settings') }}">{{ _('Settings') }}</a></li>
{'fraction_non_alphanumeric': 0.25244618395303325, 'fraction_numerical': 0.0030441400304414, 'mean_word_length': 2.786008230452675, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4807921', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1442, 'n_words': 354}