Description:
added problem list auto update
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r257:76846842a151 - - 3 files changed: 14 inserted, 2 deleted
@@ -273,12 +273,21 | |||||
|
273 | session[:current_problem_id] = problem.id |
|
273 | session[:current_problem_id] = problem.id |
|
274 | flash[:notice] = 'Incorrect solution.' |
|
274 | flash[:notice] = 'Incorrect solution.' |
|
275 | end |
|
275 | end |
|
276 | redirect_to :action => 'list' |
|
276 | redirect_to :action => 'list' |
|
277 | end |
|
277 | end |
|
278 |
|
278 | ||
|
|
279 | + def problems | ||
|
|
280 | + prepare_list_information | ||
|
|
281 | + render :partial => 'problem_title', :collection => @problems, :as => :problem | ||
|
|
282 | + end | ||
|
|
283 | + | ||
|
|
284 | + def splash | ||
|
|
285 | + render :text => '<div class="notice">Most recent task:</span>' | ||
|
|
286 | + end | ||
|
|
287 | + | ||
|
279 | protected |
|
288 | protected |
|
280 |
|
289 | ||
|
281 | def prepare_announcements(recent=nil) |
|
290 | def prepare_announcements(recent=nil) |
|
282 | if Configuration.show_tasks_to?(@user) |
|
291 | if Configuration.show_tasks_to?(@user) |
|
283 | @announcements = Announcement.find_published(true) |
|
292 | @announcements = Announcement.find_published(true) |
|
284 | else |
|
293 | else |
@@ -14,13 +14,13 | |||||
|
14 | %hr/ |
|
14 | %hr/ |
|
15 |
|
15 | ||
|
16 | - if (Configuration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true) |
|
16 | - if (Configuration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true) |
|
17 | %p=t 'main.start_soon' |
|
17 | %p=t 'main.start_soon' |
|
18 |
|
18 | ||
|
19 | - if Configuration.show_tasks_to?(@user) |
|
19 | - if Configuration.show_tasks_to?(@user) |
|
20 | - .problem-list |
|
20 | + .problem-list{:id => 'problem-list'} |
|
21 | = render :partial => 'problem_title', :collection => @problems, :as => :problem |
|
21 | = render :partial => 'problem_title', :collection => @problems, :as => :problem |
|
22 | .problem-content |
|
22 | .problem-content |
|
23 | %span{:id => "problem-panel-filler", :style => (@current_problem_id!=nil) ? "display:none" : ""} |
|
23 | %span{:id => "problem-panel-filler", :style => (@current_problem_id!=nil) ? "display:none" : ""} |
|
24 | %h2 |
|
24 | %h2 |
|
25 | Welcome to Code Jom |
|
25 | Welcome to Code Jom |
|
26 | %br/ |
|
26 | %br/ |
@@ -34,6 +34,9 | |||||
|
34 | = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';" |
|
34 | = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';" |
|
35 | Announcement.registerRefreshEventTimer(); |
|
35 | Announcement.registerRefreshEventTimer(); |
|
36 | = render :partial => 'submission_timeouts' |
|
36 | = render :partial => 'submission_timeouts' |
|
37 | CodejomTimeout.updateProblemMessages(); |
|
37 | CodejomTimeout.updateProblemMessages(); |
|
38 | CodejomTimeout.registerRefreshEvent(); |
|
38 | CodejomTimeout.registerRefreshEvent(); |
|
39 |
|
39 | ||
|
|
40 | + = periodically_call_remote(:url => { :action => 'problems' }, :update => 'problem-list') | ||
|
|
41 | + | ||
|
|
42 | + |
You need to be logged in to leave comments.
Login now