Description:
change login box fix add user, delete user
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r679:043258f318f9 - - 11 files changed: 47 inserted, 30 deleted

@@ -0,0 +1,7
1 + %h1 New user
2 + = form_tag( {action: 'create'}, { class: 'form-horizontal'}) do
3 + = render :partial => 'form'
4 + .form-group
5 + .col-md-offset-2.col-md-10
6 + = submit_tag "Create", class: 'btn btn-primary'
7 + = link_to 'Back', :action => 'index'
@@ -165,384 +165,390
165 165 background-color: $bgHighlight;
166 166 }
167 167 }
168 168 }
169 169 }
170 170
171 171 .secondnavbar {
172 172 top: 50px;
173 173 }
174 174
175 175 // --------------- bootstrap file upload ----------------------
176 176 .btn-file {
177 177 position: relative;
178 178 overflow: hidden;
179 179 }
180 180
181 181 .btn-file input[type=file] {
182 182 position: absolute;
183 183 top: 0;
184 184 right: 0;
185 185 min-width: 100%;
186 186 min-height: 100%;
187 187 font-size: 100px;
188 188 text-align: right;
189 189 filter: alpha(opacity = 0);
190 190 opacity: 0;
191 191 outline: none;
192 192 background: white;
193 193 cursor: inherit;
194 194 display: block;
195 195 }
196 196
197 197 body {
198 198 background: white image-url("topbg.jpg") repeat-x top center;
199 199
200 200 //font-size: 13px
201 201 //font-family: Tahoma, "sans-serif"
202 202 margin: 10px;
203 203 padding: 10px;
204 204 padding-top: 60px;
205 205 }
206 206
207 207 // ------------------ bootstrap sortable --------------------
208 208 table.sortable th {
209 209 padding-right: 20px !important;
210 210
211 211 span.sign {
212 212 right: (-15px) !important;
213 213 }
214 214
215 215 &.text-right {
216 216 padding-left: 20px !important;
217 217 padding-right: 8px !important;
218 218
219 219 &:after, span.sign {
220 220 left: (-15px) !important;
221 221 }
222 222 }
223 223 }
224 224
225 225 input {
226 226 font-family: Tahoma, "sans-serif";
227 227 }
228 228
229 229 h1 {
230 230 font-size: 24px;
231 231 color: #334488;
232 232 line-height: 2em;
233 233 }
234 234
235 235 h2 {
236 236 font-size: 18px;
237 237 color: #5566bb;
238 238 line-height: 1.5em;
239 239 }
240 240
241 241 hr {
242 242 border-top: 1px solid #dddddd;
243 243 border-bottom: 1px solid #eeeeee;
244 244 }
245 245
246 246 //#a
247 247 // color: #6666cc
248 248 // text-decoration: none
249 249 //
250 250 // &:link, &:visited
251 251 // color: #6666cc
252 252 // text-decoration: none
253 253 //
254 254 // &:hover, &:focus
255 255 // color: #111166
256 256 // text-decoration: none
257 257
258 258 div {
259 259 &.userbar {
260 260 line-height: 1.5em;
261 261 text-align: right;
262 262 font-size: 12px;
263 263 }
264 264
265 265 &.title {
266 266 padding: 10px 0px;
267 267 line-height: 1.5em;
268 268 font-size: 13px;
269 269
270 270 span.contest-over-msg {
271 271 font-size: 15px;
272 272 color: red;
273 273 }
274 274
275 275 table {
276 276 width: 100%;
277 277 font-weight: bold;
278 278 }
279 279
280 280 td {
281 281 &.left-col {
282 282 text-align: left;
283 283 vertical-align: top;
284 284 color: #444444;
285 285 }
286 286
287 287 &.right-col {
288 288 text-align: right;
289 289 vertical-align: top;
290 290 font-size: 18px;
291 291 color: #116699;
292 292 }
293 293 }
294 294 }
295 295 }
296 296
297 297 table.info {
298 298 margin: 10px 0;
299 299 border: 1px solid #666666;
300 300 border-collapse: collapse;
301 301 font-size: 12px;
302 302
303 303 th {
304 304 border: 1px solid #666666;
305 305 line-height: 1.5em;
306 306 padding: 0 0.5em;
307 307 }
308 308
309 309 td {
310 310 border-left: 1px solid #666666;
311 311 border-right: 1px solid #666666;
312 312 line-height: 1.5em;
313 313 padding: 0 0.5em;
314 314 }
315 315 }
316 316
317 317 tr {
318 318 &.info-head {
319 319 background: #777777;
320 320 color: white;
321 321 }
322 322
323 323 &.info-odd {
324 324 background: #eeeeee;
325 325 }
326 326
327 327 &.info-even {
328 328 background: #fcfcfc;
329 329 }
330 330 }
331 331
332 332 @mixin basicbox {
333 333 background: #eeeeff;
334 334 border: 1px dotted #99aaee;
335 335 padding: 5px;
336 336 margin: 10px 0px;
337 337 color: black;
338 338 font-size: 13px;
339 339 }
340 340
341 341 .infobox {
342 342 @include basicbox;
343 343 }
344 344
345 345 .submitbox {
346 346 @include basicbox;
347 347 }
348 348
349 349 .errorExplanation {
350 350 border: 1px dotted gray;
351 351 color: #bb2222;
352 352 padding: 5px 15px 5px 15px;
353 353 margin-bottom: 5px;
354 354 background-color: white;
355 355 font-weight: normal;
356 356
357 357 h2 {
358 358 color: #cc1111;
359 359 font-weight: bold;
360 360 }
361 361 }
362 362
363 363 table.uinfo {
364 364 border-collapse: collapse;
365 365 border: 1px solid black;
366 366 font-size: 13px;
367 367 }
368 368
369 369 td.uinfo {
370 370 vertical-align: top;
371 371 border: 1px solid black;
372 372 padding: 5px;
373 373 }
374 374
375 375 th.uinfo {
376 376 background: lightgreen;
377 377 vertical-align: top;
378 378 text-align: right;
379 379 border: 1px solid black;
380 380 padding: 5px;
381 381 }
382 382
383 383 div {
384 384 &.compilermsgbody {
385 385 font-family: monospace;
386 386 }
387 387
388 388 &.task-menu {
389 389 text-align: center;
390 390 font-size: 13px;
391 391 line-height: 1.75em;
392 392 font-weight: bold;
393 393 border-top: 1px dashed gray;
394 394 border-bottom: 1px dashed gray;
395 395 margin-top: 2px;
396 396 margin-bottom: 4px;
397 397 }
398 398 }
399 399
400 400 table.taskdesc {
401 401 border: 2px solid #dddddd;
402 402 border-collapse: collapse;
403 403 margin: 10px auto;
404 404 width: 90%;
405 405 font-size: 13px;
406 406
407 407 p {
408 408 font-size: 13px;
409 409 }
410 410
411 411 tr.name {
412 412 border: 2px solid #dddddd;
413 413 background: #dddddd;
414 414 color: #333333;
415 415 font-weight: bold;
416 416 font-size: 14px;
417 417 line-height: 1.5em;
418 418 text-align: center;
419 419 }
420 420
421 421 td {
422 422 &.desc-odd {
423 423 padding: 5px;
424 424 padding-left: 20px;
425 425 background: #fefeee;
426 426 }
427 427
428 428 &.desc-even {
429 429 padding: 5px;
430 430 padding-left: 20px;
431 431 background: #feeefe;
432 432 }
433 433 }
434 434 }
435 435
436 436 .announcementbox {
437 437 margin: 10px 0px;
438 438 background: #bbddee;
439 439 padding: 1px;
440 440
441 441 span.title {
442 442 font-weight: bold;
443 443 color: #224455;
444 444 padding-left: 10px;
445 445 line-height: 1.6em;
446 446 }
447 447 }
448 448
449 449 .announcement {
450 450 margin: 2px;
451 451 background: white;
452 452 padding: 1px;
453 453 padding-left: 10px;
454 454 padding-right: 10px;
455 455 padding-top: 5px;
456 456 padding-bottom: 5px;
457 457 }
458 458
459 459 .announcement p {
460 460 font-size: 12px;
461 461 margin: 2px;
462 462 }
463 463
464 464 .pub-info {
465 465 text-align: right;
466 466 font-style: italic;
467 467 font-size: 9px;
468 468
469 469 p {
470 470 text-align: right;
471 471 font-style: italic;
472 472 font-size: 9px;
473 473 }
474 474 }
475 475
476 476 .announcement {
477 477 .toggles {
478 478 font-weight: normal;
479 479 float: right;
480 480 font-size: 80%;
481 481 }
482 482
483 483 .announcement-title {
484 484 font-weight: bold;
485 485 }
486 486 }
487 487
488 488 div {
489 489 &.message {
490 490 margin: 10px 0 0;
491 491
492 492 div {
493 493 &.message {
494 494 margin: 0 0 0 30px;
495 495 }
496 496
497 497 &.body {
498 498 border: 2px solid #dddddd;
499 499 background: #fff8f8;
500 500 padding-left: 5px;
501 501 }
502 502
503 503 &.reply-body {
504 504 border: 2px solid #bbbbbb;
505 505 background: #fffff8;
506 506 padding-left: 5px;
507 507 }
508 508
509 509 &.stat {
510 510 font-size: 10px;
511 511 line-height: 1.75em;
512 512 padding: 0 5px;
513 513 color: #333333;
514 514 background: #dddddd;
515 515 font-weight: bold;
516 516 }
517 517
518 518 &.message div.stat {
519 519 font-size: 10px;
520 520 line-height: 1.75em;
521 521 padding: 0 5px;
522 522 color: #444444;
523 523 background: #bbbbbb;
524 524 font-weight: bold;
525 525 }
526 526 }
527 527 }
528 528
529 529 &.contest-title {
530 530 color: white;
531 531 text-align: center;
532 532 line-height: 2em;
533 533 }
534 534
535 535 &.registration-desc, &.test-desc {
536 536 border: 1px dotted gray;
537 537 background: #f5f5f5;
538 538 padding: 5px;
539 539 margin: 10px 0;
540 540 font-size: 12px;
541 541 line-height: 1.5em;
542 542 }
543 543 }
544 544
545 545 h2.contest-title {
546 546 margin-top: 5px;
547 547 margin-bottom: 5px;
548 548 }
549 +
550 +
551 +
552 + .grader-comment {
553 + word-wrap: break-word;
554 + }
@@ -1,37 +1,37
1 1 <p>
2 2 <b>Author:</b>
3 3 <%=h @announcement.author %>
4 4 </p>
5 5
6 6 <p>
7 7 <b>Title:</b>
8 8 <%=h @announcement.title %>
9 9 </p>
10 10
11 11 <p>
12 12 <b>Notes:</b>
13 13 <%=h @announcement.notes %>
14 14 </p>
15 15
16 16 <p>
17 17 <b>Body:</b>
18 - <%=h @announcement.body %>
18 + <%=h markdown(@announcement.body) %>
19 19 </p>
20 20
21 21 <p>
22 22 <b>Published:</b>
23 23 <%=h @announcement.published %>
24 24 </p>
25 25
26 26 <p>
27 27 <b>Show on front page:</b>
28 28 <%=h @announcement.frontpage %>
29 29 </p>
30 30
31 31 <p>
32 32 <b>Show only in contest:</b>
33 33 <%=h @announcement.contest_only %>
34 34 </p>
35 35
36 36 <%= link_to 'Edit', edit_announcement_path(@announcement) %> |
37 37 <%= link_to 'Back', announcements_path %>
@@ -1,39 +1,43
1 1 %b= GraderConfiguration['ui.front.welcome_message']
2 2 %br/
3 3
4 4 - if !@hidelogin
5 5 =t 'login.message'
6 6 %br/
7 7 %br/
8 8
9 9 - if flash[:notice]
10 10 %hr/
11 11 %b= flash[:notice]
12 12 %hr/
13 13
14 14 %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"}
15 - = form_tag login_login_path do
16 - %table
17 - %tr
18 - %td{:align => "right"}
19 - ="#{t 'login_label'}:"
20 - %td= text_field_tag 'login'
21 - %tr
22 - %td{:align => "right"}
23 - ="#{t 'password_label'}:"
24 - %td= password_field_tag
15 + = form_tag login_login_path, {class: 'form-horizontal'} do
16 + .form-group
17 + =label_tag :login, "Login",class: 'col-sm-3 control-label'
18 + .col-sm-9
19 + =text_field_tag :login, nil, class: 'form-control'
20 + .form-group
21 + =label_tag :password, "Password", class: 'col-sm-3 control-label'
22 + .col-sm-9
23 + =password_field_tag :password, nil, class: 'form-control'
25 24 - unless GraderConfiguration['right.bypass_agreement']
26 - %tr
27 - %td{:align => "right"}= check_box_tag 'accept_agree'
28 - %td ยอมรับข้อตกลงการใช้งาน
25 + .form-group
26 + .col-sm-offset-3.col-sm-9
27 + .checkbox
28 + %label
29 + = check_box_tag 'accept_agree'
30 + ยอมรับข้อตกลงการใช้งาน
29 31
30 - = submit_tag t('login.login_submit')
32 + .form-group
33 + .col-sm-offset-3.col-sm-9
34 + = submit_tag t('login.login_submit'), class: 'btn btn-primary'
31 35 %br/
32 36
33 37 - if GraderConfiguration['system.online_registration']
34 38 =t 'login.participation'
35 39 %b
36 40 = "#{t 'login.please'} "
37 41 = link_to "#{t 'login.register'}", :controller => :users, :action => :new
38 42 %br/
39 43 = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget
@@ -1,22 +1,22
1 1 %tr
2 2 %td
3 3 - if @current_user and @current_user.admin?
4 4 = link_to problem.name, stat_problem_path(problem)
5 5 - else
6 6 = "#{problem.name}"
7 7 %td
8 8 = "#{problem.full_name}"
9 9
10 10 %br
11 11 = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem
12 12 %td
13 13 = @prob_submissions[problem.id][:count]
14 - = link_to "[subs]", main_submission_path(problem.id)
14 + -#= link_to "[subs]", main_submission_path(problem.id)
15 15 %td
16 16 = render :partial => 'submission_short',
17 17 :locals => {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id }
18 18 %td
19 19 - if @prob_submissions[problem.id][:submission]
20 20 = link_to 'Edit', edit_submission_path(@prob_submissions[problem.id][:submission]), class: 'btn btn-success'
21 21 - else
22 22 = link_to 'New', direct_edit_problem_submissions_path(problem.id), class: 'btn btn-success'
@@ -1,29 +1,29
1 1
2 2 - if submission.nil?
3 3 = "-"
4 4 - else
5 5 - unless submission.graded_at
6 6 = t 'main.submitted_at'
7 7 = format_short_time(submission.submitted_at.localtime)
8 8 - else
9 9 %strong= t 'main.graded_at'
10 10 = "#{format_short_time(submission.graded_at.localtime)} "
11 11 %br
12 12 - if GraderConfiguration['ui.show_score']
13 13 %strong=t 'main.score'
14 14 = "#{(submission.points*100/submission.problem.full_score).to_i} "
15 15 = " ["
16 - %tt
16 + %tt.grader-comment
17 17 = submission.grader_comment
18 18 = "]"
19 19 %br
20 20 %strong View:
21 21 - if GraderConfiguration.show_grading_result
22 22 = link_to '[detailed result]', :action => 'result', :id => submission.id
23 23 /= link_to "#{t 'main.cmp_msg'}", {:action => 'compiler_msg', :id => submission.id}, {popup: true,class: 'btn btn-xs btn-info'}
24 24 = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission.id), {popup: true,remote: true,class: 'btn btn-xs btn-info'}
25 25 = link_to "#{t 'main.src_link'}",{:action => 'source', :id => submission.id}, class: 'btn btn-xs btn-info'
26 26 = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info'
27 27 - if GraderConfiguration.show_testcase
28 28 = link_to "testcases", show_problem_testcases_path(problem_id), class: 'btn btn-xs btn-info'
29 29
@@ -1,12 +1,11
1 1 %h1= GraderConfiguration['ui.front.title']
2 2
3 - %table
4 - %tr
5 - %td
3 + .row
4 + .col-md-6
6 5 - if @announcements.length!=0
7 6 .announcementbox{:style => 'margin-top: 0px'}
8 7 %span{:class => 'title'}
9 8 Announcements
10 9 = render :partial => 'announcement', :collection => @announcements
11 - %td{:style => 'vertical-align: top; width: 40%; padding-left: 20px;'}
10 + .col-md-4{style: "padding-left: 20px;"}
12 11 = render :partial => 'login_box'
@@ -1,31 +1,38
1 1 = error_messages_for 'user'
2 2 / [form:user]
3 3 .form-group
4 4 %label.col-md-2.control-label{for: :login} Login
5 5 .col-md-4
6 6 = text_field 'user', 'login', class: 'form-control'
7 + .col-md-6
7 8 .form-group
8 9 %label.col-md-2.control-label{for: :full_name} Full name
9 10 .col-md-4
10 11 = text_field 'user', 'full_name', class: 'form-control'
12 + .col-md-6
11 13 .form-group
12 14 %label.col-md-2.control-label{for: :password} Password
13 15 .col-md-4
14 16 = password_field 'user', 'password', class: 'form-control'
17 + .col-md-6
15 18 .form-group
16 19 %label.col-md-2.control-label{for: :password_confirmation} Password (confirm)
17 20 .col-md-4
18 21 = password_field 'user', 'password_confirmation', class: 'form-control'
22 + .col-md-6
19 23 .form-group
20 24 %label.col-md-2.control-label{for: :email} E-mail
21 25 .col-md-4
22 26 = email_field 'user', 'email', class: 'form-control'
27 + .col-md-6
23 28 .form-group
24 29 %label.col-md-2.control-label{for: :alias} Alias
25 30 .col-md-4
26 31 = text_field 'user', 'alias', class: 'form-control'
32 + .col-md-6
27 33 .form-group
28 34 %label.col-md-2.control-label{for: :remark} Remark
29 35 .col-md-4
30 36 = text_field 'user', 'remark', class: 'form-control'
37 + .col-md-6
31 38 / [eoform:user]
@@ -1,101 +1,101
1 1 %h1 Listing users
2 2
3 3 .panel.panel-primary
4 4 .panel-title.panel-heading
5 5 Quick Add
6 6 .panel-body
7 7 = form_tag( {method: 'post'}, {class: 'form-inline'}) do
8 8 .form-group
9 9 = label_tag 'user_login', 'Login'
10 10 = text_field 'user', 'login', :size => 10,class: 'form-control'
11 11 .form-group
12 12 = label_tag 'user_full_name', 'Full Name'
13 13 = text_field 'user', 'full_name', :size => 10,class: 'form-control'
14 14 .form-group
15 15 = label_tag 'user_password', 'Password'
16 16 = text_field 'user', 'password', :size => 10,class: 'form-control'
17 17 .form-group
18 18 = label_tag 'user_password_confirmation', 'Confirm'
19 19 = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control'
20 20 .form-group
21 21 = label_tag 'user_email', 'email'
22 22 = text_field 'user', 'email', :size => 10,class: 'form-control'
23 23 =submit_tag "Create", class: 'btn btn-primary'
24 24
25 25 .panel.panel-primary
26 26 .panel-title.panel-heading
27 27 Import from site management
28 28 .panel-body
29 29 = form_tag({:action => 'import'}, :multipart => true,class: 'form form-inline') do
30 30 .form-group
31 31 = label_tag :file, 'File:'
32 32 .input-group
33 33 %span.input-group-btn
34 34 %span.btn.btn-default.btn-file
35 35 Browse
36 36 = file_field_tag 'file'
37 37 = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
38 38 = submit_tag 'Submit', class: 'btn btn-default'
39 39
40 40
41 41 %p
42 42 = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '}
43 43 = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '}
44 44 = link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-default '}
45 45 = link_to 'Bulk Manage', bulk_manage_user_admin_path , { class: 'btn btn-default '}
46 46 = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default '}
47 47 = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default '}
48 48 = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default '}
49 49
50 50 - if GraderConfiguration.multicontests?
51 51 %br/
52 52 %b Multi-contest:
53 53 = link_to '[Manage bulk users in contests]', :action => 'contest_management'
54 54 View users in:
55 55 - @contests.each do |contest|
56 56 = link_to "[#{contest.name}]", :action => 'contests', :id => contest.id
57 57 = link_to "[no contest]", :action => 'contests', :id => 'none'
58 58
59 59 Total #{@user_count} users |
60 60 - if !@paginated
61 61 Display all users.
62 62 \#{link_to '[show in pages]', :action => 'index', :page => '1'}
63 63 - else
64 64 Display in pages.
65 65 \#{link_to '[display all]', :action => 'index', :page => 'all'} |
66 66 \#{will_paginate @users, :container => false}
67 67
68 68
69 69 %table.table.table-hover.table-condense
70 70 %thead
71 71 %th Login
72 72 %th Full name
73 73 %th email
74 74 %th Remark
75 75 %th
76 76 Activated
77 77 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'User has already confirmed the email?' } [?]
78 78 %th
79 79 Enabled
80 80 %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'Allow the user to login?' } [?]
81 81 %th Last IP
82 82 %th
83 83 %th
84 84 %th
85 85 %th
86 86 - for user in @users
87 87 %tr
88 88 %td= link_to user.login, stat_user_path(user)
89 89 %td= user.full_name
90 90 %td= user.email
91 91 %td= user.remark
92 92 %td= toggle_button(user.activated?, toggle_activate_user_path(user),"toggle_activate_user_#{user.id}")
93 93 %td= toggle_button(user.enabled?, toggle_enable_user_path(user),"toggle_enable_user_#{user.id}")
94 94 %td= user.last_ip
95 95 %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-default btn-xs btn-block'
96 96 %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-default btn-xs btn-block'
97 97 %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-default btn-xs btn-block'
98 - %td= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-xs btn-block'
98 + %td= link_to 'Destroy', user_admin_destroy_path(user), data: {confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-danger btn-xs btn-block'
99 99 %br/
100 100 = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '}
101 101 = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '}
@@ -1,106 +1,108
1 1 CafeGrader::Application.routes.draw do
2 2 get "sources/direct_edit"
3 3
4 4 root :to => 'main#login'
5 5
6 6 #logins
7 7 get 'login/login', to: 'login#login'
8 8
9 9 resources :contests
10 10
11 11 resources :sites
12 12
13 13 resources :announcements do
14 14 member do
15 15 get 'toggle','toggle_front'
16 16 end
17 17 end
18 18
19 19 resources :problems do
20 20 member do
21 21 get 'toggle'
22 22 get 'toggle_test'
23 23 get 'toggle_view_testcase'
24 24 get 'stat'
25 25 end
26 26 collection do
27 27 get 'turn_all_off'
28 28 get 'turn_all_on'
29 29 get 'import'
30 30 get 'manage'
31 31 end
32 32 end
33 33
34 34 resources :groups do
35 35 member do
36 36 post 'add_user', to: 'groups#add_user', as: 'add_user'
37 37 delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user'
38 38 post 'add_problem', to: 'groups#add_problem', as: 'add_problem'
39 39 delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem'
40 40 end
41 41 end
42 42
43 43 resources :testcases, only: [] do
44 44 member do
45 45 get 'download_input'
46 46 get 'download_sol'
47 47 end
48 48 collection do
49 49 get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem'
50 50 end
51 51 end
52 52
53 53 resources :grader_configuration, controller: 'configurations'
54 54
55 55 resources :users do
56 56 member do
57 57 get 'toggle_activate', 'toggle_enable'
58 58 get 'stat'
59 59 end
60 60 end
61 61
62 62 resources :submissions do
63 63 member do
64 64 get 'download'
65 65 get 'compiler_msg'
66 66 get 'rejudge'
67 67 end
68 68 collection do
69 69 get 'prob/:problem_id', to: 'submissions#index', as: 'problem'
70 70 get 'direct_edit_problem/:problem_id', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem'
71 71 get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status'
72 72 end
73 73 end
74 74
75 75
76 76
77 77 #main
78 78 get "main/list"
79 79 get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission'
80 80
81 81 #user admin
82 82 get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin'
83 + post 'user_admin', to: 'user_admin#create'
84 + delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy'
83 85
84 86 #report
85 87 get 'report/current_score', to: 'report#current_score', as: 'report_current_score'
86 88 get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof'
87 89 get "report/login"
88 90 get 'report/max_score', to: 'report#max_score', as: 'report_max_score'
89 91 post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score'
90 92
91 93
92 94 #
93 95 get 'tasks/view/:file.:ext' => 'tasks#view'
94 96 get 'tasks/download/:id/:file.:ext' => 'tasks#download'
95 97 get 'heartbeat/:id/edit' => 'heartbeat#edit'
96 98
97 99 #grader
98 100 get 'graders/list', to: 'graders#list', as: 'grader_list'
99 101
100 102
101 103 # See how all your routes lay out with "rake routes"
102 104
103 105 # This is a legacy wild controller route that's not recommended for RESTful applications.
104 106 # Note: This route will make all actions in every controller accessible via GET requests.
105 107 match ':controller(/:action(/:id))(.:format)', via: [:get, :post]
106 108 end
deleted file
You need to be logged in to leave comments. Login now