<commit_before>{% extends "socialaccount/base.html" %}
{% from "includes/error_list.html" import errorlist %}
{% from 'includes/common_macros.html' import newsletter_widget %}

{% set title = _('Signup') %}

{% set classes = 'register' %}

{% block site_css %}
    {{ super() }}
    {{ css('newsletter') }}
    {{ css('submission') }}
{% endblock %}

{% block site_js %}
    {{ super() }}
    {{ js('newsletter',) }}
{% endblock %}

{% block content %}
<section id="content">
  <div class="wrap">
    <section id="content-main" role="main">
      <article id="browser_register">

        {% if account.get_provider().id == 'persona' %}
          <h1>{{ _('Sign up') }}</h1>
          <p id="persona-explanation">{% trans persona_href='https://login.persona.org/about' %}
          MDN uses <a href="{{ persona_href }}" rel="external">Persona</a>,
          a safe and simple way to sign in with just your email address.
          {% endtrans %}</p>
        {% endif %}

        <form id="create_user" class="boxed submission" method="post" action="{{ url('socialaccount_signup') }}">
          <p>{% trans provider_name=account.get_provider().name %}
            We couldn't find an MDN profile for your {{ provider_name }} account.
            If you're new here, you can pick an MDN username now and complete your
            registration.
          {% endtrans %}</p>
          <p>{% trans %}
            You can access everything on the MDN website even without an account,
            but when you join you'll be able to edit docs, submit demos, and have
            your own profile page.
          {% endtrans %}</p>

          {{ errorlist(form) }}

          {{ csrf() }}
          {% if redirect_field_value %}
          <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
          {% endif %}
          <fieldset>
            <ul>
              <li>
                <label for="{{ form.username.id_for_label }}" class="outer"><b>{{ form.username.label }}</b></label>
                {{ form.username }}
                <p class="field-explanation"><small>{{ _("Please enter the name you'd like to display to other users to identify your contributions.") }}</small></p>
              </li>
              {# The email field is hidden if only one email is provided #}
              {% if form.email.field.widget.input_type == 'hidden' %}
                {{ form.email }}
              {% else %}

              <li>
                <label for="{{ form.email.id_for_label }}" class="outer upper"><b>{{ form.email.label }}</b></label>
                <p class="field-explanation-top"><small>
                {{ _("We will use this to send you emails related to your account and if you sign up for any additional notifications.") }}
                </small></p>
                <ul class="choices">
                {% for email_choice in form.email %}
                  {% set id_for_label="{name}_{id}"|f(name=email_choice.name, id=loop.index0) %}
                  <li>
                    {% if email_choice.choice_value == form.other_email_value %}
                      {{ email_choice.tag() }}
                      <label for="{{ id_for_label }}" class="inner other-label">{% trans %}other:{% endtrans %}</label>
                      {{ form.other_email }}
                    {% else %}
                    <label for="{{ id_for_label }}">
                      {{ email_choice.tag() }}
                      {{ email_choice.choice_label|safe }}
                    </label>
                    {% endif %}
                  </li>
                {% endfor %}
                </ul>
              </li>
              {% endif %}

              {{ newsletter_widget(form) }}

              <li class="submit">
                <button type="submit" name="create">{{ _('Create a New Profile') }}</button>
              </li>
            </ul>
          </fieldset>
          <p class="trouble">
              {% trans bug_href='https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cc=jkarahalis%40mozilla.com&cf_fx_iteration=---&cf_fx_points=---&component=Login&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&priority=--&product=Mozilla%20Developer%20Network&rep_platform=All&status_whiteboard=%5Btrouble-logging-in%5D&target_milestone=---&version=unspecified&format=__standard__' %}
              <strong>Having trouble logging in? <a href="{{ bug_href }}" rel="external">Let us know</a>.</strong>
              {% endtrans %}
          </p>
        </form>

      </article>
    </section>
  </div>
</section>
{% endblock %}

{% block js %}
{{ super() }}
<script>
(function (jQuery) {
    'use strict';

    var $otherLabel = $('.other-label');
    var $otherRadio = $otherLabel.prev();
    $otherLabel.next().on('keyup focus', function() {
      $otherRadio.prop("checked", true);
    })

})(jQuery);
</script>

{% endblock %}<commit_msg>Fix scoping thing with js.<commit_after>{% extends "socialaccount/base.html" %}
{% from "includes/error_list.html" import errorlist %}
{% from 'includes/common_macros.html' import newsletter_widget %}

{% set title = _('Signup') %}

{% set classes = 'register' %}

{% block site_css %}
    {{ super() }}
    {{ css('newsletter') }}
    {{ css('submission') }}
{% endblock %}

{% block site_js %}
    {{ super() }}
    {{ js('newsletter',) }}
{% endblock %}

{% block content %}
<section id="content">
  <div class="wrap">
    <section id="content-main" role="main">
      <article id="browser_register">

        {% if account.get_provider().id == 'persona' %}
          <h1>{{ _('Sign up') }}</h1>
          <p id="persona-explanation">{% trans persona_href='https://login.persona.org/about' %}
          MDN uses <a href="{{ persona_href }}" rel="external">Persona</a>,
          a safe and simple way to sign in with just your email address.
          {% endtrans %}</p>
        {% endif %}

        <form id="create_user" class="boxed submission" method="post" action="{{ url('socialaccount_signup') }}">
          <p>{% trans provider_name=account.get_provider().name %}
            We couldn't find an MDN profile for your {{ provider_name }} account.
            If you're new here, you can pick an MDN username now and complete your
            registration.
          {% endtrans %}</p>
          <p>{% trans %}
            You can access everything on the MDN website even without an account,
            but when you join you'll be able to edit docs, submit demos, and have
            your own profile page.
          {% endtrans %}</p>

          {{ errorlist(form) }}

          {{ csrf() }}
          {% if redirect_field_value %}
          <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
          {% endif %}
          <fieldset>
            <ul>
              <li>
                <label for="{{ form.username.id_for_label }}" class="outer"><b>{{ form.username.label }}</b></label>
                {{ form.username }}
                <p class="field-explanation"><small>{{ _("Please enter the name you'd like to display to other users to identify your contributions.") }}</small></p>
              </li>
              {# The email field is hidden if only one email is provided #}
              {% if form.email.field.widget.input_type == 'hidden' %}
                {{ form.email }}
              {% else %}

              <li>
                <label for="{{ form.email.id_for_label }}" class="outer upper"><b>{{ form.email.label }}</b></label>
                <p class="field-explanation-top"><small>
                {{ _("We will use this to send you emails related to your account and if you sign up for any additional notifications.") }}
                </small></p>
                <ul class="choices">
                {% for email_choice in form.email %}
                  {% set id_for_label="{name}_{id}"|f(name=email_choice.name, id=loop.index0) %}
                  <li>
                    {% if email_choice.choice_value == form.other_email_value %}
                      {{ email_choice.tag() }}
                      <label for="{{ id_for_label }}" class="inner other-label">{% trans %}other:{% endtrans %}</label>
                      {{ form.other_email }}
                    {% else %}
                    <label for="{{ id_for_label }}">
                      {{ email_choice.tag() }}
                      {{ email_choice.choice_label|safe }}
                    </label>
                    {% endif %}
                  </li>
                {% endfor %}
                </ul>
              </li>
              {% endif %}

              {{ newsletter_widget(form) }}

              <li class="submit">
                <button type="submit" name="create">{{ _('Create a New Profile') }}</button>
              </li>
            </ul>
          </fieldset>
          <p class="trouble">
              {% trans bug_href='https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cc=jkarahalis%40mozilla.com&cf_fx_iteration=---&cf_fx_points=---&component=Login&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-4=X&flag_type-607=X&flag_type-791=X&flag_type-800=X&flag_type-803=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&priority=--&product=Mozilla%20Developer%20Network&rep_platform=All&status_whiteboard=%5Btrouble-logging-in%5D&target_milestone=---&version=unspecified&format=__standard__' %}
              <strong>Having trouble logging in? <a href="{{ bug_href }}" rel="external">Let us know</a>.</strong>
              {% endtrans %}
          </p>
        </form>

      </article>
    </section>
  </div>
</section>
{% endblock %}

{% block js %}
{{ super() }}
<script>
(function ($) {
    'use strict';

    var $otherLabel = $('.other-label');
    var $otherRadio = $otherLabel.prev();
    $otherLabel.next().on('keyup focus', function() {
      $otherRadio.prop("checked", true);
    })

})(jQuery);
</script>

{% endblock %}
{'fraction_non_alphanumeric': 0.16137718792075398, 'fraction_numerical': 0.0076937872667820735, 'mean_word_length': 2.2016625615763545, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 133, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5891969', 'n_tokens_mistral': 3245, 'n_tokens_neox': 2950, 'n_words': 655}