98 lines
3.0 KiB
Plaintext
98 lines
3.0 KiB
Plaintext
<main class="np-box-container np-open-access">
|
|
<div class="np-box">
|
|
{% include "header_minimal" %}
|
|
<div class="np-box-content-container">
|
|
<form
|
|
class="np-form np-box-content"
|
|
action="{{ form.url }}"
|
|
method="get"
|
|
id="login-form"
|
|
novalidate>
|
|
{% form_authenticity_token %}
|
|
<div class="np-form-headline">
|
|
{% t shared.welcome_to_school
|
|
, school_name: current_school.name %}
|
|
</div>
|
|
<div class="np-form-subheadline">
|
|
{% comment %} {% t.headline
|
|
, key: current_school.course_vocabulary %} {% endcomment %}
|
|
To access your training, enter your wsgc email address, first name, and last name below.
|
|
</div>
|
|
<div class="np-form-field">
|
|
<label class="np-input-label" for="learner_first_name">
|
|
{% t shared.first_name %}
|
|
</label>
|
|
<input
|
|
class="np-input"
|
|
autofocus="autofocus"
|
|
type="text"
|
|
name="first_name"
|
|
id="learner_first_name"
|
|
value="{{ form.first_name }}" />
|
|
</div>
|
|
<div class="np-form-field">
|
|
<label class="np-input-label" for="learner_last_name">
|
|
{% t shared.last_name %}
|
|
</label>
|
|
<input
|
|
class="np-input"
|
|
type="text"
|
|
name="last_name"
|
|
id="learner_last_name"
|
|
value="{{ form.last_name }}" />
|
|
</div>
|
|
<div class="np-form-field">
|
|
<label class="np-input-label" for="learner_email">
|
|
{% t shared.email_address %}
|
|
</label>
|
|
<input
|
|
class="np-input"
|
|
type="text"
|
|
name="email"
|
|
id="learner_email"
|
|
value="{{ form.email }}" />
|
|
<span id="email-error" class="np-hidden">Please enter your wsgc email</span>
|
|
</div>
|
|
<input
|
|
type="submit"
|
|
name="commit"
|
|
value="{% t shared.enter %}"
|
|
class="np-button np-button-big np-form-action" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script>
|
|
document.querySelector("input[type='submit']").addEventListener("click", function(e) {
|
|
e.preventDefault()
|
|
console.log("clicked")
|
|
const submittedEmail = document.getElementById("learner_email").value
|
|
|
|
if (submittedEmail.includes("@wsgc.com")) {
|
|
console.log("can login")
|
|
document.getElementById("email-error").classList.remove("np-hidden")
|
|
document.getElementById("login-form").submit();
|
|
} else {
|
|
console.log("cant login, show error")
|
|
document.getElementById("email-error").classList.remove("np-hidden")
|
|
}
|
|
|
|
})
|
|
</script>
|
|
|
|
<style>
|
|
@media (min-width: 768px) {
|
|
.np-box-content {
|
|
width: 500px;
|
|
}
|
|
}
|
|
|
|
span#email-error {
|
|
font-size: 13px;
|
|
margin-top: 6px;
|
|
font-weight: 500;
|
|
display: block;
|
|
color: #e81818;
|
|
}
|
|
</style> |