Skip to content
This repository has been archived by the owner on Dec 10, 2017. It is now read-only.

Add exam sorting #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
18 changes: 10 additions & 8 deletions app/views/exams/course.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

<div id="table">
<table id="exams" class="table">
<tr>
<th>Semester</th>
<th>Instructor</th>
<th>Midterm 1</th>
<th>Midterm 2</th>
<th>Midterm 3</th>
<th>Final</th>
</tr>
<thead>
<tr>
<th>Semester</th>
<th>Instructor</th>
<th>Midterm 1</th>
<th>Midterm 2</th>
<th>Midterm 3</th>
<th>Final</th>
</tr>
</thead>
<%- @results.each do |semester, instructor, exams, solutions| -%>
<tr>
<td>
Expand Down