<commit_before>{% extends "base.html" %}

{% block page_title %}{{ profile.display_name }}{% endblock %}
{% block body_id %}profile{% endblock %}
{% block body_class %}
  {{ super() }}
  {% if not profile.is_vouched %}pending{% endif %}
{% endblock %}

{% block messages %}{% endblock %}

{% block content %}
  {% if messages %}
      {% for message in messages %}
        {% with %}
          {% set label = message.tags in ['error', 'success', 'info'] %}
          <div class="alert{% if label %} alert-{{ message.tags }}{% endif %}">{{ message }}</div>
        {% endwith %}
      {% endfor %}
  {% endif %}
  <div class="alert">
    {% if user.username == shown_user.username %}
      {{ _('Your Profile') }}
    {% elif profile.is_vouched %}
      {{ _('Mozillian Profile') }}
    {% else %}
      {{ _('Pending Profile') }}
    {% endif %}
  </div>
  {% if not profile.is_vouched %}
    <div id="pending-approval">
      {% if user == shown_user %}
        {% trans profile_url=absolutify(url('profile', user.username)),
                 contribute_url='http://www.mozilla.org/contribute' %}
          <p>
            Your profile is waiting to be vouched. Send the link below to someone who
            is familiar with your contributions and ask them to vouch for you:
            <em class="underline" title="Your profile URL">{{ profile_url }}</em>
          </p>
          <p>
            If you are new to the Mozilla community,
            <a class="button" href="{{ contribute_url }}">get involved</a>
          </p>
          <p>
            The chances of being vouched increase as you finish tasks in our community.
          </p>

        {% endtrans %}
      {% else %}
        {% if vouch_form %}
          <form action="{{ url('vouch') }}" method="POST"
                id="vouch-form">
            {{ csrf() }}
            {{ vouch_form }}
            {% trans name=profile.display_name %}
                <button type="submit">
                  Vouch for {{ name }}
                </button>
            {% endtrans %}
          </form>
        {% endif %}
        {% trans %}
          <p>This profile is waiting for approval.</p>
          <p>Because our community directory is for Mozillians who
            are 13 and older, please don't vouch for anyone under
            13.</p>
        {% endtrans %}
      {% endif %}
    </div>
  {% endif %}

  {% if privacy_mode == 'anonymous' and not profile.is_public %}
    <div id="anonymous">
      {% trans edit_url=url('profile.edit') %}
        Your profile is not public. If you <a href="{{ edit_url }}">edit
        your profile</a> to have at least one public field,
        your public profile will be viewable.
      {% endtrans %}
    </div>
  {% endif %}

  <article id="profile-stats">
    <div class="profile-photo">
      <img src="{{ shown_user.userprofile.get_photo_url('150x150') }}" alt="{{ shown_user.username }}">
    </div>
    <div class="stats">
      {% set mozillian_years = get_mozillian_years(profile) %}
      {% if not mozillian_years is none %}
        <section id="membership">
            <div class="status">
              <i class="icon-calendar"></i>
              {% if mozillian_years > 0 %}
                {% trans %}
                  Mozillian for {{ mozillian_years }} years
                {% endtrans %}
              {% else %}
                  Mozillian for less than a year
              {% endif %}
              <span>{{ shown_user.userprofile.date_mozillian.strftime('%b %Y') }}</span>
            </div>
        </section>
      {% endif %}
      {% if profile.country or profile.region or profile.city %}
        <section id="location">
          <i class="icon-globe"></i> {% include 'phonebook/includes/profile_location.html' %}
        </section>
      {% endif %}
      {% if profile.timezone %}
        <section id="timezone">
          <i class="icon-time"></i> {{ profile.timezone }}
        </section>
      {% endif %}
     </div>
  </article>

  <article id="profile-info">
    <header>
      {% if user == shown_user %}
        <div class="privacy-view">
          <form method="GET" action=".">
            <label>{{ _('View as:') }}</label>
            <select id="view-privacy-mode">
                <option value="{{ url('profile', shown_user.username) }}"
                        {% if privacy_mode == 'myself' %} selected {% endif %}>
                  {{ _('Myself') }}
                </option>
                <option value="{{ url('profile', shown_user.username)|urlparams(view_as='mozillian') }}"
                        {% if privacy_mode == 'mozillian' %} selected {% endif %} >
                  {{ _('Mozillian') }}
                </option>
                <option value="{{ url('profile', shown_user.username)|urlparams(view_as='anonymous') }}"
                        {% if privacy_mode == 'anonymous' %} selected {% endif %}>
                  {{ _('Public') }}
                </option>
            </select>
          </form>
        </div>
      {% endif %}
      <h1 class="p-name fn">{{ profile.display_name }}</h1>
      {# Placeholder text in <h2> below
      <h2>I make tools for Mozillians</h2>
      #}
    </header>
    <section id="profile-details">
      {% if profile.bio %}
        <div id="bio" class="p-note note">
            <h3>{{ _('Bio') }}</h3>
            <p>{{ profile.bio }}</p>
            <p>{{ _('Previously: Social media and Army of Awesome') }}</p>
        </div>
      {% endif %}
      {% if profile.groups.count() %}
        <div id="groups" class="p-category category">
          <h3>{{ _('Groups') }}</h3>
            {% for group in profile.groups.all() %}
              {% if (user.is_authenticated() and
                     user.get_profile().is_vouched) %}
                <a href="{{ url('group', group.url) }}">{{ group.name }}</a>
              {%- else -%}
                {{ group.name }}
              {%- endif -%}
              {% if not loop.last %},{% endif %}
            {% endfor %}
        </div>
      {% endif %}<commit_msg>Remove leftover demo text in profile page.<commit_after>{% extends "base.html" %}

{% block page_title %}{{ profile.display_name }}{% endblock %}
{% block body_id %}profile{% endblock %}
{% block body_class %}
  {{ super() }}
  {% if not profile.is_vouched %}pending{% endif %}
{% endblock %}

{% block messages %}{% endblock %}

{% block content %}
  {% if messages %}
      {% for message in messages %}
        {% with %}
          {% set label = message.tags in ['error', 'success', 'info'] %}
          <div class="alert{% if label %} alert-{{ message.tags }}{% endif %}">{{ message }}</div>
        {% endwith %}
      {% endfor %}
  {% endif %}
  <div class="alert">
    {% if user.username == shown_user.username %}
      {{ _('Your Profile') }}
    {% elif profile.is_vouched %}
      {{ _('Mozillian Profile') }}
    {% else %}
      {{ _('Pending Profile') }}
    {% endif %}
  </div>
  {% if not profile.is_vouched %}
    <div id="pending-approval">
      {% if user == shown_user %}
        {% trans profile_url=absolutify(url('profile', user.username)),
                 contribute_url='http://www.mozilla.org/contribute' %}
          <p>
            Your profile is waiting to be vouched. Send the link below to someone who
            is familiar with your contributions and ask them to vouch for you:
            <em class="underline" title="Your profile URL">{{ profile_url }}</em>
          </p>
          <p>
            If you are new to the Mozilla community,
            <a class="button" href="{{ contribute_url }}">get involved</a>
          </p>
          <p>
            The chances of being vouched increase as you finish tasks in our community.
          </p>

        {% endtrans %}
      {% else %}
        {% if vouch_form %}
          <form action="{{ url('vouch') }}" method="POST"
                id="vouch-form">
            {{ csrf() }}
            {{ vouch_form }}
            {% trans name=profile.display_name %}
                <button type="submit">
                  Vouch for {{ name }}
                </button>
            {% endtrans %}
          </form>
        {% endif %}
        {% trans %}
          <p>This profile is waiting for approval.</p>
          <p>Because our community directory is for Mozillians who
            are 13 and older, please don't vouch for anyone under
            13.</p>
        {% endtrans %}
      {% endif %}
    </div>
  {% endif %}

  {% if privacy_mode == 'anonymous' and not profile.is_public %}
    <div id="anonymous">
      {% trans edit_url=url('profile.edit') %}
        Your profile is not public. If you <a href="{{ edit_url }}">edit
        your profile</a> to have at least one public field,
        your public profile will be viewable.
      {% endtrans %}
    </div>
  {% endif %}

  <article id="profile-stats">
    <div class="profile-photo">
      <img src="{{ shown_user.userprofile.get_photo_url('150x150') }}" alt="{{ shown_user.username }}">
    </div>
    <div class="stats">
      {% set mozillian_years = get_mozillian_years(profile) %}
      {% if not mozillian_years is none %}
        <section id="membership">
            <div class="status">
              <i class="icon-calendar"></i>
              {% if mozillian_years > 0 %}
                {% trans %}
                  Mozillian for {{ mozillian_years }} years
                {% endtrans %}
              {% else %}
                  Mozillian for less than a year
              {% endif %}
              <span>{{ shown_user.userprofile.date_mozillian.strftime('%b %Y') }}</span>
            </div>
        </section>
      {% endif %}
      {% if profile.country or profile.region or profile.city %}
        <section id="location">
          <i class="icon-globe"></i> {% include 'phonebook/includes/profile_location.html' %}
        </section>
      {% endif %}
      {% if profile.timezone %}
        <section id="timezone">
          <i class="icon-time"></i> {{ profile.timezone }}
        </section>
      {% endif %}
     </div>
  </article>

  <article id="profile-info">
    <header>
      {% if user == shown_user %}
        <div class="privacy-view">
          <form method="GET" action=".">
            <label>{{ _('View as:') }}</label>
            <select id="view-privacy-mode">
                <option value="{{ url('profile', shown_user.username) }}"
                        {% if privacy_mode == 'myself' %} selected {% endif %}>
                  {{ _('Myself') }}
                </option>
                <option value="{{ url('profile', shown_user.username)|urlparams(view_as='mozillian') }}"
                        {% if privacy_mode == 'mozillian' %} selected {% endif %} >
                  {{ _('Mozillian') }}
                </option>
                <option value="{{ url('profile', shown_user.username)|urlparams(view_as='anonymous') }}"
                        {% if privacy_mode == 'anonymous' %} selected {% endif %}>
                  {{ _('Public') }}
                </option>
            </select>
          </form>
        </div>
      {% endif %}
      <h1 class="p-name fn">{{ profile.display_name }}</h1>
      {# Placeholder text in <h2> below
      <h2>I make tools for Mozillians</h2>
      #}
    </header>
    <section id="profile-details">
      {% if profile.bio %}
        <div id="bio" class="p-note note">
            <h3>{{ _('Bio') }}</h3>
            <p>{{ profile.bio }}</p>
        </div>
      {% endif %}
      {% if profile.groups.count() %}
        <div id="groups" class="p-category category">
          <h3>{{ _('Groups') }}</h3>
            {% for group in profile.groups.all() %}
              {% if (user.is_authenticated() and
                     user.get_profile().is_vouched) %}
                <a href="{{ url('group', group.url) }}">{{ group.name }}</a>
              {%- else -%}
                {{ group.name }}
              {%- endif -%}
              {% if not loop.last %},{% endif %}
            {% endfor %}
        </div>
      {% endif %}
{'fraction_non_alphanumeric': 0.16871777814734742, 'fraction_numerical': 0.0033261267254282387, 'mean_word_length': 1.7750346100599907, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 179, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3305933', 'n_tokens_mistral': 3803, 'n_tokens_neox': 3359, 'n_words': 875}