Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I add alert msg on add new ride form #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added carpool/static/images/iitmandiLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 114 additions & 2 deletions carpool/templates/acc_active_email.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,117 @@
{% autoescape off %}
<!---{% autoescape off %}
Hi {{ user.first_name }},
Please click on the link below to confirm your registration for Car Pool app IIT Mandi,
http://{{ domain }}{% url 'activate' uidb64=uid token=token %}
{% endautoescape %}
{% endautoescape %} --->

<!-------------my code start from here ----------------->

<!DOCTYPE html>
{% load static %}
<html>

<head>
<title>Account Confirmation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

</style>
<style type="text/css">


body,
table,
td,
a {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}


table {
border-collapse: collapse !important;

}

body {
height: 100% !important;
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
}
</style>

</head>

<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%" >
<!-- LOGO -->
<tr>
<td bgcolor="#DAF7A6" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
<tr>
<td align="center" valign="top" style="padding: 40px 10px 40px 10px;"><img src="{% static 'images/iitmandiLogo.png' %}" alt="" width="100" ><h1 style="font-size: 25px; font-style:inherit; font-weight: 500; margin: 1; color: rgb(0, 0, 0); ">CAR-POOL</h1> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#DAF7A6" align="center" style="padding: 0px 10px 0px 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
<tr>
<td bgcolor="#ffffff" align="center" valign="top" style="padding: 40px 20px 20px 20px; border-radius: 4px 4px 0px 0px; color: #111111; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 48px; font-weight: 400; letter-spacing: 4px; line-height: 48px;">
<h1 style="font-size: 18px; font-weight: 400; margin: 1; ">Hi{{ user.first_name }} </h1>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#DAF7A6" align="center" style="padding: 0px 10px 0px 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
<tr>
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 40px 30px; color: #666666; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;">
<p style="margin: 0; text-align: left;">Thank You for registering in car-pool. We're excited to have you get started</p>
<br>
<p style="margin: 0; text-align: left;">Please click on the link below to confirm your registration for Car Pool app IIT Mandi.</p>
</td>
</tr>


<tr>
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 20px 30px; color: #666666; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;">
<p style="margin: 0; text-align: center;"><a href="#" target="_blank" style="color: #e83bfffd;">http://{{ domain }}{% url 'activate' uidb64=uid token=token %} </a></p>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="left" style="padding: 0px 30px 20px 30px; color: #666666; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;">
<p style="margin: 0;">If you have any questions, just reply to this email—we're always happy to help out.</p>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="left" style="padding: 0px 30px 40px 30px; border-radius: 0px 0px 4px 4px; color: #666666; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;">
<p style="margin: 0;">Cheers,<br>Kamandprompt Team</p>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td bgcolor="#DAF7A6" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
<tr>
<td align="center" valign="top" style="padding: 40px 10px 40px 10px;"> </td>
</tr>
</table>
</td>
</tr>

</table>


</body>

</html>
2 changes: 1 addition & 1 deletion carpool/templates/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h2>Add new ride</h2>
<div class="col-sm-12 col-md-12 col-xs-12 add-rideclass">

<div class="page-content add-new-ride">

{% include 'messages.html' %}
<form method="post">
{% csrf_token %}
{% for field in form %}
Expand Down
10 changes: 10 additions & 0 deletions carpool/templates/messages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible alert-success">
<button type="button" class="close" data-dismiss="alert">
×
</button>
<strong>{{message}}<strong>
</div>
{% endfor %}
{% endif %}
8 changes: 7 additions & 1 deletion carpool/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .forms import SignUpForm, PoolForm, filterForm, DeleteForm, AddForm
from .models import Pool, User

from django.contrib import messages

def IITmail(request):
s = request.POST['email']
Expand Down Expand Up @@ -127,6 +127,10 @@ def addPool(request):
form = PoolForm(request.POST, initial={'paid': False, 'user': request.user})
if form.is_valid():
form.save()
messages.success(request, 'form submitted successfully.')
return render(request, 'add.html', {'form': form})
else:
messages.error(request, 'Invalid form submission.')
else:
form = PoolForm(initial={'paid': False, 'user': request.user})
return render(request, 'add.html', {'form': form})
Expand All @@ -147,3 +151,5 @@ def activate(request, uidb64, token):
return HttpResponse('Thank you for your email confirmation. Now you can login your account.')
else:
return HttpResponse('Activation link is invalid!')