Something went wrong. Try again.
Code Review Workflow for IT Programming at BCTC West
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158{% extends "admin_base.html" %}
{% comment %} This page shows the Instructor a list of users that they can set as Reviewers or Non-Reviewers.{% endcomment %}
{% block resources %} {% load static %} <script defer src="{% static "js/form.js" %}"></script> <script defer src="{% static "js/user-list.js" %}"></script>{% endblock %}
{% block pageHeader %}Edit Users{% endblock %}
{% block containerClass %}container{% endblock %}
{% block mainContent %} <div class="modal fade" id="cleanupModal" data-bs-backdrop="static" tabindex="-1" aria-labelledby="cleanupModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="cleanupModalLabel">Cleanup Users</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <p>This will clear any users not found in ActiveDirectory.</p> <p>Please confirm your password to continue</p> <form class="form" id="cleanupForm" method="POST" action="{% url "user-cleanup" %}"> {% csrf_token %} <div class="form-floating"> <input id="userPassword" name="userPassword" type="password" class="form-control" placeholder="Password" required/> <label for="userPassword">Password</label> </div> </form> <p class="my-2">Note this may take some time, please don't leave the page.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button id="cleanupSubmitButton" type="button" class="btn btn-danger"> <span id="cleanupSpinner" class="loading spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span> <span id="cleanupSubmitText">Confirm</span> </button> </div> </div> </div> </div> <div class="row mb-5"> <div class="col"> <button type="button" class="btn btn-outline-secondary back-button d-inline"><i class="bi bi-arrow-left"></i> Back </button> </div> <div class="col text-end"> <button class="btn btn-outline-secondary d-inline" aria-label="Cleanup Users" id="user-cleanup-button" type="button" data-bs-toggle="modal" data-bs-target="#cleanupModal"> <i class="bi bi-person-x"></i> <span id="user-cleanup-label">Cleanup Users</span> </button> <button class="btn btn-outline-secondary d-none" aria-label="Display help text" id="help-button" type="button" data-bs-toggle="collapse" data-bs-target=".field-help" aria-expanded="false" aria-controls="users-helptext"> <i class="bi bi-question-circle"></i> <span id="help-label">Show Help</span> </button> </div> </div> <div class="row"> <div class="col"> <form method="post" class="session-form form-main"> <input name="sessions" type="hidden" class="session-input"/> {% csrf_token %} <div class="row"> <div class="col"><h2>AM Session</h2></div> <div class="col"><h2>PM Session</h2></div> </div> <div class="row"> <div class="col"> <table class="table"> <thead> <tr> <th scope="col">Name</th> <th scope="col">Reviewer</th> <th scope="col">Delete</th> </tr> </thead> <tbody class="session AM-session"> {% for user in AM %} <tr> <th scope="row" id="{{ user.id }}"><label for="{{ user.id }}-reviewer">{{ user }}</label></th> <td> <div class="form-switch"> <input id="{{ user.id }}-reviewer" {% if user.is_reviewer %}checked{% endif %} type="checkbox" class="form-check-input me-0" name="reviewers" value="{{ user.id }}"/></div> </td> <td> <input class="form-check-input" type="checkbox" name="to_delete" value="{{ user.id }}"/> </td> </tr> {% endfor %} </tbody> </table> </div> <div class="col"> <table class="table"> <thead> <tr> <th scope="col">Name</th> <th scope="col">Reviewer</th> <th scope="col">Delete</th> </tr> </thead> <tbody class="session PM-session"> {% for user in PM %} <tr> <th scope="row" id="{{ user.id }}">{{ user }}</th> <td> <div class="form-switch"> <input id="{{ user.id }}-reviewer" {% if user.is_reviewer %}checked{% endif %} type="checkbox" class="form-check-input me-0" name="reviewers" value="{{ user.id }}"/> </div> </td> <td> <input class="form-check-input" type="checkbox" name="to_delete" value="{{ user.id }}"/> </td> </tr> {% endfor %} </tbody> </table> </div> </div> <div class="mb-2 d-flex flex-row"> <div class="collapse text-nowrap ms-2 mt-1 align-middle field-help" id="users-helptext"> Click the toggle switch next to a user to make them a reviewer. <br/>Note that a student needs to sign in before they appear on this list. </div> </div> <div class="row my-5"> <div class="col"> <button class="btn mt-4 w-100 btn-outline-primary submit-button" type="submit"> <span class="loading spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span> <span class="submit-word">Save</span> </button> </div> </div> </form> </div> </div>{% endblock %}