Skip to content
Snippets Groups Projects
signup_modal.html 3.08 KiB
Newer Older
Galen Frechette's avatar
Galen Frechette committed
<%namespace name='static' file='static_content.html'/>

<section class="modal signup-modal">
  <div class="inner-wrapper">
    <header>
      <h3>Sign Up for edX</h3>
      <hr>
    </header>

    <form id="enroll_form" method="post">
Matthew Mongeau's avatar
Matthew Mongeau committed
      <div id="enroll_error" name="enroll_error"></div>
Galen Frechette's avatar
Galen Frechette committed
      <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>
Matthew Mongeau's avatar
Matthew Mongeau committed
      <input name="name" type="text" placeholder="Full Name">
Galen Frechette's avatar
Galen Frechette committed
      <label>Your Location</label>
      <input name="location" type="text" placeholder="Your Location">
      <label>Prefered Language</label>
      <input name="language" type="text" placeholder="Prefered Language">
      <label class="terms-of-service">
Matthew Mongeau's avatar
Matthew Mongeau committed
        <input name="terms_of_service" type="checkbox" value="true">
Galen Frechette's avatar
Galen Frechette committed
        I agree to the
        <a href="#">Terms of Service</a>
      </label>
      <label class="honor-code">
Matthew Mongeau's avatar
Matthew Mongeau committed
        <input name="honor_code" type="checkbox" value="true">
Galen Frechette's avatar
Galen Frechette committed
        I agree to the
        <a href="#">Honor Code</a>
        , sumarized below as:
      </label>

        <div class="honor-code-summary">
          <ul>
            <li>
              <p>Complete all mid-terms and final exams with only my own work.</p>
            </li>
            <li>
              <p>Maintain only one account, and not share the username or password.</p>
            </li>
            <li>
              <p>Not engage in any activity that would dishonestly improve my results, or improve or hurt those of others.</p>
            </li>
            <li>
              <p>Not post answers to problems that are being used to assess student performance.</p>
            </li>
          </ul>
          <hr>
        </div>


      <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.</a></span>
      </p>
    </section>

    <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() {
Matthew Mongeau's avatar
Matthew Mongeau committed
    function getCookie(name) {
      return $.cookie(name);
    }
Matthew Mongeau's avatar
Matthew Mongeau committed
    function postJSON(url, data, callback) {
      $.ajax({type:'POST',
        url: url,
        dataType: 'json',
        data: data,
        success: callback,
        headers : {'X-CSRFToken':getCookie('csrftoken')}
Matthew Mongeau's avatar
Matthew Mongeau committed
      });
Matthew Mongeau's avatar
Matthew Mongeau committed
    }
Matthew Mongeau's avatar
Matthew Mongeau committed
    $('form#enroll_form').submit(function(e) {
      e.preventDefault();
      var submit_data = $('#enroll_form').serialize();

      postJSON('/create_account',
        submit_data,
        function(json) {
          if(json.success) {
            $('#enroll').html(json.value);
          } else {
            $('#enroll_error').html(json.value).stop().css("background-color", "#933").animate({ backgroundColor: "#333"}, 2000);
          }
        }
      );
    });
Matthew Mongeau's avatar
Matthew Mongeau committed
  })(this)
</script>