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

r873:a7f456a02c5b - - 5 files changed: 26 inserted, 9 deleted

@@ -1,134 +1,134
1 1
2 2 .secondnavbar {
3 3 top: 50px;
4 4 }
5 5
6 6
7 7 //for google material design
8 8 .mi-bs {
9 9 vertical-align: middle;
10 10 position: relative;
11 11 top: -3px;
12 12 }
13 13
14 14 // --------------- bootstrap file upload ----------------------
15 15 .btn-file {
16 16 position: relative;
17 17 overflow: hidden;
18 18 }
19 19
20 20 .btn-file input[type=file] {
21 21 position: absolute;
22 22 top: 0;
23 23 right: 0;
24 24 min-width: 100%;
25 25 min-height: 100%;
26 26 font-size: 100px;
27 27 text-align: right;
28 28 filter: alpha(opacity = 0);
29 29 opacity: 0;
30 30 outline: none;
31 31 background: white;
32 32 cursor: inherit;
33 33 display: block;
34 34 }
35 35
36 36 body {
37 37 //font-size: 13px
38 - font-family: 'Krub', Tahoma, "sans-serif";
38 + font-family: 'Noto Sans Thai', Tahoma, "sans-serif";
39 39 margin: 10px;
40 40 padding: 10px;
41 41 padding-top: 60px;
42 42 }
43 43
44 44 // ------------------ bootstrap sortable --------------------
45 45 table.sortable th {
46 46 padding-right: 20px !important;
47 47
48 48 span.sign {
49 49 right: (-15px) !important;
50 50 }
51 51
52 52 &.text-right {
53 53 padding-left: 20px !important;
54 54 padding-right: 8px !important;
55 55
56 56 &:after, span.sign {
57 57 left: (-15px) !important;
58 58 }
59 59 }
60 60 }
61 61
62 62 input {
63 63 font-family: Tahoma, "sans-serif";
64 64 }
65 65
66 66 h1 {
67 67 color: #334488;
68 68 }
69 69
70 70 h2 {
71 71 color: #5566bb;
72 72 }
73 73
74 74 hr {
75 75 border-top: 1px solid #dddddd;
76 76 border-bottom: 1px solid #eeeeee;
77 77 }
78 78
79 79 //#a
80 80 // color: #6666cc
81 81 // text-decoration: none
82 82 //
83 83 // &:link, &:visited
84 84 // color: #6666cc
85 85 // text-decoration: none
86 86 //
87 87 // &:hover, &:focus
88 88 // color: #111166
89 89 // text-decoration: none
90 90
91 91 div {
92 92 &.userbar {
93 93 line-height: 1.5em;
94 94 text-align: right;
95 95 font-size: 12px;
96 96 }
97 97
98 98 &.title {
99 99 padding: 10px 0px;
100 100 line-height: 1.5em;
101 101 font-size: 13px;
102 102
103 103 span.contest-over-msg {
104 104 font-size: 15px;
105 105 color: red;
106 106 }
107 107
108 108 table {
109 109 width: 100%;
110 110 font-weight: bold;
111 111 }
112 112
113 113 td {
114 114 &.left-col {
115 115 text-align: left;
116 116 vertical-align: top;
117 117 color: #444444;
118 118 }
119 119
120 120 &.right-col {
121 121 text-align: right;
122 122 vertical-align: top;
123 123 font-size: 18px;
124 124 color: #116699;
125 125 }
126 126 }
127 127 }
128 128 }
129 129
130 130 table.info {
131 131 margin: 10px 0;
132 132 border: 1px solid #666666;
133 133 border-collapse: collapse;
134 134 font-size: 12px;
@@ -1,27 +1,33
1 1 <!DOCTYPE html>
2 2 %html
3 3 %head
4 4 %title= GraderConfiguration['contest.name']
5 5 = stylesheet_link_tag "application", params[:controller], :media => "all"
6 6 = csrf_meta_tags
7 7 = csp_meta_tag
8 8 = javascript_include_tag :my_app
9 9 -# = javascript_import_module_tag('prepend_jquery')
10 10 = javascript_importmap_tags
11 11 = content_for :header
12 12 = yield :head
13 13 -# %link{href:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css",rel:"stylesheet",integrity:"sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT",crossorigin:"anonymous"}
14 14 -# %script{src:"https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js",integrity:"sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3",crossorigin:"anonymous"}
15 15 -# %script{src:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js",integrity:"sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz",crossorigin:"anonymous"}
16 16
17 17 <link rel="preconnect" href="https://fonts.googleapis.com">
18 18 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
19 - <link href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:ital@0;1&family=Krub:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Sarabun:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap" rel="stylesheet">
19 + -#
20 + <link href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Krub:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Sarabun:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap" rel="stylesheet">
21 + <link href="https://fonts.googleapis.com/css2?family=Mitr:ital,wght@0,300;1,300&family=Kodchasan:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Noto+Serif+Thai:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Noto+Sans+Thai:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap" rel="stylesheet">
22 + <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+Thai:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Noto+Sans+Thai:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap" rel="stylesheet">
23 + <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+Thai:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
24 + <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
25 + <link href="https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
20 26
21 27 %body
22 28 - unless local_assigns[:skip_header]
23 29 = render 'layouts/header'
24 30
25 31 /= content_tag(:p,flash[:notice],class: 'alert alert-success') if flash[:notice]!=nil
26 32 = flash_messages
27 33 = yield
@@ -1,12 +1,13
1 1 %h1= GraderConfiguration['ui.front.title']
2 2
3 3 .row
4 4 .col-md-6
5 - - if @announcements.length!=0
6 - .announcementbox{:style => 'margin-top: 0px'}
7 - %span{:class => 'title'}
8 - Announcements
5 + .card
6 + .card-header
7 + Announcement
8 + = link_to 'Manage', announcements_path, class: 'btn btn-secondary btn-sm'
9 + %ul.list-group.list-group-flush
9 10 = render :partial => 'announcement', :collection => @announcements
10 11 .col-md-4{style: "padding-left: 20px;"}
11 12 = render :partial => 'login_box'
12 13 = "current ip is #{@remote_ip}"
@@ -1,72 +1,82
1 1 - content_for :head do
2 2 = stylesheet_link_tag 'problems'
3 3
4 4 %h1 Import problems
5 5
6 6 %p= link_to '[Back to problem list]', problems_path
7 7
8 8 - if @problem and @problem.errors
9 9 =error_messages_for 'problem'
10 10
11 - = form_tag do_import_problems_path, :multipart => true do |f|
11 + = form_with url: do_import_problems_path, :multipart => true do |f|
12 + .row.mb-2
13 + .col-md-1
14 + = f.label :name, 'Name'
15 + .col-md-11
16 + = f.text_field :name, class: 'form-control'
17 + .row.mb-2
18 + .col-md-1
19 + = f.label :full_name, 'Full Name'
20 + .col-md-11
21 + = f.text_field :full_name, class: 'form-control'
12 22
13 23 .submitbox
14 24 %table
15 25 %tr
16 26 %td Name:
17 27 %td= text_field_tag 'name'
18 28 %tr
19 29 %td Full name:
20 30 %td
21 31 = text_field_tag 'full_name'
22 32 %span{:class => 'help'} Leave blank to use the same value as the name above.
23 33 %tr
24 34 %td Testdata file:
25 35 %td= file_field_tag 'file'
26 36 %tr
27 37 %td
28 38 %td
29 39 %span{:class => 'help'}
30 40 In .zip, .tgz, tar.gz, .tar format.
31 41 It should includes inputs (e.g., 1.in, 2a.in, 2b.in)
32 42 and solutions (e.g., 1.sol, 2a.sol, 2b.sol).
33 43 %br/
34 44 You may put task description in *.html for raw html
35 45 and *.md or *.markdown for markdown.
36 46 %br/
37 47 You may also put a pdf file for the task description
38 48 %tr
39 49 %td Checker:
40 50 %td= select_tag 'checker', options_for_select([['Text checker','text'],['Float checker','float']], 'text')
41 51 %tr
42 52 %td
43 53 %td
44 54 %span{:class => 'help'}
45 55 "Text" checker checks if the text (including numbers) is the same, ignoring any whitespace
46 56 %br/
47 57 "Float" checker checks if all numbers is within EPSILON error using formula |a-b| < EPSILON * max(|a|,|b|)
48 58
49 59 - if @allow_test_pair_import
50 60 %tr
51 61 %td
52 62 %td
53 63 = check_box_tag 'import_to_db'
54 64 Import test data to database (for a test-pair task)
55 65 %tr
56 66 %td Time limit:
57 67 %td
58 68 = text_field_tag 'time_limit'
59 69 %span{:class => 'help'} In seconds. Leave blank to use 1 sec.
60 70 %tr
61 71 %td Memory limit:
62 72 %td
63 73 = text_field_tag 'memory_limit'
64 74 %span{:class => 'help'} In MB. Leave blank to use 32MB.
65 75 %tr
66 76 %td
67 77 %td= submit_tag 'Import problem'
68 78
69 79 - if @log
70 80 %h3 Import log
71 81 %pre.import-log
72 82 = @log
@@ -1,65 +1,65
1 1 - content_for :head do
2 2 = stylesheet_link_tag 'problems'
3 3 %h1 Problems
4 4 %p
5 5 = link_to 'Import problems', {:action => 'import'}, class: 'btn btn-success btn-sm'
6 6 = link_to 'New problem', new_problem_path, class: 'btn btn-success btn-sm'
7 7 = link_to 'Bulk Manage', { action: 'manage'}, class: 'btn btn-info btn-sm'
8 - = link_to 'Turn off all problems', {:action => 'turn_all_off'}, class: 'btn btn-default btn-sm'
9 - = link_to 'Turn on all problems', {:action => 'turn_all_on'}, class: 'btn btn-default btn-sm'
8 + = link_to 'Turn off all problems', {:action => 'turn_all_off'}, class: 'btn btn-secondary btn-sm'
9 + = link_to 'Turn on all problems', {:action => 'turn_all_on'}, class: 'btn btn-secondary btn-sm'
10 10 .submitbox
11 11 = form_tag action: 'quick_create', controller: 'problems' do
12 12 %b Quick New:
13 13 %label{:for => "problem_name"} Name
14 14 = text_field 'problem', 'name'
15 15 |
16 16 %label{:for => "problem_full_name"} Full name
17 17 = text_field 'problem', 'full_name'
18 18 = submit_tag "Create"
19 19 %table.table.table-condense.table-hover
20 20 %thead
21 21 %th Name
22 22 %th Full name
23 23 %th.text-right Full score
24 24 %th Tags
25 25 %th
26 26 Submit
27 27 %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Admin can always submit to any problem' } [?]
28 28 %th Date added
29 29 %th.text-center
30 30 Avail?
31 31 %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user submits to this problem?' } [?]
32 32 %th.text-center
33 33 View Data?
34 34 %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user view the testcase of this problem?' } [?]
35 35 %th.text-center
36 36 Test?
37 37 %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user uses test interface on this problem?' } [?]
38 38 - if GraderConfiguration.multicontests?
39 39 %th Contests
40 40 - for problem in @problems
41 41 %tr{:class => "#{(problem.available) ? "bg-success bg-opacity-25" : "bg-opacity-25"}", :id => "prob-#{problem.id}", :name => "prob-#{problem.id}"}
42 42 - @problem=problem
43 43 %td= problem.name #in_place_editor_field :problem, :name, {}, :rows=>1
44 44 %td
45 45 = problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1
46 46 = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem
47 47 %td.text-right= problem.full_score #in_place_editor_field :problem, :full_score, {}, :rows=>1
48 48 %td
49 49 - problem.tags.each do |t|
50 50 - #%button.btn.btn-default.btn-sm= t.name
51 51 %span.label.label-default= t.name
52 52 %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn-sm btn-primary'
53 53 %td= problem.date_added
54 54 %td= toggle_button(@problem.available?, toggle_problem_path(@problem), "problem-avail-#{@problem.id}")
55 55 %td= toggle_button(@problem.view_testcase?, toggle_view_testcase_problem_path(@problem), "problem-view-testcase-#{@problem.id}")
56 56 %td= toggle_button(@problem.test_allowed?, toggle_test_problem_path(@problem), "problem-test-#{@problem.id}")
57 57 - if GraderConfiguration.multicontests?
58 58 %td
59 59 = problem.contests.collect { |c| c.name }.join(', ')
60 60 %td= link_to 'Stat', {:action => 'stat', :id => problem.id}, class: 'btn btn-info btn-sm btn-block'
61 61 %td= link_to 'Show', {:action => 'show', :id => problem}, class: 'btn btn-info btn-sm btn-block'
62 62 %td= link_to 'Edit', {:action => 'edit', :id => problem}, class: 'btn btn-info btn-sm btn-block'
63 63 %td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-sm btn-block'
64 64 %br/
65 65 = link_to '[New problem]', :action => 'new'
You need to be logged in to leave comments. Login now