-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from alaashafaee/C5_Serag_206_Profile_5.8
Pull Request: C5_Serag_206_Profile_5.8
- Loading branch information
Showing
15 changed files
with
424 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$(document).ready(function() { | ||
$('.tabs .tab-links a').on('click', function(element) { | ||
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'); | ||
element.preventDefault(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$(document).ready(function() { | ||
$('.tabs .tab-links a').on('click', function(element) { | ||
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'); | ||
element.preventDefault(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$(document).ready(function() { | ||
$('.tabs .tab-links a').on('click', function(element) { | ||
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'); | ||
element.preventDefault(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class LecturersController < ApplicationController | ||
# [Profile - Story 5.8] | ||
# Displays the profile of the lecturer chosen | ||
# Parameters: | ||
# id: the Lecturer's id | ||
# Returns: none | ||
# Author: Serag | ||
def show | ||
@lecturer = Lecturer.find(params[:id]) | ||
@courses = @lecturer.courses.order("created_at desc") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class StudentsController < ApplicationController | ||
# [Profile - Story 5.8] | ||
# Displays the profile of the student chosen | ||
# Parameters: | ||
# id: the Student's id | ||
# Returns: none | ||
# Author: Serag | ||
def show | ||
@student = Student.find(params[:id]) | ||
@courses = @student.courses.order("created_at desc") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CoolSoft - Java Tutor</title> | ||
</head> | ||
<body> | ||
<h1> lecturers Index </h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<h1> | ||
<%= image_tag(@lecturer.profile_image_url.to_s) if @lecturer.profile_image? %> | ||
<%= @lecturer.name %>'s Profile | ||
</h1> | ||
<div class="tabs"> | ||
<ul class="tab-links"> | ||
<li class="active"><a href="#tab1">Course</a></li> | ||
<li><a href="#tab2">Info</a></li> | ||
</ul> | ||
<div class="tab-content"> | ||
<div id="tab1" class="tab active"> | ||
<table class = "table table-striped", style = "width:80%"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Code</th> | ||
<th>Options</th> | ||
<th></th> | ||
</tr> | ||
<% @courses.each do |course| %> | ||
<tr> | ||
<td> | ||
<%= link_to course.name, | ||
:controller => 'courses', | ||
:action => 'show', | ||
:id => course.id, :method => :get, | ||
class: "btn btn-success" %> | ||
</td> | ||
<td><%= course.code %></td> | ||
<% if current_lecturer %> | ||
<td> | ||
<%= link_to "Manage Course", | ||
{ | ||
:controller => 'courses', | ||
:action => 'edit', | ||
:method => :get, | ||
:id => course.id | ||
}, | ||
class: "btn btn-success", | ||
style: "text-decoration:none" %> | ||
</td> | ||
<% end %> | ||
<td> | ||
<%= link_to "Discussion Board", | ||
{ | ||
:controller => 'discussion_boards', | ||
:action => 'show', | ||
:id => course.id | ||
}, | ||
class: "btn btn-success", | ||
method: :get, | ||
style: "text-decoration:none" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
<div id="tab2" class="tab"> | ||
<p> <b>Name:</b> <%= @lecturer.name %> </p> | ||
<p> <b>Email:</b> <%= @lecturer.email %> </p> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CoolSoft - Java Tutor</title> | ||
</head> | ||
<body> | ||
<h1> students Index </h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<h1> | ||
<%= image_tag(@student.profile_image_url.to_s) if @student.profile_image? %> | ||
<%= @student.name %>'s Profile | ||
</h1> | ||
<div class="tabs"> | ||
<ul class="tab-links"> | ||
<li class="active"><a href="#tab1">Course</a></li> | ||
<li><a href="#tab2">Info</a></li> | ||
<li><a href="#tab3">Performance</a></li> | ||
</ul> | ||
<div class="tab-content"> | ||
<div id="tab1" class="tab active"> | ||
<table class = "table table-striped", style = "width:80%"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Code</th> | ||
<th>Options</th> | ||
<th></th> | ||
</tr> | ||
<% @courses.each do |course| %> | ||
<tr> | ||
<td> | ||
<%= link_to course.name, | ||
:controller => 'courses', | ||
:action => 'show', | ||
:id => course.id, | ||
:method => :get, | ||
class: "btn btn-success" %> | ||
</td> | ||
<td><%= course.code %></td> | ||
<% if current_lecturer %> | ||
<td> | ||
<%= link_to "Manage Course", | ||
{ | ||
:controller => 'courses', | ||
:action => 'edit', | ||
:method => :get, | ||
:id => course.id | ||
}, | ||
class: "btn btn-success", | ||
style: "text-decoration:none" %> | ||
</td> | ||
<% end %> | ||
<td> | ||
<%= link_to "Discussion Board", | ||
{ | ||
:controller => 'discussion_boards', | ||
:action => 'show', | ||
:id => course.id | ||
}, | ||
class: "btn btn-success", | ||
method: :get, | ||
style: "text-decoration:none" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> | ||
<div id="tab2" class="tab"> | ||
<p> <b>Name:</b> <%= @student.name %> </p> | ||
<p> <b>Email:</b> <%= @student.email %> </p> | ||
</div> | ||
<div id="tab3" class="tab"> | ||
<%= link_to "Statistics", | ||
{ | ||
:controller => 'students', | ||
:action => 'get_performance', | ||
:id => @student.id | ||
}, | ||
:method => :get, | ||
class: "btn btn-success" %> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.