Description:
still upgrading
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r753:9918c6e0c313 - - 6 files changed: 15 inserted, 6 deleted

@@ -66,14 +66,14
66 66 @problem = Problem.find(params[:id])
67 67 @description = @problem.description
68 68 if @description.nil? and params[:description][:body]!=''
69 - @description = Description.new(params[:description])
69 + @description = Description.new(description_params)
70 70 if !@description.save
71 71 flash[:notice] = 'Error saving description'
72 72 render :action => 'edit' and return
73 73 end
74 74 @problem.description = @description
75 75 elsif @description
76 - if !@description.update_attributes(params[:description])
76 + if !@description.update_attributes(description_params)
77 77 flash[:notice] = 'Error saving description'
78 78 render :action => 'edit' and return
79 79 end
@@ -301,4 +301,8
301 301 params.require(:problem).permit(:name, :full_name, :full_score, :change_date_added, :date_added, :available, :test_allowed,:output_only, :url, :description, tag_ids:[])
302 302 end
303 303
304 + def description_params
305 + params.require(:description).permit(:body, :markdown)
304 306 end
307 +
308 + end
@@ -27,7 +27,7
27 27 belongs_to :site
28 28 belongs_to :country
29 29
30 - has_and_belongs_to_many :contests, -> { order(:name); uniq}
30 + has_and_belongs_to_many :contests, -> { order(:name)}
31 31
32 32 scope :activated_users, -> {where activated: true}
33 33
@@ -173,7 +173,7
173 173 return false if site==nil
174 174 return site.finished?
175 175 elsif GraderConfiguration.indv_contest_mode?
176 - return false if self.contest_stat(true)==nil
176 + return false if self.contest_stat==nil
177 177 return contest_time_left == 0
178 178 else
179 179 return false
@@ -8,7 +8,8
8 8 - if @problem and @problem.errors
9 9 =error_messages_for 'problem'
10 10
11 - = form_tag({:action => 'do_import'}, :multipart => true) do
11 + = simple_form_for :problem, url: do_import_problems_path, :multipart => true do |f|
12 +
12 13 .submitbox
13 14 %table
14 15 %tr
@@ -1,6 +1,6
1 1 %h1 Maximum score
2 2
3 - = form_tag report_show_max_score_path
3 + = form_tag show_max_score_report_path
4 4 .row
5 5 .col-md-4
6 6 .panel.panel-primary
@@ -51,6 +51,7
51 51 %h2 Console
52 52 %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20}
53 53
54 + - if @submission
54 55 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
55 56 .modal-dialog.modal-lg{role:'document'}
56 57 .modal-content
@@ -40,6 +40,7
40 40 get 'manage'
41 41 get 'quick_create'
42 42 post 'do_manage'
43 + post 'do_import'
43 44 end
44 45 end
45 46
@@ -81,6 +82,7
81 82 get 'download'
82 83 get 'compiler_msg'
83 84 get 'rejudge'
85 + get 'source'
84 86 end
85 87 collection do
86 88 get 'prob/:problem_id', to: 'submissions#index', as: 'problem'
@@ -115,6 +117,7
115 117 get 'user_stat'
116 118 get 'clear_stat'
117 119 get 'clear_all_stat'
120 + get 'change_contest_mode'
118 121 end
119 122 end
120 123
You need to be logged in to leave comments. Login now