aboutsummaryrefslogtreecommitdiff
path: root/blog
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-07-30 01:56:15 +0530
committerBobby <[email protected]>2022-07-30 01:56:15 +0530
commite27296b279aa0df54881bfbb0d4b7d892fdb22b9 (patch)
tree6915c30235d98c30ed4efa75bdec2ea756fe7479 /blog
parenta52e5ee79eddcfef37139434c619cc4f3f6cb521 (diff)
downloadthatcomputerscientist-e27296b279aa0df54881bfbb0d4b7d892fdb22b9.tar.xz
thatcomputerscientist-e27296b279aa0df54881bfbb0d4b7d892fdb22b9.zip
user verification email required for login
Diffstat (limited to 'blog')
-rw-r--r--blog/static/css/main.css1
-rw-r--r--blog/templates/partials/sidebar.html30
2 files changed, 21 insertions, 10 deletions
diff --git a/blog/static/css/main.css b/blog/static/css/main.css
index a6a3e42b..cf534be3 100644
--- a/blog/static/css/main.css
+++ b/blog/static/css/main.css
@@ -20,6 +20,7 @@ body {
overflow-y: auto;
border: 1px solid #191919;
min-width: 15rem;
+ max-width: 15rem;
}
.main {
diff --git a/blog/templates/partials/sidebar.html b/blog/templates/partials/sidebar.html
index 36984977..259d70b6 100644
--- a/blog/templates/partials/sidebar.html
+++ b/blog/templates/partials/sidebar.html
@@ -10,21 +10,29 @@
<button type="submit" onclick="location.href='{% url 'users:logout' %}'">Logout</button>
</div>
{% else %}
- <form method="post" action="{% url 'users:login' %} ">
- {% csrf_token %}
- <fieldset>
- <legend>Login Area</legend>
+ <fieldset>
+ <legend>Login Area</legend>
+ <form method="post" action="{% url 'users:login' %} ">
+ {% csrf_token %}
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Username" autocomplete="off">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Password">
- {% for message in messages %}
- <p class="{{message.tags}}">{{ message }}</p>
- {% endfor %}
<input type="hidden" name="next" value="{{ request.path }}">
<input type="submit" value="Login">
- </fieldset>
- </form>
+ </form>
+ {% for message in messages %}
+ {% if message.message == "EVERR" %}
+ <form method="post" action="{% url 'users:sendverificationemail' %}" >
+ <p class="{{message.tags}}">
+ Your email is unverified. Please check your inbox for a verification email or to request a new verification email by clicking{% csrf_token %}<input type="hidden" name="username"><input style="display: inline; background: none; border: none; color: blue; text-decoration: underline; cursor: pointer; margin: 0;" type="submit" value="here.">
+ </p>
+ </form>
+ {% else %}
+ <p class="{{message.tags}}">{{message.message}}</p>
+ {% endif %}
+ {% endfor %}
+ </fieldset>
{% endif %}
<br>
<fieldset>
@@ -53,6 +61,8 @@
var username = new URLSearchParams(window.location.search).get('username');
// if the username parameter is not empty, set the username input to the value of the username parameter
if (username) {
- document.getElementById('username').value = username;
+ document.getElementsByName("username").forEach(function(input) {
+ input.value = username;
+ });
}
</script>