Description:
disabled unused actions from controllers, protected statuses display, more styling
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r241:ce50017c6bce - - 5 files changed: 12 inserted, 2 deleted
@@ -91,24 +91,27 | |||
|
91 | 91 | |
|
92 | 92 | def compiler_msg |
|
93 | 93 | @submission = Submission.find(params[:id]) |
|
94 | 94 | if @submission.user_id == session[:user_id] |
|
95 | 95 | render :action => 'compiler_msg', :layout => 'empty' |
|
96 | 96 | else |
|
97 | 97 | flash[:notice] = 'Error viewing source' |
|
98 | 98 | redirect_to :action => 'list' |
|
99 | 99 | end |
|
100 | 100 | end |
|
101 | 101 | |
|
102 | 102 | def submission |
|
103 | + # protect the action for Code Jom | |
|
104 | + redirect_to :action => 'list' | |
|
105 | + | |
|
103 | 106 | @user = User.find(session[:user_id]) |
|
104 | 107 | @problems = Problem.find_available_problems |
|
105 | 108 | if params[:id]==nil |
|
106 | 109 | @problem = nil |
|
107 | 110 | @submissions = nil |
|
108 | 111 | else |
|
109 | 112 | @problem = Problem.find_by_name(params[:id]) |
|
110 | 113 | if not @problem.available |
|
111 | 114 | redirect_to :action => 'list' |
|
112 | 115 | flash[:notice] = 'Error: submissions for that problem are not viewable.' |
|
113 | 116 | return |
|
114 | 117 | end |
@@ -1,14 +1,17 | |||
|
1 | 1 | class StatusesController < ApplicationController |
|
2 | 2 | |
|
3 | + # protect the statuses, for now | |
|
4 | + before_filter :admin_authorization | |
|
5 | + | |
|
3 | 6 | def index |
|
4 | 7 | problem_count = Problem.available_problem_count |
|
5 | 8 | |
|
6 | 9 | @dead_users = [] |
|
7 | 10 | @level_users = {} |
|
8 | 11 | @levels = (0..CODEJOM_MAX_ALIVE_LEVEL) |
|
9 | 12 | @levels.each { |l| @level_users[l] = [] } |
|
10 | 13 | User.find(:all).each do |user| |
|
11 | 14 | if user.codejom_status==nil |
|
12 | 15 | user.update_codejom_status |
|
13 | 16 | user.codejom_status(true) # reload |
|
14 | 17 | end |
@@ -1,14 +1,17 | |||
|
1 | 1 | class TestController < ApplicationController |
|
2 | 2 | |
|
3 | + # this page is unavailable in Code Jom | |
|
4 | + before_filter :admin_authorization | |
|
5 | + | |
|
3 | 6 | before_filter :authenticate, :check_viewability |
|
4 | 7 | |
|
5 | 8 | # |
|
6 | 9 | # COMMENT OUT: filter in each action instead |
|
7 | 10 | # |
|
8 | 11 | # before_filter :verify_time_limit, :only => [:submit] |
|
9 | 12 | |
|
10 | 13 | verify :method => :post, :only => [:submit], |
|
11 | 14 | :redirect_to => { :action => :index } |
|
12 | 15 | |
|
13 | 16 | def index |
|
14 | 17 | prepare_index_information |
@@ -1,8 +1,8 | |||
|
1 | 1 | .problem-bar{:id => "problem-bar-#{problem.id}"} |
|
2 | 2 | %a{:href => "#", :onclick => "$$('.problem-panel').each(function(elt) {elt.hide();}); $('problem-panel-#{problem.id}').show(); $('problem-panel-filler').hide(); return false;"} |
|
3 | 3 | %span{:class => 'problem-title'} |
|
4 |
- = "#{problem.full_name} |
|
|
4 | + = "#{problem.full_name}" | |
|
5 | 5 | - if @prob_submissions[problem_title_counter][:count] > 0 |
|
6 | 6 | = "[#{@prob_submissions[problem_title_counter][:count]} trials(s)]" |
|
7 | 7 | - else |
|
8 | 8 | [No trials] |
@@ -12,25 +12,26 | |||
|
12 | 12 | = render :partial => 'announcement', :collection => @announcements |
|
13 | 13 | |
|
14 | 14 | %hr/ |
|
15 | 15 | |
|
16 | 16 | - if (Configuration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true) |
|
17 | 17 | %p=t 'main.start_soon' |
|
18 | 18 | |
|
19 | 19 | - if Configuration.show_tasks_to?(@user) |
|
20 | 20 | .problem-list |
|
21 | 21 | = render :partial => 'problem_title', :collection => @problems, :as => :problem |
|
22 | 22 | .problem-content |
|
23 | 23 | %span{:id => "problem-panel-filler", :style => (@current_problem_id!=nil) ? "display:none" : ""} |
|
24 | - %b Welcome to Code Jom | |
|
24 | + %h2 | |
|
25 | + Welcome to Code Jom | |
|
25 | 26 | %br/ |
|
26 | 27 | Choose problems from the list on the right. |
|
27 | 28 | = render :partial => 'problem', :collection => @problems |
|
28 | 29 | |
|
29 | 30 | %br{:clear=>'both'}/ |
|
30 | 31 | %hr/ |
|
31 | 32 | |
|
32 | 33 | %script{:type => "text/javascript"} |
|
33 | 34 | Announcement.registerRefreshEventTimer(); |
|
34 | 35 | = render :partial => 'submission_timeouts' |
|
35 | 36 | CodejomTimeout.updateProblemMessages(); |
|
36 | 37 | CodejomTimeout.registerRefreshEvent(); |
You need to be logged in to leave comments.
Login now