Skip to content
Snippets Groups Projects
tutor.html 5.18 KiB
<!DOCTYPE html>
<html>
<style>
    body {font-family: Arial, Helvetica, sans-serif;}
    * {box-sizing: border-box;}

    /* Full-width input fields */
    input[type=text] {
        width: 100%;
        padding: 15px;
        margin: 5px 0 22px 0;
        display: inline-block;
        border: none;
        background: #f1f1f1;
    }

    /* The Modal (background) */
    .modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 1; /* Sit on top */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: #474e5d;
        padding-top: 50px;
    }

    /* Modal Content/Box */
    .modal-content {
        background-color: #fefefe;
        margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
        border: 1px solid #888;
        width: 80%; /* Could be more or less, depending on screen size */
    }

    /* The Close Button (x) */
    .close {
        position: absolute;
        right: 35px;
        top: 15px;
        font-size: 40px;
        font-weight: bold;
        color: #f1f1f1;
    }

    /* Add padding to container elements */
    .container {
        padding: 16px;
    }

    .close:hover,
    .close:focus {
        color: #f44336;
        cursor: pointer;
    }

    .su {
        text-align:center;
    }

    /* Clear floats */
    .clearfix::after {
        content: "";
        clear: both;
        display: table;
    }
    .listing {
        float: left;
        display: block;
        padding: 14px 16px;
        margin: 10px;
        border-radius: 7px;
        border: 3px solid black;
    }

    .topnav {
        background-color: #333;
        position: fixed;
        top: 0;
        width: 100%;
    }

    main {
        margin-top: 75px;
    }

    .topitem {
        color: #f2f2f2;
        float: left;
        display: block;
        font-size: 16px;
        padding: 14px 16px;
    }

    .topmenu {
        font-size: 16px;
        padding: 14px 16px;
        position: relative;
        display: inline-block;
        float: right;
    }

        .topmenu a {
            color: #f2f2f2;
        }

</style>


<body>
    <title>ServicePoints</title>


    <div class="topnav">
        <div class="topitem">
            Username: {{username}}
        </div>
        <div class="topitem">
            Organization: {{org}}
        </div>
        <div class="topitem">
            Hours: {{hours}}
        </div>
        <div class="topmenu">
            <a href="/">Home</a>
        </div>
    </div>

    <div id="id01" class="modal">
        <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
        <form class="modal-content" action="/accounts/tutorsu/" method="post">
            <div class="container">
                <h1>Sign Up</h1>
                <p>Please fill in this form to sign up as a tutor.</p>
                <hr>
                <label for="subjects"><b>Tutoring Subject(s)</b></label>
                <input type="text" placeholder="Enter Subject(s)" name="subjects" required>

                <label for="time"><b>Available Times (Day of the week: time)</b></label>
                <input type="text" placeholder="Enter Times" name="time" required>

                <div class="clearfix">

                    <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
                    <form action="/accounts/tutorsu/" method="post">
                        <input type="submit" class="signup" name="sign" value="Sign Up" />
                    </form>
                </div>
            </div>
        </form>
    </div>

    <main>
        <h1>Welcome to the Service Points Tutoring page!</h1>
        {% if registered == 0 %}
        <p>Search through our database of current tutors or sign up to have your name and information listed.</p>
        <div class="su">
            <button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Sign Up</button>
        </div>
        {% endif %}
        {% if registered == 1 %}
    <p>Search through our database of current tutors or edit your listed information.</p>
    <div class="su">
        <button onclick="document.getElementById('id01').style.display='block'" style="width:auto; right: 35px">Edit Information</button>
        <form action="/accounts/tutorsu/" method="post">
            <input type="submit" class="signup" name="delete" value="Delete Profile" />
        </form>
    </div>
    {% endif %}
        <p>
            {% for tutor, user in zip(tutors, tutorsN) %}
            <div class="listing">
                {{user.fullname}}<br />
                Subjects: {{tutor.subject}}<br />
                Available Times: {{tutor.time}}<br />
                Contact Email: {{user.email}}
            </div>
            {% endfor %}
        </p>
    </main>

</body>
</html>