Skip to content
Snippets Groups Projects
signup_modal.html 4.42 KiB
Newer Older
Galen Frechette's avatar
Galen Frechette committed
<%namespace name='static' file='static_content.html'/>
Matthew Mongeau's avatar
Matthew Mongeau committed
<%! from django_countries.countries import COUNTRIES %>
<%! from student.models import UserProfile %>
Matthew Mongeau's avatar
Matthew Mongeau committed
<%! from datetime import date %>
Matthew Mongeau's avatar
Matthew Mongeau committed
<%! import calendar %>
Galen Frechette's avatar
Galen Frechette committed

<section id="signup-modal" class="modal signup-modal">
Galen Frechette's avatar
Galen Frechette committed
  <div class="inner-wrapper">
    <div id="enroll">
      <header>
        <h2>Sign Up for <span class="edx">edX</span></h2>
        <hr>
      </header>
Galen Frechette's avatar
Galen Frechette committed

      <form id="enroll_form" method="post" data-remote="true" action="/create_account">
Matthew Mongeau's avatar
Matthew Mongeau committed
        <div class="notice"></div>
Matthew Mongeau's avatar
Matthew Mongeau committed
        <div id="enroll_error" class="modal-form-error" name="enroll_error"></div>
Matthew Mongeau's avatar
Matthew Mongeau committed
        <div id="enroll_error" name="enroll_error"></div>

        <div class="input-group">
          <label>E-mail*</label>
          <input name="email" type="email" placeholder="E-mail*">
          <label>Password*</label>
          <input name="password" type="password" placeholder="Password*">
          <label>Public Username*</label>
          <input name="username" type="text" placeholder="Public Username*">
          <label>Full Name</label>
          <input name="name" type="text" placeholder="Full Name*">
          <label>Mailing address</label>
          <textarea name="mailing_address" placeholder="Mailing address"></textarea>
        </div>

        <div class="input-group">
          <section class="citizenship">
            <label>Country</label>
            <div class="input-wrapper">
              <select name="country">
                  <option value="">--</option>
                  %for country_code, country_name in COUNTRIES:
                      <option value="${country_code}">${country_name}</option>
                  %endfor
              </select>
            </div>
          </section>

          <section class="gender">
            <label>Gender</label>
            <div class="input-wrapper">
              <select name="gender">
                  <option value="">--</option>
                  %for code, gender in UserProfile.GENDER_CHOICES:
                      <option value="${code}">${gender}</option>
                  %endfor
              </select>
            </div>
          </section>

          <section class="date-of-birth">
            <label>Date of birth</label>
            <div class="input-wrapper">
              <select name='date_of_birth__month'>
                  <option value="">month</option>
                  %for month in range(1,13):
Matthew Mongeau's avatar
Matthew Mongeau committed
                    <option value="${month}">${month} - ${calendar.month_name[month]}</option>
                  %endfor
              </select>

              <select name='date_of_birth__day'>
                  <option value="">day</option>
                  %for day in range(1,32):
                      <option value="${day}">${day}</option>
                  %endfor
              </select>

              <select name='date_of_birth__year'>
                  <option value="">year</option>
                  %for year in range(date.today().year,1899,-1):
                      <option value="${year}">${year}</option>
                  %endfor
              </select>
            </div>
          </section>
        </div>

        <div class="input-group">
          <label class="terms-of-service">
            <input name="terms_of_service" type="checkbox" value="true">
            I agree to the
            <a href="${reverse('tos')}" target="_blank">Terms of Service</a>*
          </label>

          <label class="honor-code">
            <input name="honor_code" type="checkbox" value="true">
            I agree to the
            <a href="${reverse('honor')}" target="_blank">Honor Code</a>*
Galen Frechette's avatar
Galen Frechette committed

        <div class="submit">
          <input name="submit" type="submit" value="Create My Account">
        </div>
      </form>

      <section class="login-extra">
        <p>
          <span>Already have an account? <a href="#login-modal" class="close-signup" rel="leanModal">Login.</a></span>
        </p>
      </section>

    </div>
Galen Frechette's avatar
Galen Frechette committed

    <div class="close-modal">
      <div class="inner">
        <p>&#10005;</p>
      </div>
    </div>
  </div>
</section>
Matthew Mongeau's avatar
Matthew Mongeau committed

<script type="text/javascript">
  (function() {
   $(document).delegate('#enroll_form', 'ajax:success', function(data, json, xhr) {
     if(json.success) {
       $('#enroll').html(json.value);
     } else {
       $('#enroll_error').html(json.value).stop().css("display", "block");
     }
Matthew Mongeau's avatar
Matthew Mongeau committed
    });
Matthew Mongeau's avatar
Matthew Mongeau committed
  })(this)
</script>