Skip to content

Commit

Permalink
all login
Browse files Browse the repository at this point in the history
  • Loading branch information
niannianwang committed Feb 19, 2025
1 parent 180dd06 commit 8ced516
Show file tree
Hide file tree
Showing 14 changed files with 346 additions and 215 deletions.
4 changes: 0 additions & 4 deletions myapp/static/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ a:hover {
text-decoration: underline;
}

a:visited {
color: #183E51;
}

label {
display: block;
}
Expand Down
21 changes: 12 additions & 9 deletions myapp/static/login/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,31 @@ input[type="password"]:focus::placeholder {
width: 100%;
color: #888;
margin-top: 2px;
margin-bottom: 25px;
}

input[type="submit"] {
cursor: pointer;
width: 30%;
width: 120px;
background-color: #183E51;
color: white;
border-radius: 5px;
padding: 6px;
font-size: 1rem;
border: none;
transition: background 0.3s ease;
margin-top: 25px;
}

input[type="submit"]:hover {
background-color: #050A24;
}

.register-text {
font-size: 0.9rem;
margin-top: 15px;
}

.register-text a {
.register-text{
color: #5FBFF9;
font-weight: bold;
}

.login-text a {
.login-text{
color: #5FBFF9;
font-weight: bold;
}
Expand All @@ -144,4 +139,12 @@ input[type="submit"]:hover {
right: 10px;
width: 200px;
height: auto;
}

.return-login{
font-size: 0.9rem;
text-align: center;
width: 100%;
color: #888;
margin-top: 10px;
}
27 changes: 20 additions & 7 deletions myapp/templates/registration/form_complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,28 @@
<head>
<link rel="stylesheet" href="{% static 'global.css' %}">
<link rel="stylesheet" href="{% static 'login/styles.css' %}">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
<script src="{% static 'login/login.js' %}"></script>
</head>

<body>
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<div id="logincard">
<p style="text-align: center">Thank you for completing the form! <br>
Your roles and permissions have been updated. <br>
<a href="{% url 'spa' %}">Back to home</a>
</p>
</div>
<div class="container">
<!-- Left Column -->
<div class="left-column">
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<p class="tagline">The Premier Engineering <br> Honor Society of UCSD</p>
</div>

<!-- Right Column -->
<div class="right-column">
<div id="logincard">
<p style="text-align: center">Thank you for completing the form! <br>
Your roles and permissions have been updated. <br>
<a href="{% url 'spa' %}">Back to home</a>
</p>
</div>
<img class="hknmascot" src="{% static 'hkn_mascot.png' %}" alt="HKN Mascot">
</div>
</div>
</body>
{% endblock content %}
155 changes: 85 additions & 70 deletions myapp/templates/registration/inductee_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,98 @@
<head>
<link rel="stylesheet" href="{% static 'global.css' %}">
<link rel="stylesheet" href="{% static 'login/styles.css' %}">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
<script src="{% static 'login/login.js' %}"></script>
</head>

<body>
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<div id="logincard">
{% if user.is_authenticated %}
<form method="POST" class="childrencentered">
{% csrf_token %}
<h1>Inductee Sign Up Form</h1>
<p style="width: 90%">Congratulations! You've been selected to induct to Eta Kappa Nu
(HKN), the Official Honor Society of IEEE.
We are so happy to see that you are interested in inducting.<br>
<br>
Please fill out this form to begin your induction process. There
is no risk in filling out this form (you can opt-out at any time
by unsubscribing or ignoring the emails), but it is mandatory
for you to fill out this form in order to induct!
</p>
<table style="border-spacing: 10px; display: flex;" class="childrencentered">
{% for field in form %}
{% if field.name == 'other_major' %}
<tr id="major_other_option_container">
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% elif field.name == 'other_degree' %}
<tr id="degree_other_option_container">
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% else %}
<tr>
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% endif %}
{% endfor %}
<div class="container">
<!-- Left Column -->
<div class="left-column">
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<p class="tagline">The Premier Engineering <br> Honor Society of UCSD</p>
</div>

{% for field in form %}
{% if field.errors %}
<tr>
<ul class="errorlist">
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
</tr>
{% endif %}
{% endfor %}
</table>
<input type="submit" value="Submit"/>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#major_other_option_container').hide();
$('#degree_other_option_container').hide();
<!-- Right Column -->
<div class="right-column">
<div id="logincard">
{% if user.is_authenticated %}
<form method="POST" class="childrencentered">
{% csrf_token %}
<h1>Inductee Sign Up Form</h1>
<p style="width: 90%">Congratulations! You've been selected to induct to Eta Kappa Nu
(HKN), the Official Honor Society of IEEE.
We are so happy to see that you are interested in inducting.<br>
<br>
Please fill out this form to begin your induction process. There
is no risk in filling out this form (you can opt-out at any time
by unsubscribing or ignoring the emails), but it is mandatory
for you to fill out this form in order to induct!
</p>
<table style="border-spacing: 10px; display: flex;" class="childrencentered">
{% for field in form %}
{% if field.name == 'other_major' %}
<tr id="major_other_option_container">
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% elif field.name == 'other_degree' %}
<tr id="degree_other_option_container">
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% else %}
<tr>
<td>{{ field.label_tag }}</td>
<td>{{ field }}</td>
</tr>
{% endif %}
{% endfor %}

$('#id_major').change(function() {
if ($(this).val() === 'Other') {
$('#major_other_option_container').show();
} else {
{% for field in form %}
{% if field.errors %}
<tr>
<ul class="errorlist">
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
</tr>
{% endif %}
{% endfor %}
</table>
<input type="submit" value="Submit"/>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
<script>
$(document).ready(function() {
$('#major_other_option_container').hide();
}
});
$('#id_degree').change(function() {
if ($(this).val() === 'Other') {
$('#degree_other_option_container').show();
} else {
$('#degree_other_option_container').hide();
}
});
});
</script>
</form>
{% else %}
<p>You are not logged in, please <a href="{% url 'login' %}?next=/inductee_form/{{ class_token }}/">login</a> or <a href="{% url 'register' %}?next=/inductee_form/{{ class_token }}/">register</a> an account.</p>
{% endif %}

$('#id_major').change(function() {
if ($(this).val() === 'Other') {
$('#major_other_option_container').show();
} else {
$('#major_other_option_container').hide();
}
});
$('#id_degree').change(function() {
if ($(this).val() === 'Other') {
$('#degree_other_option_container').show();
} else {
$('#degree_other_option_container').hide();
}
});
});
</script>
</form>
{% else %}
<p>You are not logged in, please
<a href="{% url 'login' %}?next=/inductee_form/{{ class_token }}/" class="login-text">login</a> or
<a href="{% url 'register' %}?next=/inductee_form/{{ class_token }}/" class="register-text">register</a> an account.</p>
{% endif %}
</div>
<img class="hknmascot" src="{% static 'hkn_mascot.png' %}" alt="HKN Mascot">
</div>
</div>
</body>

Expand Down
35 changes: 24 additions & 11 deletions myapp/templates/registration/inductee_form_invalid.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,33 @@
<head>
<link rel="stylesheet" href="{% static 'global.css' %}">
<link rel="stylesheet" href="{% static 'login/styles.css' %}">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded from content delivery network with no integrity check.
<script src="{% static 'login/login.js' %}"></script>
</head>

<body>
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<div id="logincard">
{% if error == "invalid" %}
<p>Invalid link, please check you have entered the url correctly.</p>
<p>If the issue persists, please contact an officer on our <a href=https://discord.gg/dX7xc73>discord server</a>.</p>
{% elif error == "form_closed" %}
<p>The form for this induction cycle has closed.</p>
{% else %}
<p>An unspecified error has occured.</p>
{% endif %}
<p><a href="{% url 'spa' %}">Back to home</a></p>
<div class="container">
<!-- Left Column -->
<div class="left-column">
<img id="hknlogo" src="{% static 'HKN-Vector-White.png' %}" alt="HKN Logo">
<p class="tagline">The Premier Engineering <br> Honor Society of UCSD</p>
</div>

<!-- Right Column -->
<div class="right-column">
<div id="logincard">
{% if error == "invalid" %}
<p>Invalid link, please check you have entered the url correctly.</p>
<p>If the issue persists, please contact an officer on our <a href=https://discord.gg/dX7xc73>discord server</a>.</p>
{% elif error == "form_closed" %}
<p>The form for this induction cycle has closed.</p>
{% else %}
<p>An unspecified error has occured.</p>
{% endif %}
<p><a href="{% url 'spa' %}">Back to home</a></p>
</div>
<img class="hknmascot" src="{% static 'hkn_mascot.png' %}" alt="HKN Mascot">
</div>
</div>
</body>
{% endblock content %}
4 changes: 2 additions & 2 deletions myapp/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ <h1>Welcome back!</h1>

<input type="submit" value="Sign in">

<p class="register-text">
Don't have an account? <a href="{% url 'register' %}">Sign up</a>
<p>
Don't have an account? <a href="{% url 'register' %}" class="register-text">Sign up</a>
</p>
</form>
</div>
Expand Down
Loading

0 comments on commit 8ced516

Please sign in to comment.