Skip to content
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/success.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 24 additions & 126 deletions carpool/templates/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@
<link href="{% static 'css/font-awesome.min.css' %}" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" type="image/ico" href="{% static 'img/favicon.ico' %}"/>


<style>
img {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this in styles.css.

display: block;
margin-left: auto;
margin-right: auto;
}
</style>

</head>

Expand Down Expand Up @@ -89,6 +96,22 @@ <h2>Add new ride</h2>

</div><!-- end .col-lg-12 -->

<div class="messages">
<font align = "center">
{% if messages %}
<img src = "{% static "images/success.gif" %}">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image is quite large and doesn't disappear automatically. Can you hide it after some time using jquery or just js?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use a smaller image.


{% for message in messages %}

<div class="alert alert-success"> {{ message }} </div>

{% endfor %}

{% endif %}
</font>
</div>


<div class="col-sm-12 col-md-12 col-xs-12 add-rideclass">

<div class="page-content add-new-ride">
Expand All @@ -112,42 +135,6 @@ <h2>Add new ride</h2>
<div class="field buttons">
<button type="submit" class="btn btn-lg green-color">Submit</button>
</div>
<!-- <div class="field">
<select id="destination" name="destination">
<option value="default">From</option>
<option>Mandi</option>
<option>South Campus</option>
<option>North Campus</option>
</select>
</div>

<div class="field">
<select id="destinationd" name="destinationd">
<option value="default">To</option>
<option>Mandi</option>
<option>South Campus</option>
<option>North Campus</option>
</select>
</div>

<div class="field">
<input name="event" type="text" placeholder="Date" class="datepicker">
</div>

<div class="field">
<select id="destination" name="destination">
<option value="default">Number of seats</option>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>

<div class="field">
<input type="number" id="text" name="text" placeholder="Amount">
</div> -->


</form>

</div><!-- end .page-content -->
Expand Down Expand Up @@ -177,95 +164,6 @@ <h2>Add new ride</h2>

</footer><!-- end #footer -->

<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">

<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div><!-- end .modal-header -->

<div class="modal-body">
<form action="" novalidate autocomplete="off" class="idealforms login">

<div class="log-header">
<span class="log-in">Log in</span>
</div>

<div class="field">
<input name="username" type="text" placeholder="Username">
<span class="error"></span>
</div>

<div class="field">
<input type="password" name="password" placeholder="Password">
<span class="error"></span>
</div>

<div class="field buttons">
<button type="submit" class="submit btn green-color">Log in</button>
</div>

<a href="#" class="log-twitter twitter"><i class="fa fa-twitter"></i>Twitter</a>
<a href="#" class="log-facebook facebook"><i class="fa fa-facebook"></i>Facebook</a>

<div class="clearfix"></div>

</form><!-- end .login -->
</div><!-- end .modal-body -->

</div><!-- end .modal-content -->
</div><!-- end .modal-dialog -->
</div><!-- end .modal -->

<div class="modal fade" id="regModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">

<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>

<div class="modal-body">
<form action="" novalidate autocomplete="off" class="idealforms reg">

<div class="log-header">
<span class="log-in">Sign up</span>
</div>

<div class="field">
<input name="username" type="text" placeholder="Username">
<span class="error"></span>
</div>

<div class="field">
<input name="email" type="email" placeholder="E-Mail">
<span class="error"></span>
</div>

<div class="field">
<input type="password" name="password" placeholder="Password">
<span class="error"></span>
</div>

<div class="field">
<input name="confirmpass" type="password" placeholder="Password">
<span class="error"></span>
</div>

<div class="field buttons">
<button type="submit" class="submit btn green-color">Sign up</button>
</div>

<div class="clearfix"></div>

</form><!-- end .reg -->
</div><!-- end .modal-body -->

</div><!-- end .modal-content -->
</div><!-- end .modal-dialog -->
</div><!-- end .modal -->

<!-- Javascript -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Bootstrap -->
Expand Down
2 changes: 2 additions & 0 deletions carpool/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.contrib.sites.shortcuts import get_current_site
from django.conf import settings
from .tokens import account_activation_token
from django.contrib import messages
import datetime

from .forms import SignUpForm, PoolForm, filterForm, DeleteForm, AddForm
Expand Down Expand Up @@ -127,6 +128,7 @@ def addPool(request):
form = PoolForm(request.POST, initial={'paid': False, 'user': request.user})
if form.is_valid():
form.save()
messages.success(request,'Ride added successfully')
Comment thread
Varunvaruns9 marked this conversation as resolved.
else:
form = PoolForm(initial={'paid': False, 'user': request.user})
return render(request, 'add.html', {'form': form})
Expand Down