diff options
Diffstat (limited to 'templates/main/jams/profile.html')
-rw-r--r-- | templates/main/jams/profile.html | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/templates/main/jams/profile.html b/templates/main/jams/profile.html new file mode 100644 index 00000000..6cf315d0 --- /dev/null +++ b/templates/main/jams/profile.html @@ -0,0 +1,106 @@ +{% extends "main/base.html" %} +{% block title %}Code Jams | Banned{% endblock %} +{% block og_title %}Code Jams | Banned{% endblock %} + +{% block extra_head %} + <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js" type="application/javascript"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.17/moment-timezone.min.js" type="application/javascript"></script> +{% endblock %} + +{% block content %} +<div class="uk-section"> + <div class="uk-container uk-container-small"> + <h1 class="uk-header uk-article-title"> + Code Jams: My Profile + </h1> + + {% if done %} + <p class="uk-alert uk-alert-success"> + Thanks - your data has been saved! + </p> + {% else %} + <p class="uk-alert uk-alert-primary"> + Please make sure you've filled this out correctly, as we do use this data when evaluating your code jam + application. + <br /> + <br /> + You may come back here and edit your data at any time. + </p> + {% endif %} + + <form class="uk-form-horizontal" action="{{ url_for("main.jams.profile") }}" method="post"> + <div> + <div class="uk-form-label"> + <label class="uk-form-label" for="dob">Date of Birth</label> + </div> + <div class="uk-form-controls-text uk-form-controls"> + <input class="uk-input" type="text" name="dob" id="dob" value="{{ participant.dob }}" required> + </div> + </div> + <div> + <div class="uk-form-label"> + <label class="uk-form-label" for="github_username">GitHub Username</label> + </div> + <div class="uk-form-controls-text uk-form-controls"> + <input class="uk-input" type="text" name="github_username" id="github_username" value="{{ participant.github_username }}" required> + </div> + </div> + <div> + <div class="uk-form-label"> + <label class="uk-form-label" for="timezone">Timezone</label> + </div> + <div class="uk-form-controls-text uk-form-controls"> + <input class="uk-input" type="text" name="timezone" id="timezone" value="{{ participant.timezone }}" required> + </div> + </div> + <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> + <br /> + + <div class="uk-text-center"> + <a class="uk-button uk-button-default" href="{{ url_for("main.jams.index") }}"> + <i class="uk-icon fa-fw far fa-arrow-left"></i> Back + </a> + <button type="submit" class="uk-button uk-button-primary" id="submit"> + <i class="uk-icon fa-fw far fa-check"></i> Save + </button> + </div> + </form> + </div> +</div> + + + +<script type="application/javascript"> + const date = flatpickr("#dob", {enableTime: false, altInput: true}); + const tz = moment().format("Z"); + + const dob_input = document.getElementById("dob"); + const github_input = document.getElementById("github_username"); + const tz_input = document.getElementById("timezone"); + + const submit_button = document.getElementById("submit"); + + function checkInputs() { + if (dob_input.value.length < 1) + return submit_button.disabled = true; + + if (github_input.value.length < 1) + return submit_button.disabled = true; + + if (tz_input.value.length < 1) + return submit_button.disabled = true; + + submit_button.disabled = false; + } + + dob_input.oninput = checkInputs; + github_input.oninput = checkInputs; + tz_input.oninput = checkInputs; + + if (tz_input.value.length < 1) { + document.getElementById("timezone").value = "UTC" + tz; + } + + checkInputs(); +</script> +{% endblock %} |