Description:
Merge pull request #30 from noppakorn/golden-submit-button add golden submit button
Commit status:
[Not Reviewed]
References:
merge default
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r830:534e06ae3cce - - 2 files changed: 37 inserted, 1 deleted

@@ -463,96 +463,132
463 463 .announcement p {
464 464 font-size: 12px;
465 465 margin: 2px;
466 466 }
467 467
468 468 .pub-info {
469 469 text-align: right;
470 470 font-style: italic;
471 471 font-size: 9px;
472 472
473 473 p {
474 474 text-align: right;
475 475 font-style: italic;
476 476 font-size: 9px;
477 477 }
478 478 }
479 479
480 480 .announcement {
481 481 .toggles {
482 482 font-weight: normal;
483 483 float: right;
484 484 font-size: 80%;
485 485 }
486 486
487 487 .announcement-title {
488 488 font-weight: bold;
489 489 }
490 490 }
491 491
492 492 div {
493 493 &.message {
494 494 margin: 10px 0 0;
495 495
496 496 div {
497 497 &.message {
498 498 margin: 0 0 0 30px;
499 499 }
500 500
501 501 &.body {
502 502 border: 2px solid #dddddd;
503 503 background: #fff8f8;
504 504 padding-left: 5px;
505 505 }
506 506
507 507 &.reply-body {
508 508 border: 2px solid #bbbbbb;
509 509 background: #fffff8;
510 510 padding-left: 5px;
511 511 }
512 512
513 513 &.stat {
514 514 font-size: 10px;
515 515 line-height: 1.75em;
516 516 padding: 0 5px;
517 517 color: #333333;
518 518 background: #dddddd;
519 519 font-weight: bold;
520 520 }
521 521
522 522 &.message div.stat {
523 523 font-size: 10px;
524 524 line-height: 1.75em;
525 525 padding: 0 5px;
526 526 color: #444444;
527 527 background: #bbbbbb;
528 528 font-weight: bold;
529 529 }
530 530 }
531 531 }
532 532
533 533 &.contest-title {
534 534 color: white;
535 535 text-align: center;
536 536 line-height: 2em;
537 537 }
538 538
539 539 &.registration-desc, &.test-desc {
540 540 border: 1px dotted gray;
541 541 background: #f5f5f5;
542 542 padding: 5px;
543 543 margin: 10px 0;
544 544 font-size: 12px;
545 545 line-height: 1.5em;
546 546 }
547 547 }
548 548
549 549 h2.contest-title {
550 550 margin-top: 5px;
551 551 margin-bottom: 5px;
552 552 }
553 553
554 554
555 555
556 556 .grader-comment {
557 557 word-wrap: break-word;
558 558 }
559 +
560 +
561 + golden-btn + .golden-btn { margin-top: 1em; }
562 +
563 + .golden-btn {
564 + display: inline-block;
565 + outline: none;
566 + font-family: inherit;
567 + box-sizing: border-box;
568 + border: none;
569 + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
570 + inset 0 -2px 5px 1px rgba(139,66,8,1),
571 + inset 0 -1px 1px 3px rgba(250,227,133,1);
572 + background-image: linear-gradient(160deg, #a54e07, #b47e11, #fef1a2, #bc881b, #a54e07) !important;
573 + border: 1px solid #a55d07;
574 + color: rgb(120,50,5);
575 + text-shadow: 0 2px 2px rgba(250, 227, 133, 1);
576 + cursor: pointer;
577 + transition: all .2s ease-in-out;
578 + background-size: 100% 100%;
579 + background-position:center;
580 + }
581 + .golden-btn:focus,
582 + .golden-btn:hover {
583 + background-size: 150% 150%;
584 + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23),
585 + inset 0 -2px 5px 1px #b17d10,
586 + inset 0 -1px 1px 3px rgba(250,227,133,1);
587 + border: 1px solid rgba(165,93,7,.6);
588 + color: rgba(120,50,5,.8);
589 + }
590 + .golden-btn:active {
591 + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
592 + inset 0 -2px 5px 1px #b17d10,
593 + inset 0 -1px 1px 3px rgba(250,227,133,1);
594 + }
@@ -1,88 +1,88
1 1 %textarea#text_sourcecode{style: "display:none"}~ @source
2 2 .container
3 3 .row
4 4 .col-md-12
5 5 %h2 Live submit
6 6
7 7 .row
8 8 .col-md-12
9 9 .alert.alert-info
10 10 Write your code in the following box, choose language, and click submit button when finished
11 11 .row
12 12 .col-md-8
13 13 %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'}
14 14 .col-md-4
15 15 - # submission form
16 16 = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do
17 17
18 18 = hidden_field_tag 'editor_text', @source
19 19 = hidden_field_tag 'submission[problem_id]', @problem.id
20 20 .form-group
21 21 = label_tag "Task:"
22 22 = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
23 23 .form-group
24 24 = label_tag "Description:"
25 25 = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem
26 26
27 27 .form-group
28 28 = label_tag 'Language:'
29 29 = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || @current_user.default_language || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px"
30 30 .form-group
31 31 .input-group
32 32 %span.input-group-btn
33 33 %span.btn.btn-default.btn-file
34 34 Browse
35 35 = file_field_tag 'load_file'
36 36 = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
37 37 .form-group
38 - = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
38 + = submit_tag 'Submit', class: 'btn ' + (@submission && @submission.number >= 100 ? 'golden-btn' : 'btn-success'), id: 'live_submit',
39 39 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
40 40 - # latest submission status
41 41 .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
42 42 .panel-heading
43 43 Latest Submission Status
44 44 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
45 45 .panel-body
46 46 %div#latest_status
47 47 - if @submission
48 48 = render :partial => 'submission_short',
49 49 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
50 50
51 51 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
52 52 .modal-dialog.modal-lg{role:'document'}
53 53 .modal-content
54 54 .modal-header
55 55 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
56 56 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
57 57 %h4 Compiler message
58 58 .modal-body
59 59 %pre#compiler_msg
60 60 - if @submission
61 61 = @submission.compiler_message
62 62 .modal-footer
63 63 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
64 64
65 65 :javascript
66 66 $(document).ready(function() {
67 67 e = ace.edit("editor")
68 68 e.setValue($("#text_sourcecode").val());
69 69 e.gotoLine(1);
70 70 $("#language_id").trigger('change');
71 71
72 72 $("#load_file").on('change',function(evt) {
73 73 var file = evt.target.files[0];
74 74 var reader = new FileReader();
75 75 reader.onload = function(theFile) {
76 76 var e = ace.edit("editor")
77 77 e.setValue(theFile.target.result);
78 78 e.gotoLine(1);
79 79 };
80 80 reader.readAsText(file)
81 81 });
82 82
83 83 //brython();
84 84 });
85 85
86 86
87 87
88 88
You need to be logged in to leave comments. Login now