Skip to content

Commit

Permalink
Issue #206 Moved CSS to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
serag committed Apr 22, 2014
2 parents 15684be + 1bf44df commit 0c3e7f8
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 154 deletions.
29 changes: 29 additions & 0 deletions tutor/app/assets/javascripts/facebook.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# [Post to Facebook - Story 5.1]
# Opens popup window for the facebook popup
# Parameters:
# url: url to open in popup window
# popName: name of popup window
# Returns: none
# Author: Amir George

@openBackWindow = (url, popName) ->
popupWindow = window.open(url, popName, "scrollbars=1,height=1,width=1")
if $.browser.msie
popupWindow.blur()
window.focus()
else
blurPopunder()
return

# [Post to Facebook - Story 5.1]
# Helper for openBackWindow
# Parameters: none
# Returns: none
# Author: Amir George

blurPopunder = ->
winBlankPopup = window.open("about:blank")
if winBlankPopup
winBlankPopup.focus()
winBlankPopup.close()
return
48 changes: 48 additions & 0 deletions tutor/app/assets/stylesheets/lecturers.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*----- 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;
}
48 changes: 48 additions & 0 deletions tutor/app/assets/stylesheets/students.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*----- 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;
}
48 changes: 48 additions & 0 deletions tutor/app/assets/stylesheets/teaching_assistants.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*----- 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;
}
2 changes: 2 additions & 0 deletions tutor/app/controllers/facebook_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class FacebookController < ApplicationController
end
14 changes: 14 additions & 0 deletions tutor/app/models/acknowledgement.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Acknowledgement < ActiveRecord::Base

#validatesions

#Relations
belongs_to :student
belongs_to :course
belongs_to :lecturer

#Scoops

#Methods

end
1 change: 1 addition & 0 deletions tutor/app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Course < ActiveRecord::Base

has_one :discussion_board, dependent: :destroy
has_many :topics, dependent: :destroy
has_many :acknowledgements, dependent: :destroy

#Scoops

Expand Down
1 change: 1 addition & 0 deletions tutor/app/models/lecturer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Lecturer < ActiveRecord::Base
has_many :variable_constraints, as: :owner
has_many :test_cases, as: :owner
has_many :hints, as: :owner
has_many :acknowledgements, dependent: :destroy

#Scoops

Expand Down
2 changes: 2 additions & 0 deletions tutor/app/models/method_constraint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class MethodConstraint < ActiveRecord::Base
belongs_to :model_answer
belongs_to :owner, polymorphic: true

has_many :method_parameter, dependent: :destroy

#Scoops

#Methods
Expand Down
2 changes: 2 additions & 0 deletions tutor/app/models/method_parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class MethodParameter < ActiveRecord::Base

#Relations
belongs_to :model_answer
belongs_to :method_constarint

belongs_to :owner, polymorphic: true

#Scoops
Expand Down
1 change: 1 addition & 0 deletions tutor/app/models/student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Student < ActiveRecord::Base
has_many :progressions, class_name: "TrackProgression"
has_many :posts, as: :owner, dependent: :destroy
has_many :replies, as: :owner, dependent: :destroy
has_many :acknowledgements, dependent: :destroy

has_many :recommendations
has_many :recommended_problems, class_name: 'Problem', through: :recommendations, source: :problem
Expand Down
36 changes: 36 additions & 0 deletions tutor/app/views/facebook/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- [Post to Facebook - Story 5.1] -->
<!-- Facebook SDK for Javascript code to handle posting to facebook -->
<!-- Parameters: none -->
<!-- Returns: none -->
<!-- Author: Amir George -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '623954164351291',
status : true,
xfbml : true
});
FB.ui(
{
method: 'feed'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
window.close();
} else {
alert('Post was not published.');
window.close();
}
}
);
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
50 changes: 0 additions & 50 deletions tutor/app/views/lecturers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,54 +1,4 @@
<!DOCTYPE html>
<style type="text/css">
/*----- 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;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs .tab-links a').on('click', function(e) {
Expand Down
2 changes: 2 additions & 0 deletions tutor/app/views/problems/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<label><%= @topic.title %></label> /
<label><%= @track.title %></label>
<br /><br />
<div id="fb-root"></div>
<div class='problem'>
<label><%= @problem.title %></label><br/>
<%= @problem.description %>
<table width='100%'>
<tr>
<td width='80%'>
<% if student_signed_in? %>
<%=button_tag 'Ask Facebook', type: 'Button', id:'facebook', onClick: "openBackWindow('/facebook', 'Facebook')" %>
<% track_progess = TrackProgression.get_progress(current_student,
@problem.track.topic) %>
<% if track_progess >= @problem.track.difficulty %>
Expand Down
Loading

0 comments on commit 0c3e7f8

Please sign in to comment.