Skip to content

Commit

Permalink
Minor fixes (#56)
Browse files Browse the repository at this point in the history
Minor fixes

Co-authored-by: muditabaid <[email protected]>
  • Loading branch information
singh-shreya321 and muditabaid authored May 27, 2020
1 parent 203fefd commit c69940e
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 24 deletions.
7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main():
return render_template('main.html', name=prof, website=website, data=tb, times=times, profs=profs, dept=dept, error=False)
else:
tb_predefined, times_predefined = get_predefined()
return render_template('main.html', profs=profs, times=times_predefined, data=tb_predefined)
return render_template('main.html', profs=profs, times=times_predefined, data=tb_predefined)

@app.route('/ics_helper')
def ics_helper():
Expand All @@ -77,6 +77,11 @@ def ics_helper():
def func():
return download_ics_file(my_events)

@app.route('/landing', methods=['GET'])
def landing():
return render_template('landing.html')


if __name__ == '__main__':

port = int(os.environ.get("PORT", 5000))
Expand Down
Binary file modified static/favicon.ico
Binary file not shown.
Binary file added static/favicon.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/logo.png
Binary file not shown.
22 changes: 12 additions & 10 deletions static/mainScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ function clearTT() {
$('#' + i.toString() + j.toString()).removeClass('table-danger');
$('#' + i.toString() + j.toString()).removeClass('table-clash');
$('#' + i.toString() + j.toString()).html('');
$('#9' + i.toString() + j.toString()).html(":");
}
}
clearSelected();
$('#details-div').html("");
}


function getTimeTable(){
var timetable = [];
var todaysDate = new Date();
Expand Down Expand Up @@ -80,18 +82,18 @@ function addToCalendar(){
type: 'post',
contentType: 'application/json',
dataType: 'text',
data: timetable
data: timetable
}).done(function(result){
console.log(result);
var url = '/download_helper';
window.location = url;
}).fail(function(jqXHR, textStatus, errorThrown){
console.log(timetable)
console.warn(jqXHR.responseText)
console.log("fail: ", textStatus, errorThrown);
});
console.log("fail: ", textStatus, errorThrown);
});

};
};

function sdCallback(data, id, course, clear_var) {
if(clear_var == 0){
Expand All @@ -113,7 +115,7 @@ function sdCallback(data, id, course, clear_var) {
$('#' + courseData['Slot'][slot]).removeClass('table-danger');
$('#' + courseData['Slot'][slot]).addClass('table-clash');
}
var temp_list = ($('#' + '9' + courseData['Slot'][slot]).html().split(":"));
var temp_list = ($('#' + '9' + courseData['Slot'][slot]).html().split(":"));
var cnt = parseInt(temp_list[0]);
cnt = cnt + 1
temp_list[0] = cnt
Expand Down Expand Up @@ -182,13 +184,13 @@ function sdCallback(data, id, course, clear_var) {
if($('#' + courseData['Slot'][slot]).hasClass('table-danger')){
if((data['Name'].split(':')[0].toString().localeCompare($('#' + courseData['Slot'][slot]).html().toString())) == 0) {
$('#' + courseData['Slot'][slot]).removeClass('table-danger');
$('#' + courseData['Slot'][slot]).removeClass('border border-danger');
$('#' + courseData['Slot'][slot]).removeClass('border border-danger');
$('#' + courseData['Slot'][slot]).html("")
$('#9' + courseData['Slot'][slot]).html(":")
}
}
else if($('#' + courseData['Slot'][slot]).hasClass('table-clash')){
var temp_list = ($('#' + '9' + courseData['Slot'][slot]).html().split(":"));
var temp_list = ($('#' + '9' + courseData['Slot'][slot]).html().split(":"));
var cnt = parseInt(temp_list[0]);
cnt = cnt - 1;
console.log(cnt)
Expand All @@ -201,13 +203,13 @@ function sdCallback(data, id, course, clear_var) {
temp_list[0] = cnt
if(cnt == 1){
$('#' + courseData['Slot'][slot]).removeClass('table-clash');
$('#' + courseData['Slot'][slot]).addClass('table-danger');
$('#' + courseData['Slot'][slot]).addClass('table-danger');
}
$('#' + courseData['Slot'][slot]).html(temp_list[1])
$('#9' + courseData['Slot'][slot]).html(temp_list.join(":"))
}
}
$('#details-div').html("");
$('#details-div').html("");
}
else {
$('#details-div').html("");
Expand Down Expand Up @@ -389,4 +391,4 @@ function readICS() {

reader.readAsText(file);
}
}
}
23 changes: 18 additions & 5 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<html>

<head>
<title>what-slot-iiitb</title>
<title>IIIT-B Time Table</title>

<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<!-- <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> -->
<link rel="shortcut icon" href="../static/favicon.jpeg" />

<!-- BOOTSTRAP -->

Expand Down Expand Up @@ -32,6 +33,7 @@
<script src="https://cdn.jsdelivr.net/npm/simplebar@latest/dist/simplebar.min.js"></script>
<script type="text/javascript" src="https://addevent.com/libs/atc/1.6.1/atc.min.js" async defer></script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body>
Expand All @@ -44,11 +46,22 @@
<img src="{{ url_for('static', filename='iiitb_logo.png') }}" alt="IIIT-B">
</div>
<div class="logo">
<a href="/"><h2>Home</h2></a>
<h1> Student Time Table</h1>
</div>
<div class="logo">
<!-- <div class="logo"> -->
<!-- <a href="/landing"><i class="fa fa-home"></i><h2>Home</h2></a> -->
<button class="button2"><i class="fa fa-home"></i><a href="/landing" style="text-decoration:none; color:#000000"><span> Home</span></a></button>
<!-- <button class="button2" onclick="clickFun()"><i class="fa fa-home"></i> Home</button>
<script>
clickFun() {
window.location.assign("/landing")
}
</script> -->
<!-- <a href="/landing"><h2>Home</h2></a> -->
<!-- </div> -->
<!-- <div class="logo">
<a href="/professor"><h2>Faculty</h2> </a>
</div>
</div> -->
</nav>

<div class="timetable">
Expand Down
117 changes: 117 additions & 0 deletions templates/landing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
<meta charset="UTF-8">
<title>IIIT-B Time Table</title>
<style>
.link
{
color:white;
text-decoration: none;
background-color: none;
}
</style>
<link rel="shortcut icon" href="../static/favicon.jpeg" />

<!-- <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> -->
<meta name="title" content="The International Institute of Information Technology Bangalore"/>
<meta name="keywords" content="The International Institute of Information Technology Bangalore, IIITB, IIITBangalore"/>
<meta name="description" content="The International Institute of Information Technology Bangalore"/>
<!-- <base href="https://www.iiitb.ac.in/"/> -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- <link rel="shortcut icon" href="https://www.iiitb.ac.in/includes/images/favicon.ico"/> -->
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/icons.min.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/basic-frame.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/style.css?v=279.15">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/homeBanner.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/responsive.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/owl.carousel.min.css">
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/color.css" title="color" />
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/list-landing.css?v=279.15" />
<link rel="stylesheet" href="https://www.iiitb.ac.in/includes/css/liMarquee.css?v=1.1"/>
<script src="https://www.iiitb.ac.in/includes/js/jquery.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-160599818-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-160599818-1');
</script>
</head>
<body>
<main>

<header class="style3 stick">
<div class="lg-mnu-sec2">
<div class="container">
<div class="logo"><a href="https://www.iiitb.ac.in/" title="IIITB TimeTable"><img src="https://www.iiitb.ac.in/includefiles/settings/iiitb_logo100x95.png" alt="IIIT Bangalore"></a></div><!-- Logo -->
</div>
</div>
</header>


<!-- full image top-->
<div class="container-fluid full-screen" style="height:320px;">
<div class="row slider-fade" style="height:320px;">
<div class="home-banners owl-carousel owl-theme width-100" style="height:320px;">
<div class="text-center item bg-img" data-overlay-dark="5" data-background="https://www.iiitb.ac.in/includefiles/banners/iiitb-bangalore3.jpg" style="height:320px;">
</div>
</div>
</div>
</div>



<section>
<div class="gap">
<div class="container">
<div class="col-md-12 offset-md-0 sec-tl text-center">
<h2 itemprop="headline">IIIT-B Time Table</h2>
</div>
<div class="stories-wrap remove-ext3 stories">
<div class="row">
<div class="MultiCarousel" data-items="1,2" data-slide="1" id="MultiCarousel" data-interval="1000">
<div class="MultiCarousel-inner">
<div class="item">
<div class="story-box3" style="background-color:#015483">

<div class="story-info3" style="background-color:#015483">
<h3><a href="/">
<div class="link">
Students
</div>
</a></h3>
</div>
</div>
</div>
<div class="item" >
<div class="story-box3" style="background-color:#015483">

<div class="story-info3" style="background-color:#015483">
<h3 ><a href="/professor">
<div class="link">
Faculty
</div>
</a></h3>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>


<script src="https://www.iiitb.ac.in/includes/js/owl.carousel.min.js"></script>
<script src="https://www.iiitb.ac.in/includes/js/custom-scripts.js?v=279.15"></script><!--full screen -->
<script src="https://www.iiitb.ac.in/includes/js/jquery.liMarquee.js"></script>
<script src="https://www.iiitb.ac.in/includes/javascripts/index.js?v=279.15"></script><!--background image-->
</body>
</html>
39 changes: 31 additions & 8 deletions templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
background-color: lightgray;
}
</style>
<title>Find Your Professor</title>
<title>IIIT-B Time Table</title>

<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<!-- <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> -->
<link rel="shortcut icon" href="../static/favicon.jpeg" />

<!-- BOOTSTRAP -->

Expand All @@ -32,14 +33,15 @@
<!-- GOOGLE FONTS -->

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simplebar@latest/dist/simplebar.css">
<script src="https://cdn.jsdelivr.net/npm/simplebar@latest/dist/simplebar.min.js"></script>

<script type="text/javascript" src="https://addevent.com/libs/atc/1.6.1/atc.min.js" async defer></script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
</head>
<body>
Expand All @@ -50,11 +52,16 @@
<img src="{{ url_for('static', filename='iiitb_logo.png') }}" alt="IIIT-B">
</div>
<div class="logo">
<a href="/"><h2>Home</h2></a>
<h1> Faculty Time Table</h1>
</div>
<div class="logo">
<!-- <div class="logo"> -->
<button class="button2"><i class="fa fa-home"></i><a href="/landing" style="text-decoration:none; color:#000000"><span> Home</span></a></button>

<!-- <a href="/landing"><h2>Home</h2></a> -->
<!-- </div> -->
<!-- <div class="logo">
<a href="/professor"><h2>Faculty</h2> </a>
</div>
</div> -->
</nav>
<div class="timetable">
{% if not error %}
Expand Down Expand Up @@ -82,7 +89,7 @@
{% for venue in col %}
<div class="venue">
{{ venue }}


</div>
{% endfor %}
Expand Down Expand Up @@ -166,9 +173,25 @@ <h2>Professor Not Found!</h2>
<footer>
<div class="row">
<form action = "/ics_helper">
<button class='button2'><span>Download as ics</span></button>
<button class="button2"><span>Download as ics</span></button>
<div title="Add to Calendar" class="addeventatc">
Add to Calendar
<span class="start">06/03/2020 02:00 PM</span>
<span class="end">06/03/2020 03:30 PM</span>
<span class="timezone">India</span>
<span class="title">History of Ideas</span>
<span class="location">MCR106</span>

</div>
</form>


</div>
<!-- <div class="row">
<div title="Add to Calendar" class="addeventatc">
Add to Calendar
</div>
</div> -->
<div id="details-div">
<b> Name : </b> {{ name }} </br> <b> Dept: </b> {{ dept }}

Expand Down

0 comments on commit c69940e

Please sign in to comment.