diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -97,6 +97,15 @@ redirect_to :action => 'list' end + def turn_all_on + Problem.find(:all, + :conditions => "available = 0").each do |problem| + problem.available = true + problem.save + end + redirect_to :action => 'list' + end + def stat @problem = Problem.find(params[:id]) if !@problem.available diff --git a/app/views/problems/list.rhtml b/app/views/problems/list.rhtml --- a/app/views/problems/list.rhtml +++ b/app/views/problems/list.rhtml @@ -6,8 +6,11 @@

Listing problems

+

<%= link_to 'New problem', :action => 'new' %> -<%= link_to 'Turn off all problems', :action => 'turn_all_off' %>
+<%= link_to 'Turn off all problems', :action => 'turn_all_off' %> +<%= link_to 'Turn on all problems', :action => 'turn_all_on' %> +

diff --git a/app/views/test/_test_request.html.haml b/app/views/test/_test_request.html.haml --- a/app/views/test/_test_request.html.haml +++ b/app/views/test/_test_request.html.haml @@ -1,7 +1,11 @@ %tr{:class => (test_request_counter%2==0) ? "info-even" : "info-odd"} %td{:align => "center"} = format_short_time(test_request.submitted_at) - %td= test_request.problem.full_name + %td + - if test_request.problem!=nil + = test_request.problem.full_name + - else + (n/a) %td{:align => "center"} = test_request.submission.number %td{:align => "center"} diff --git a/app/views/test/result.html.haml b/app/views/test/result.html.haml --- a/app/views/test/result.html.haml +++ b/app/views/test/result.html.haml @@ -1,7 +1,11 @@ = user_title_bar(@user) %div{:style => "text-align: center; font-size: 12px"} - = "Problem: #{@test_request.problem.full_name}" + Problem: + - if @test_request.problem!=nil + = "#{@test_request.problem.full_name}" + - else + = "(n/a)" %br/ = "Submission: #{@test_request.submission.number}" %br/ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -165,7 +165,7 @@ margin-top: 10px; margin-bottom: 10px; background: green; - padding: 2px; + padding: 1px; } div.announcementbox span.title { @@ -177,17 +177,17 @@ div.announcement { margin: 2px; background: white; - padding: 2px; + padding: 1px; padding-left: 10px; padding-right: 10px; } div.announcement p { - font-size: 13px; + font-size: 12px; } div.pub-info, div.pub-info p { text-align: right; font-style: italic; - font-size: 10px; -} \ No newline at end of file + font-size: 9px; +}