diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.19' +gem 'rails', '3.2.21' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -10,13 +10,13 @@ # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' + gem 'sass-rails', '~> 3.2.6' + gem 'coffee-rails', '~> 3.2.2' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby - gem 'uglifier', '>= 1.0.3' + gem 'uglifier' end gem 'prototype-rails' @@ -49,15 +49,15 @@ #syntax highlighter gem 'rouge' -gem "haml" -gem "mail" -gem "rdiscount" -gem "test-unit" -gem 'will_paginate', '~> 3.0.0' +gem 'haml' +gem 'mail' +gem 'rdiscount' +gem 'test-unit' +gem 'will_paginate', '~> 3.0.7' gem 'dynamic_form' gem 'in_place_editing' -gem 'verification', :git => 'git://github.com/sikachu/verification.git' +gem 'verification', :git => 'https://github.com/sikachu/verification.git' group :test, :development do - gem "rspec-rails", "~> 2.0" + gem 'rspec-rails', '~> 2.99.0' end diff --git a/Gemfile.lock b/Gemfile.lock --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GIT - remote: git://github.com/sikachu/verification.git + remote: https://github.com/sikachu/verification.git revision: 76eaf51b13276ecae54bd9cd115832595d2ff56d specs: verification (1.0.3) @@ -9,12 +9,12 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.19) - actionpack (= 3.2.19) + actionmailer (3.2.21) + actionpack (= 3.2.21) mail (~> 2.5.4) - actionpack (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + actionpack (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -22,22 +22,22 @@ rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.19) - activesupport (= 3.2.19) + activemodel (3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) - activerecord (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + activerecord (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) - activesupport (3.2.19) + activeresource (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) + activesupport (3.2.21) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) arel (3.0.3) - best_in_place (3.0.2) + best_in_place (3.0.3) actionpack (>= 3.2) railties (>= 3.2) builder (3.0.4) @@ -47,21 +47,21 @@ coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.7.1) + coffee-script-source (1.9.0) diff-lcs (1.2.5) dynamic_form (1.1.4) erubis (2.7.0) - execjs (2.2.1) - haml (4.0.5) + execjs (2.3.0) + haml (4.0.6) tilt hike (1.2.3) - i18n (0.6.11) + i18n (0.7.0) in_place_editing (1.2.0) journey (1.0.4) - jquery-rails (3.1.1) + jquery-rails (3.1.2) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-tablesorter (1.12.7) + jquery-tablesorter (1.13.4) railties (>= 3.1, < 5) jquery-timepicker-addon-rails (1.4.1) railties (>= 3.1) @@ -72,15 +72,15 @@ jquery-rails jquery-ui-rails (= 4.0.3) railties (>= 3.1.0) - json (1.8.1) + json (1.8.2) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) multi_json (1.10.1) - mysql2 (0.3.16) + mysql2 (0.3.17) polyglot (0.3.5) - power_assert (0.1.3) + power_assert (0.2.2) prototype-rails (3.2.1) rails (~> 3.2) rack (1.4.5) @@ -88,34 +88,34 @@ rack (>= 0.4) rack-ssl (1.3.4) rack - rack-test (0.6.2) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.19) - actionmailer (= 3.2.19) - actionpack (= 3.2.19) - activerecord (= 3.2.19) - activeresource (= 3.2.19) - activesupport (= 3.2.19) + rails (3.2.21) + actionmailer (= 3.2.21) + actionpack (= 3.2.21) + activerecord (= 3.2.21) + activeresource (= 3.2.21) + activesupport (= 3.2.21) bundler (~> 1.0) - railties (= 3.2.19) - railties (3.2.19) - actionpack (= 3.2.19) - activesupport (= 3.2.19) + railties (= 3.2.21) + railties (3.2.21) + actionpack (= 3.2.21) + activesupport (= 3.2.21) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.3.2) - rdiscount (2.1.7.1) + rake (10.4.2) + rdiscount (2.1.8) rdoc (3.12.2) json (~> 1.4) - rouge (1.6.2) - rspec-collection_matchers (1.0.0) + rouge (1.8.0) + rspec-collection_matchers (1.1.2) rspec-expectations (>= 2.99.0.beta1) rspec-core (2.99.2) rspec-expectations (2.99.2) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.99.2) + rspec-mocks (2.99.3) rspec-rails (2.99.0) actionpack (>= 3.0) activemodel (>= 3.0) @@ -125,25 +125,25 @@ rspec-core (~> 2.99.0) rspec-expectations (~> 2.99.0) rspec-mocks (~> 2.99.0) - sass (3.4.1) + sass (3.4.11) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - sprockets (2.2.2) + sprockets (2.2.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - test-unit (3.0.1) + test-unit (3.0.9) power_assert thor (0.19.1) tilt (1.4.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.41) - uglifier (2.5.3) + tzinfo (0.3.43) + uglifier (2.7.0) execjs (>= 0.3.0) json (>= 1.8.0) will_paginate (3.0.7) @@ -153,7 +153,7 @@ DEPENDENCIES best_in_place (~> 3.0.1) - coffee-rails (~> 3.2.1) + coffee-rails (~> 3.2.2) dynamic_form haml in_place_editing @@ -164,12 +164,12 @@ mail mysql2 prototype-rails - rails (= 3.2.19) + rails (= 3.2.21) rdiscount rouge - rspec-rails (~> 2.0) - sass-rails (~> 3.2.3) + rspec-rails (~> 2.99.0) + sass-rails (~> 3.2.6) test-unit - uglifier (>= 1.0.3) + uglifier verification! - will_paginate (~> 3.0.0) + will_paginate (~> 3.0.7) diff --git a/app/controllers/contest_management_controller.rb b/app/controllers/contest_management_controller.rb --- a/app/controllers/contest_management_controller.rb +++ b/app/controllers/contest_management_controller.rb @@ -37,7 +37,7 @@ end def change_contest_mode - if ['standard', 'contest', 'indv-contest'].include? params[:id] + if ['standard', 'contest', 'indv-contest', 'analysis'].include? params[:id] config = GraderConfiguration.find_by_key('system.mode') config.value = params[:id] config.save diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -71,7 +71,7 @@ @submission.ip_address = request.remote_ip if GraderConfiguration.time_limit_mode? and user.contest_finished? - @submission.errors.add_to_base "The contest is over." + @submission.errors.add(:base,"The contest is over.") prepare_list_information render :action => 'list' and return end @@ -194,7 +194,7 @@ def confirm_contest_start user = User.find(session[:user_id]) - if request.method == :post + if request.method == 'POST' user.update_start_time redirect_to :action => 'list' else diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -31,20 +31,21 @@ user = User.find(session[:user_id]) @message = Message.new(params[:message]) @message.sender = user - if !@message.save - render :action => 'list' and return + if @message.body == '' or !@message.save + flash[:notice] = 'An error occurred' else flash[:notice] = 'New message posted' - redirect_to :action => 'list' end + redirect_to :action => 'list' end def reply user = User.find(session[:user_id]) @message = Message.new(params[:r_message]) @message.sender = user - if !@message.save - render :action => 'show' and return + if @message.body == '' or !@message.save + flash[:notice] = 'An error occurred' + redirect_to :action => 'show', :id => @message.replying_message_id else flash[:notice] = 'Message replied' rep_msg = @message.replying_message @@ -58,7 +59,7 @@ message = Message.find(params[:id]) message.replied = true message.save - flash[:notice] = 'Message hided (just marked replied)' + flash[:notice] = 'Message hidden (just marked replied)' redirect_to :action => 'console' end diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb --- a/app/controllers/test_controller.rb +++ b/app/controllers/test_controller.rb @@ -26,7 +26,7 @@ if GraderConfiguration.time_limit_mode? if @user.contest_finished? - @submitted_test_request.errors.add_to_base('Contest is over.') + @submitted_test_request.errors.add(:base,'Contest is over.') prepare_index_information render :action => 'index' and return end diff --git a/app/controllers/user_admin_controller.rb b/app/controllers/user_admin_controller.rb --- a/app/controllers/user_admin_controller.rb +++ b/app/controllers/user_admin_controller.rb @@ -2,7 +2,6 @@ class UserAdminController < ApplicationController - include MailHelperMethods before_filter :admin_authorization @@ -151,13 +150,6 @@ end @scorearray << ustat end - - if params[:commit] == 'download csv' then - csv = gen_csv_from_scorearray(@scorearray,@problems) - send_data csv, filename: 'last_score.csv' - else - render template: 'user_admin/user_stat' - end end def user_stat_max diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -63,7 +63,7 @@ render :action => 'email_error', :layout => 'empty' end else - @user.errors.add_to_base("Email cannot be blank") if @user.email=='' + @user.errors.add(:base,"Email cannot be blank") if @user.email=='' render :action => 'new', :layout => 'empty' end end @@ -154,7 +154,7 @@ :login => user.login, :password => user.password, :activation_url => activation_url, - :admin_email => admin_email + :admin_email => GraderConfiguration['system.admin_email'] }) logger.info mail_body @@ -170,7 +170,7 @@ :contest_name => contest_name, :login => user.login, :password => user.password, - :admin_email => admin_email + :admin_email => GraderConfiguration['system.admin_email'] }) logger.info mail_body diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -118,7 +118,7 @@
-<%= text_field 'user', 'email' %>
<%= text_field 'user', 'alias' %>