<!DOCTYPE html>
<html lang="en">

<head>
    <metaÂ charset="utf-8">
    <title>CPS512: Lab Team Registration</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
        crossorigin="anonymous"></script>
    <style>
        .col-form-label {
            text-align: right
        }
    </style>
</head>

<body>
    <h2 class="mt-3 col-sm-8 offset-sm-2">CPS512: Lab Team Registration</h2>

    <div class="mt-3 col-sm-8 offset-sm-2">
        <h3>Note</h3>
        <p>
            This is a system similar to AG350 for team management in the course. All your code will be stored on
            <%- platform %>, which is a git platform. We already created a namespace "CPS512-Spring22" on <%- platform %>. 
            After you registered your team here, this system will create a repo for the teammates in the namespace. 
            Each teammate will receive an invitation email to join the repo.
            Then you should go to <%- platform %> and git clone the repo to your local or virtual machine for development.
        </p>
        <p><b>You may need some settings on <%- platform %> (see <a href="access.html">this</a>) before you can access to the repo.</b></p>
        <h3>Grading</h3>
        <p>
            After deadline of each lab, we will download your code from the repo on <%- platform %>, and use your latest
            commit before the deadline for grading.
        </p>
        <p><b>Therefore, remember to push your changes to the repo on <%- platform %> before the deadline!</b></p>
        <br>
    </div>
    
    <div class="mt-3 col-sm-8 offset-sm-2">
        <h3>Registration</h3>
        <p>Please use netid@duke.edu for registration. </p>
        <form action="/registration" method="post" id="reg" onsubmit="return verification()">
            <div class="mt-3">
                <label>Member 1 (Required)</label>
                <div class="row">
                    <label for="name1" class="col-sm-2 col-form-label">Full Name</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" id="name1" name="name1" placeholder="First Last"
                            required>
                    </div>
                    <label for="email1" class="col-sm-2 col-form-label">Duke Email</label>
                    <div class="col-sm-4">
                        <input type="email" class="form-control" id="email1" name="email1"
                            placeholder="netid@duke.edu" required>
                    </div>
                </div>
            </div>
            <div class="mt-3">
                <label>Member 2 (Optional)</label>
                <div class="row">
                    <label for="name2" class="col-sm-2 col-form-label">Full Name</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" id="name2" name="name2" placeholder="First Last">
                    </div>
                    <label for="email2" class="col-sm-2 col-form-label">Duke Email</label>
                    <div class="col-sm-4">
                        <input type="email" class="form-control" id="email2" name="email2"
                            placeholder="netid@duke.edu">
                    </div>
                </div>
            </div>
            <div class="mt-3">
                <label>Member 3 (Optional)</label>
                <div class="row">
                    <label for="name3" class="col-sm-2 col-form-label">Full Name</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" id="name3" name="name3" placeholder="First Last">
                    </div>
                    <label for="email3" class="col-sm-2 col-form-label">Duke Email</label>
                    <div class="col-sm-4">
                        <input type="email" class="form-control" id="email3" name="email3"
                            placeholder="netid@duke.edu">
                    </div>
                </div>
            </div>

            <button type="submit" class="btn btn-primary mt-3">Register</button>
        </form>
    </div>

    <script>
        function verification() {
            return true;
            /*
            for (let i = 1; i <= 3; i++) {
                let email = document.forms["reg"]["email" + i].value;
                email = email.trim().toLowerCase();
                if (email == "") continue;
                if (!emails.has(email)) {
                    alert("Cannot find the email address " + email + " in the course. Make sure you input correct duke email address.");
                    return false;
                }
            }
            */
        }
    </script>

</body>


</html>