diff --git a/tutor/app/assets/javascripts/facebook.js.coffee b/tutor/app/assets/javascripts/facebook.js.coffee new file mode 100644 index 00000000..e8e9af1d --- /dev/null +++ b/tutor/app/assets/javascripts/facebook.js.coffee @@ -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 diff --git a/tutor/app/assets/stylesheets/lecturers.css b/tutor/app/assets/stylesheets/lecturers.css new file mode 100644 index 00000000..07a48df6 --- /dev/null +++ b/tutor/app/assets/stylesheets/lecturers.css @@ -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; + } \ No newline at end of file diff --git a/tutor/app/assets/stylesheets/students.css b/tutor/app/assets/stylesheets/students.css new file mode 100644 index 00000000..07a48df6 --- /dev/null +++ b/tutor/app/assets/stylesheets/students.css @@ -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; + } \ No newline at end of file diff --git a/tutor/app/assets/stylesheets/teaching_assistants.css b/tutor/app/assets/stylesheets/teaching_assistants.css new file mode 100644 index 00000000..07a48df6 --- /dev/null +++ b/tutor/app/assets/stylesheets/teaching_assistants.css @@ -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; + } \ No newline at end of file diff --git a/tutor/app/controllers/facebook_controller.rb b/tutor/app/controllers/facebook_controller.rb new file mode 100644 index 00000000..809bba26 --- /dev/null +++ b/tutor/app/controllers/facebook_controller.rb @@ -0,0 +1,2 @@ +class FacebookController < ApplicationController +end diff --git a/tutor/app/models/acknowledgement.rb b/tutor/app/models/acknowledgement.rb new file mode 100644 index 00000000..b8560d8a --- /dev/null +++ b/tutor/app/models/acknowledgement.rb @@ -0,0 +1,14 @@ +class Acknowledgement < ActiveRecord::Base + + #validatesions + + #Relations + belongs_to :student + belongs_to :course + belongs_to :lecturer + + #Scoops + + #Methods + +end diff --git a/tutor/app/models/course.rb b/tutor/app/models/course.rb index 9018ee55..908d59ed 100644 --- a/tutor/app/models/course.rb +++ b/tutor/app/models/course.rb @@ -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 diff --git a/tutor/app/models/lecturer.rb b/tutor/app/models/lecturer.rb index 4a0775fe..a9ba664d 100644 --- a/tutor/app/models/lecturer.rb +++ b/tutor/app/models/lecturer.rb @@ -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 diff --git a/tutor/app/models/method_constraint.rb b/tutor/app/models/method_constraint.rb index d7edcef7..f13ce249 100644 --- a/tutor/app/models/method_constraint.rb +++ b/tutor/app/models/method_constraint.rb @@ -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 diff --git a/tutor/app/models/method_parameter.rb b/tutor/app/models/method_parameter.rb index 7a5673dc..d4175e79 100644 --- a/tutor/app/models/method_parameter.rb +++ b/tutor/app/models/method_parameter.rb @@ -4,6 +4,8 @@ class MethodParameter < ActiveRecord::Base #Relations belongs_to :model_answer + belongs_to :method_constarint + belongs_to :owner, polymorphic: true #Scoops diff --git a/tutor/app/models/student.rb b/tutor/app/models/student.rb index 72116f09..622d04b0 100644 --- a/tutor/app/models/student.rb +++ b/tutor/app/models/student.rb @@ -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 diff --git a/tutor/app/views/facebook/index.html.erb b/tutor/app/views/facebook/index.html.erb new file mode 100644 index 00000000..e5b8606f --- /dev/null +++ b/tutor/app/views/facebook/index.html.erb @@ -0,0 +1,36 @@ + + + + + +
+ diff --git a/tutor/app/views/lecturers/show.html.erb b/tutor/app/views/lecturers/show.html.erb index eea32b1b..43ab78f3 100644 --- a/tutor/app/views/lecturers/show.html.erb +++ b/tutor/app/views/lecturers/show.html.erb @@ -1,54 +1,4 @@ -