Skip to content

Commit

Permalink
Issue #206 removed additional documentation, created .js files, remov…
Browse files Browse the repository at this point in the history
…ed empty index actions & removed extra spaces
  • Loading branch information
serag committed Apr 22, 2014
1 parent 0c3e7f8 commit 2bc159e
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 198 deletions.
13 changes: 13 additions & 0 deletions tutor/app/assets/javascripts/lecturers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(document).ready(function() {
$('.tabs .tab-links a').on('click', function(e) {
var currentAttrValue = $(this).attr('href');
// Show/Hide Tabs
$('.tabs ' + currentAttrValue).siblings().slideUp(400);
$('.tabs ' + currentAttrValue).delay(400).slideDown(400);
//or use fade
//$('.tabs ' + currentAttrValue).fadeIn(400).siblings().hide();
// Change/remove current tab to active
$(this).parent('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
});
13 changes: 13 additions & 0 deletions tutor/app/assets/javascripts/students.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(document).ready(function() {
$('.tabs .tab-links a').on('click', function(e) {
var currentAttrValue = $(this).attr('href');
// Show/Hide Tabs
$('.tabs ' + currentAttrValue).siblings().slideUp(400);
$('.tabs ' + currentAttrValue).delay(400).slideDown(400);
//or use fade
//$('.tabs ' + currentAttrValue).fadeIn(400).siblings().hide();
// Change/remove current tab to active
$(this).parent('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
});
13 changes: 13 additions & 0 deletions tutor/app/assets/javascripts/teaching_assistants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(document).ready(function() {
$('.tabs .tab-links a').on('click', function(e) {
var currentAttrValue = $(this).attr('href');
// Show/Hide Tabs
$('.tabs ' + currentAttrValue).siblings().slideUp(400);
$('.tabs ' + currentAttrValue).delay(400).slideDown(400);
//or use fade
//$('.tabs ' + currentAttrValue).fadeIn(400).siblings().hide();
// Change/remove current tab to active
$(this).parent('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
});
92 changes: 44 additions & 48 deletions tutor/app/assets/stylesheets/lecturers.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
/*----- Tabs -----*/
.tabs {
width:100%;
display:inline-block;
}
/*----- Tab Links -----*/
/* Clearfix */
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
/*----- Content of Tabs -----*/
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
.tabs {
width:100%;
display:inline-block;
}
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
92 changes: 44 additions & 48 deletions tutor/app/assets/stylesheets/students.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
/*----- Tabs -----*/
.tabs {
width:100%;
display:inline-block;
}
/*----- Tab Links -----*/
/* Clearfix */
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
/*----- Content of Tabs -----*/
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
.tabs {
width:100%;
display:inline-block;
}
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
92 changes: 44 additions & 48 deletions tutor/app/assets/stylesheets/teaching_assistants.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
/*----- Tabs -----*/
.tabs {
width:100%;
display:inline-block;
}
/*----- Tab Links -----*/
/* Clearfix */
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
/*----- Content of Tabs -----*/
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
.tabs {
width:100%;
display:inline-block;
}
.tab-links:after {
display:block;
clear:both;
content:'';
}
.tab-links li {
margin:0px 5px;
float:left;
list-style:none;
}
.tab-links a {
padding:9px 15px;
display:inline-block;
border-radius:3px 3px 0px 0px;
background:#7FB5DA;
font-size:16px;
font-weight:600;
color:#4c4c4c;
transition:all linear 0.15s;
}
.tab-links a:hover {
background:#a7cce5;
text-decoration:none;
}
li.active a, li.active a:hover {
background:#fff;
color:#4c4c4c;
}
.tab-content {
padding:15px;
border-radius:3px;
box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
background:#fff;
}
.tab {
display:none;
}
.tab.active {
display:block;
}
2 changes: 0 additions & 2 deletions tutor/app/controllers/lecturers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ def show
@lecturer = Lecturer.find(params[:id])
@courses = @lecturer.courses.order("created_at desc")
end
def index
end
end
2 changes: 0 additions & 2 deletions tutor/app/controllers/students_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ def show
@student = Student.find(params[:id])
@courses = @student.courses.order("created_at desc")
end
def index
end
end
2 changes: 0 additions & 2 deletions tutor/app/controllers/teaching_assistants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ def show
@teaching_assistant = TeachingAssistant.find(params[:id])
@courses = @teaching_assistant.courses.order("created_at desc")
end
def index
end
end
17 changes: 1 addition & 16 deletions tutor/app/views/lecturers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
<!DOCTYPE html>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs .tab-links a').on('click', function(e) {
var currentAttrValue = $(this).attr('href');
// Show/Hide Tabs
$('.tabs ' + currentAttrValue).siblings().slideUp(400);
$('.tabs ' + currentAttrValue).delay(400).slideDown(400);
//or use fade
//$('.tabs ' + currentAttrValue).fadeIn(400).siblings().hide();
// Change/remove current tab to active
$(this).parent('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
});
</script>
<html>
<head>
<title>CoolSoft - Java tutor | <%= @lecturer.id%>'s Profile</title>
Expand All @@ -32,7 +17,7 @@
</div>
<div id="tab2" class="tab">
<p> @lecturer.getStat() "to be reviewed" </p>
</div>
</div>
<div id="tab3" class="tab">
<table class = "table table-striped", style = "width:80%">
<tr>
Expand Down
Loading

0 comments on commit 2bc159e

Please sign in to comment.