Skip to content

Commit

Permalink
Update CourseRegistration.html
Browse files Browse the repository at this point in the history
  • Loading branch information
gsavitha authored Nov 4, 2017
1 parent 053324d commit c5a0bec
Showing 1 changed file with 127 additions and 10 deletions.
137 changes: 127 additions & 10 deletions students/templates/student/CourseRegistration.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
{% block content %}
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Course Registration</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<title>Course Registration</title>
<style type="text/css">
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
body
{
background-color:#FFF;

height: 100vh;
font-family: 'Open Sans';
font-size:2vh;
overflow-x:hidden;
Expand All @@ -25,35 +27,150 @@
.info-box
{
background-color:#DDD;
height:30vh;
height: :30vh;
}
</style>
@keyframes example {

from {
background-color:white;
}

to {
background-color: dodgerblue;
}

}
.anime {
animation-name: example;
animation-duration: 0.5s;
animation-timing-function: ease-out;
animation-fill-mode:both;
}
</style>
<div class="row">
<div class="col-md-8 col-md-offset-2" style="margin-top:10%">
<form action="/student/register/" method="post">
<!-- <div class="col-md-8">
<table class="table table-striped table-hover">
<tr>
<th width="5%">Sel</th>
<th>Course</th>
<th>Credits</th>
<th>Professor</th>
</tr>
<tr>
<td> <input type = "checkbox" class="list-group-item" value="Theory Of Computation" onchange="populate_data(this)"/></td>
<td>Theory Of Computation</td>
<td>4</td>
<td>Dr Viswanath</td>
</tr>
<tr>
<td> <input type = "checkbox" class="list-group-item" value="Concepts of DOTA" onchange="populate_data(this)"/></td>
<td>Concepts Of DOTA</td>
<td>2</td>
<td>Dr Navi Dendi</td>
</tr>
<tr>
<td> <input type = "checkbox" class="list-group-item" value="ITS" onchange="populate_data(this)"/></td>
<td>ITS</td>
<td>4</td>
<td>Dr Nagesh Kolgani</td>
</tr>
<tr>
<td> <input type = "checkbox" class="list-group-item" value="Introduction to DOTA" onchange="populate_data(this)"/></td>
<td>Introduction to DOTA</td>
<td>4</td>
<td>Dr Sajas Pandit</td>
</tr>
<tr>
<td> <input type = "checkbox" class="list-group-item" value="DOTA" onchange="populate_data(this)"/></td>
<td>DOTA</td>
<td>4</td>
<td>Dr Rajeev xSmart</td>
</tr>
</table>
<button class="btn button btn-primary">SUBMIT</button>
</div>-->
<div class="col-md-8" style="margin-top:10%">
<form action="/students/register/" method="post">
{% csrf_token %}
<table class="table table-striped table-hover">
<tr>

<th>Course</th>
<th>Credits</th>
<th>Professor</th>
<th width="8%">Sel</th>
</tr>
{% for course in courses %}
<tr>

<td> <input type="checkbox" class="list-group-item" value="{{course.course}}" name="{{course.course}}" onchange="populate_data(this)" {% if course.selected %}checked{% endif %} /></td>
<td>{{course.course}}</td>
<td>{{course.course.Course_Credits}}</td>
<td>{{course.faculty}}</td>
<td> <input type="checkbox" class="list-group-item" id="{{course.course.Course_ID}}" name="{{course.course.Course_ID}}" {% if course.selected %}checked{% endif %} /></td>

</tr>
{% endfor %}
</table>
<button class="btn button btn-primary submit" type="submit">SUBMIT</button>
</form>
</div>
</div>
<div class="col-md-4" style="margin-top:10%">
<table class="table table-striped table-hover" id="second_table">
<tr>
<th>Courses Selected</th>
</tr>
</table>
</div>
</div>
<script>
$(document).ready(function () {
var table2 = document.getElementById("second_table");
var count = 1;
var id = 1;
populate_data=function (element) {
if (element.checked) {
var row = table2.insertRow(count);
//row.fadeIn();
row.id =id;
var cell1 = row.insertCell(0);
cell1.innerHTML = element.value;
//row.hide();
$("#" + id).hide();
$("#" + id).delay(1000).fadeIn();
var course = $(element).closest("td").next();
var credits = course.closest("td").next();
var prof = credits.closest("td").next();
course.addClass("anime");
credits.addClass("anime").css("animation-delay", "0.5s");
prof.addClass("anime").css("animation-delay", "1s");
count += 1;
id += 1;
}
else {
for (i = 0; i < table2.rows.length; i++) {
if (table2.rows[i].cells[0].innerHTML == element.value) {
var course = $(element).closest("td").next();
var credits = course.closest("td").next();
var prof = credits.closest("td").next();
course.removeClass("anime");
credits.removeClass("anime");
prof.removeClass("anime");
$(table2.rows[i]).children('td, th').addClass("anime");
$(table2.rows[i]).children('td, th')
.animate({
padding: 0
}).wrapInner('<div />')
.children()
.slideUp(function () {
$(this).closest('tr').remove();
});
count-=1;
}
}
}

}
});
</script>
{% endblock %}

0 comments on commit c5a0bec

Please sign in to comment.