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 | 273 | session[:current_problem_id] = problem.id |
|
274 | 274 | flash[:notice] = 'Incorrect solution.' |
|
275 | 275 | end |
|
276 | 276 | redirect_to :action => 'list' |
|
277 | 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 | 288 | protected |
|
280 | 289 | |
|
281 | 290 | def prepare_announcements(recent=nil) |
|
282 | 291 | if Configuration.show_tasks_to?(@user) |
|
283 | 292 | @announcements = Announcement.find_published(true) |
|
284 | 293 | else |
@@ -14,13 +14,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 | - .problem-list | |
|
20 | + .problem-list{:id => '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 | 24 | %h2 |
|
25 | 25 | Welcome to Code Jom |
|
26 | 26 | %br/ |
@@ -34,6 +34,9 | |||
|
34 | 34 | = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';" |
|
35 | 35 | Announcement.registerRefreshEventTimer(); |
|
36 | 36 | = render :partial => 'submission_timeouts' |
|
37 | 37 | CodejomTimeout.updateProblemMessages(); |
|
38 | 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