Skip to content

Commit

Permalink
Merge pull request MNNIT-Robotics-Club-Official#139 from Lalit1471/main
Browse files Browse the repository at this point in the history
Email Confirmation Response now renders html page
  • Loading branch information
DuP-491 authored Jan 28, 2022
2 parents 9974097 + d0c1462 commit d82e636
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
Binary file added static/img/error_temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/svg_temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions templates/email_invalid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}
Email Confirmation page
{% endblock %}

{% block head %}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
{% endblock %}

{% block body %}
<div class="flex items-center justify-center min-h-screen p-5 bg-white min-w-screen">
<div class="max-w-xl p-8 text-center text-gray-800 bg-gray-200 shadow-xl lg:max-w-3xl rounded-3xl lg:p-12">
<div class="flex justify-center">
<img src="{% static 'img/error_temp.png' %}" width="100" alt="Link is invalid!">
</div>
<br><h3 class="text-2xl">Activation link is invalid!</h3>

</div>
</div>
{% endblock %}
25 changes: 25 additions & 0 deletions templates/email_response.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}
Email Confirmation page
{% endblock %}

{% block head %}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
{% endblock %}

{% block body %}
<div class="flex items-center justify-center min-h-screen p-5 bg-white min-w-screen">
<div class="max-w-xl p-8 text-center text-gray-800 bg-gray-200 shadow-xl lg:max-w-3xl rounded-3xl lg:p-12">
<h3 class="text-2xl color-white">Your email has been confirmed!</h3><br>
<div class="flex justify-center">
<img src="{% static 'img/svg_temp.png' %}" width="100" alt="Your Email has been verified!">
</div><br>
<p>Now you can login to your account!</p><br>
<a href="{% url 'user:login_page' %}" class=" my-1.5 px-1.5 py-1.5 text-white bg-red-500 rounded">Back to Login page</a>
</div>
</div>
{% endblock %}
4 changes: 2 additions & 2 deletions user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,6 @@ def activate(request, uidb64, token):
if user is not None and default_token_generator.check_token(user, token):
user.is_active = True
user.save()
return HttpResponse('Thank you for your email confirmation. Now you can login your account.')
return render(request,'email_response.html')
else:
return HttpResponse('Activation link is invalid!')
return render(request,'email_invalid.html')

0 comments on commit d82e636

Please sign in to comment.