# HG changeset patch # User Jittat Fakcharoenphol # Date 2014-12-27 18:24:34 # Node ID 0688baeb3e317ead5e11067166bb5c8230a31de1 # Parent fbebe9f8cc4b4addab3885d3272fd6a30e7655f6 # Parent 6d2e9920049d7282b765651e74c0f39f99ab6ce7 Merge pull request #11 from wytesk133/master Various fixes 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 @@ -192,7 +192,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/views/contest_management/index.html.haml b/app/views/contest_management/index.html.haml --- a/app/views/contest_management/index.html.haml +++ b/app/views/contest_management/index.html.haml @@ -11,18 +11,21 @@ .infobox %b Web interface mode: - - if (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) - standard mode + - if GraderConfiguration.analysis_mode? + Analysis Mode + - elsif (not GraderConfiguration.contest_mode?) and (not GraderConfiguration.indv_contest_mode?) + Standard Mode - elsif GraderConfiguration.contest_mode? - normal contest mode. + Normal Contest Mode - else - individual contest mode. + Individual Contest Mode %br/ Change mode to: - =raw "[#{link_to 'standard', :action => 'change_contest_mode', :id => 'standard'}]" - =raw "[#{link_to 'contest', :action => 'change_contest_mode', :id => 'contest'}]" - =raw "[#{link_to 'individual contest', :action => 'change_contest_mode', :id => 'indv-contest'}]" + =raw "[#{link_to 'Standard', :action => 'change_contest_mode', :id => 'standard'}]" + =raw "[#{link_to 'Contest', :action => 'change_contest_mode', :id => 'contest'}]" + =raw "[#{link_to 'Individual Contest', :action => 'change_contest_mode', :id => 'indv-contest'}]" + =raw "[#{link_to 'Analysis', :action => 'change_contest_mode', :id => 'analysis'}]" - if GraderConfiguration.indv_contest_mode? = render :partial => 'indv_contest_mode_index' diff --git a/app/views/graders/test_request.html.haml b/app/views/graders/test_request.html.haml --- a/app/views/graders/test_request.html.haml +++ b/app/views/graders/test_request.html.haml @@ -25,7 +25,7 @@ - if @test_request.compiler_message!=nil and @test_request.compiler_message!='' %b Compiler Message %div{:style => "border: 1px solid black; background: lightgrey"} - = simple_format(truncate((@test_request.compiler_message or ''),200)) + = simple_format(truncate((@test_request.compiler_message or ''), :length => 200)) %b Input (first 2kb) %div{:style => "border: 1px solid black; background: lightgrey"} diff --git a/app/views/main/confirm_contest_start.html.haml b/app/views/main/confirm_contest_start.html.haml --- a/app/views/main/confirm_contest_start.html.haml +++ b/app/views/main/confirm_contest_start.html.haml @@ -12,5 +12,5 @@ =t 'main.confirm_contest_start.timer_starts_after_click' - = form_tag :action => 'confirm_contest_start', :method => 'post' do + = form_tag :action => 'confirm_contest_start' do = submit_tag t('main.confirm_contest_start.start_button'), :confirm => t('main.confirm_contest_start.start_button_confirm')