Description:
- fix various ui issues
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r613:e3dfadbca639 - - 5 files changed: 26 inserted, 22 deleted
@@ -7,6 +7,7 | |||||
|
7 | def index |
|
7 | def index |
|
8 | @configurations = GraderConfiguration.find(:all, |
|
8 | @configurations = GraderConfiguration.find(:all, |
|
9 | :order => '`key`') |
|
9 | :order => '`key`') |
|
|
10 | + @group = GraderConfiguration.pluck("grader_configurations.key").map{ |x| x[0...(x.index('.'))] }.uniq.sort | ||
|
10 | end |
|
11 | end |
|
11 |
|
12 | ||
|
12 | def reload |
|
13 | def reload |
@@ -2,7 +2,7 | |||||
|
2 | - if submission.nil? |
|
2 | - if submission.nil? |
|
3 | = "-" |
|
3 | = "-" |
|
4 | - else |
|
4 | - else |
|
5 |
- - |
|
5 | + - unless submission.graded_at |
|
6 | = t 'main.submitted_at' |
|
6 | = t 'main.submitted_at' |
|
7 | = format_short_time(submission.submitted_at.localtime) |
|
7 | = format_short_time(submission.submitted_at.localtime) |
|
8 | - else |
|
8 | - else |
@@ -3,24 +3,27 | |||||
|
3 |
|
3 | ||
|
4 | %h1 System configuration |
|
4 | %h1 System configuration |
|
5 |
|
5 | ||
|
6 | - %table.info |
|
6 | + - @group.each do |g| |
|
7 | - %tr.info-head |
|
7 | + %h2= g |
|
8 | - %th Key |
|
8 | + %table.table.table-striped |
|
9 |
- %th |
|
9 | + %thead |
|
10 | - %th Value |
|
10 | + %th{style: 'width: 25%'} Key |
|
11 | - %th Description |
|
11 | + %th{style: 'width: 10%'}Type |
|
12 | - - @configurations.each do |conf| |
|
12 | + %th{style: 'width: 15%'} Value |
|
13 | - - @grader_configuration = conf |
|
13 | + %th Description |
|
14 | - %tr{:class => cycle("info-odd", "info-even")} |
|
14 | + - @configurations.each do |conf| |
|
15 | - %td |
|
15 | + - next if conf.key[0...(conf.key.index('.'))] != g |
|
16 | - /= in_place_editor_field :grader_configuration, :key, {}, :rows=>1 |
|
16 | + - @grader_configuration = conf |
|
17 | - = @grader_configuration.key |
|
17 | + %tr |
|
18 | - %td |
|
18 | + %td |
|
19 |
- /= in_place_editor_field :grader_configuration, : |
|
19 | + /= in_place_editor_field :grader_configuration, :key, {}, :rows=>1 |
|
20 |
- = @grader_configuration. |
|
20 | + = @grader_configuration.key |
|
21 | - %td |
|
21 | + %td |
|
22 | - = best_in_place @grader_configuration, :value, ok_button: "ok", cancel_button: "cancel" |
|
22 | + /= in_place_editor_field :grader_configuration, :value_type, {}, :rows=>1 |
|
23 | - %td= conf.description |
|
23 | + = @grader_configuration.value_type |
|
|
24 | + %td | ||
|
|
25 | + = best_in_place @grader_configuration, :value, ok_button: "ok", cancel_button: "cancel" | ||
|
|
26 | + %td= conf.description | ||
|
24 |
|
27 | ||
|
25 | - if GraderConfiguration.config_cached? |
|
28 | - if GraderConfiguration.config_cached? |
|
26 | %br/ |
|
29 | %br/ |
@@ -8,7 +8,7 | |||||
|
8 | %li= msg |
|
8 | %li= msg |
|
9 | .form-group |
|
9 | .form-group |
|
10 | = label_tag :submission, 'Problem:' |
|
10 | = label_tag :submission, 'Problem:' |
|
11 | - = select 'submission', 'problem_id', [[(t 'main.specified_in_header'),'-1']] + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}, {:selected => '-1'}, { class: 'select2 form-control' } |
|
11 | + = select 'submission', 'problem_id', [[(t 'main.specified_in_header'),'-1']] + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}, {:selected => '-1'}, { class: 'select2 form-control', style: "width: 100%" } |
|
12 | .form-group |
|
12 | .form-group |
|
13 | = label_tag :file, 'File:' |
|
13 | = label_tag :file, 'File:' |
|
14 | .input-group |
|
14 | .input-group |
@@ -3,14 +3,14 | |||||
|
3 | = "-" |
|
3 | = "-" |
|
4 | - else |
|
4 | - else |
|
5 | - unless submission.graded_at |
|
5 | - unless submission.graded_at |
|
6 | - =t 'main.submitted_at' |
|
6 | + = t 'main.submitted_at' |
|
7 | = format_short_time(submission.submitted_at.localtime) |
|
7 | = format_short_time(submission.submitted_at.localtime) |
|
8 | - else |
|
8 | - else |
|
9 | %strong= t 'main.graded_at' |
|
9 | %strong= t 'main.graded_at' |
|
10 | = "#{format_short_time(submission.graded_at.localtime)} " |
|
10 | = "#{format_short_time(submission.graded_at.localtime)} " |
|
11 | %br |
|
11 | %br |
|
12 | - if GraderConfiguration['ui.show_score'] |
|
12 | - if GraderConfiguration['ui.show_score'] |
|
13 | - =t 'main.score' |
|
13 | + %strong=t 'main.score' |
|
14 | = "#{(submission.points*100/submission.problem.full_score).to_i} " |
|
14 | = "#{(submission.points*100/submission.problem.full_score).to_i} " |
|
15 | = " [" |
|
15 | = " [" |
|
16 | %tt |
|
16 | %tt |
You need to be logged in to leave comments.
Login now