diff --git a/Gemfile b/Gemfile index e0c00ac..25dab9f 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,9 @@ gem 'mechanize' # Markdown gem 'redcarpet' +# Table sorting +gem 'jquery-tablesorter' + group :development, :test do gem 'pry', '0.9.12.2' gem 'pry-rails', '0.3.2' diff --git a/Gemfile.lock b/Gemfile.lock index 75a176e..2c770a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,8 @@ GEM jquery-rails (2.2.1) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) + jquery-tablesorter (1.10.10) + railties (>= 3.1, < 5) jquery-ui-rails (4.1.1) railties (>= 3.1.0) json (1.8.1) @@ -270,6 +272,7 @@ DEPENDENCIES factory_girl_rails (= 4.2.0) hirb (= 0.7.1) jquery-rails (= 2.2.1) + jquery-tablesorter jquery-ui-rails mechanize net-ldap diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9666b83..336a42b 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,6 +12,12 @@ // //= require jquery //= require jquery_ujs +//= require jquery-tablesorter //= require turbolinks //= require_tree . //= require jquery.ui.all + + +$(document).ready(function() { + $("#exams").tablesorter(); +}); \ No newline at end of file diff --git a/app/views/exams/course.html.erb b/app/views/exams/course.html.erb index eb48bab..2f8a50d 100644 --- a/app/views/exams/course.html.erb +++ b/app/views/exams/course.html.erb @@ -2,14 +2,16 @@
Semester | -Instructor | -Midterm 1 | -Midterm 2 | -Midterm 3 | -Final | -
---|---|---|---|---|---|
Semester | +Instructor | +Midterm 1 | +Midterm 2 | +Midterm 3 | +Final | +