Skip to content

Commit

Permalink
Merge pull request #321 from alaashafaee/C5_Serag_206_Profile_5.8
Browse files Browse the repository at this point in the history
Pull Request: C5_Serag_206_Profile_5.8
  • Loading branch information
husseny committed Apr 24, 2014
2 parents 8b9c41f + aa06efb commit dd06856
Show file tree
Hide file tree
Showing 15 changed files with 424 additions and 2 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(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();
});
});
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(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();
});
});
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(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();
});
});
44 changes: 44 additions & 0 deletions tutor/app/assets/stylesheets/lecturers.css
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;
}
44 changes: 44 additions & 0 deletions tutor/app/assets/stylesheets/students.css
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;
}
44 changes: 44 additions & 0 deletions tutor/app/assets/stylesheets/teaching_assistants.css
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;
}
12 changes: 12 additions & 0 deletions tutor/app/controllers/lecturers_controller.rb
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
12 changes: 12 additions & 0 deletions tutor/app/controllers/students_controller.rb
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
11 changes: 10 additions & 1 deletion tutor/app/controllers/teaching_assistants_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
class TeachingAssistantsController < ApplicationController
# [Profile - Story 5.8]
# Displays the profile of the teaching assistant chosen
# Parameters:
# id: the Teaching Assistant's id
# Returns: none
# Author: Serag
def show
@teaching_assistant = TeachingAssistant.find(params[:id])
@courses = @teaching_assistant.courses.order("created_at desc")
end

# [Add TA - Story 1.4]
# this action renders the form and sets the value for checkbox
Expand Down Expand Up @@ -56,5 +66,4 @@ def index
@course = Course.find(params[:course_id])
@course_teaching_assistants = @course.TAs.order('name')
end

end
9 changes: 9 additions & 0 deletions tutor/app/views/lecturers/index.html.erb
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>
62 changes: 62 additions & 0 deletions tutor/app/views/lecturers/show.html.erb
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>
9 changes: 9 additions & 0 deletions tutor/app/views/students/index.html.erb
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>
74 changes: 74 additions & 0 deletions tutor/app/views/students/show.html.erb
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>
Loading

0 comments on commit dd06856

Please sign in to comment.