Description:
update views -- styling git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@114 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r51:1f6cfc6a5b62 - - 11 files changed: 116 inserted, 63 deleted

@@ -0,0 +1,13
1 +
2 + - if submission==nil
3 + = "-"
4 + - else
5 + - if submission.graded_at==nil
6 + Submitted at
7 + = format_short_time(submission.submitted_at)
8 + - else
9 + = "Graded at #{format_short_time(submission.graded_at)}, "
10 + = "score: #{submission.points} "
11 + = " [" + submission.grader_comment + "]"
12 + = " | "
13 + = link_to('[source]',{:action => 'get_source', :id => submission.id})
@@ -0,0 +1,24
1 + .title
2 + Hello
3 + =h @user.full_name
4 +
5 + Current time is
6 + = format_short_time(Time.new)
7 + %br/
8 +
9 + .task-menu
10 + Tasks:
11 + - @problems.each do |problem|
12 + = link_to problem.name, :action => 'submission', :id => problem.name
13 +
14 + - if @submissions!=nil
15 + %table.info
16 + %tr.info-head
17 + %th.info Sub #
18 + %th.info Time
19 + %th.info Source
20 + %th.info Results
21 + %th.info{:width => "300px"}
22 + Compiler message
23 + = render :partial => 'submission', :collection => @submissions
24 +
@@ -52,6 +52,18
52 end
52 end
53 end
53 end
54
54
55 + def submission
56 + @user = User.find(session[:user_id])
57 + @problems = Problem.find_available_problems
58 + if params[:id]==nil
59 + @problem = nil
60 + @submissions = nil
61 + else
62 + @problem = Problem.find_by_name(params[:id])
63 + @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id)
64 + end
65 + end
66 +
55 protected
67 protected
56 def prepare_list_information
68 def prepare_list_information
57 @problems = Problem.find_available_problems
69 @problems = Problem.find_available_problems
@@ -7,6 +7,7
7
7
8 # main page
8 # main page
9 append_to menu_items, '[Main]', 'main', 'list'
9 append_to menu_items, '[Main]', 'main', 'list'
10 + append_to menu_items, '[Submissions]', 'main', 'submission'
10 append_to menu_items, '[Test]', 'test', 'index'
11 append_to menu_items, '[Test]', 'test', 'index'
11
12
12 # admin menu
13 # admin menu
@@ -49,6 +49,14
49 })
49 })
50 end
50 end
51
51
52 + def self.find_all_by_user_problem(user_id, problem_id)
53 + Submission.find(:all,
54 + :conditions => {
55 + :user_id => user_id,
56 + :problem_id => problem_id,
57 + })
58 + end
59 +
52 protected
60 protected
53
61
54 def self.find_option_in_source(option, source)
62 def self.find_option_in_source(option, source)
@@ -1,10 +1,15
1 - <div><div><a href="#" onClick="n = this.parentNode.parentNode.lastChild;
1 +
2 + <% if compiler_message==nil or compiler_message=='' %>
3 + No message
4 + <% else %>
5 + <div><div><a href="#" onClick="n = this.parentNode.parentNode.lastChild;
2 if(n.style.display == 'none') { n.style.display = 'block'; }
6 if(n.style.display == 'none') { n.style.display = 'block'; }
3 else {n.style.display ='none'; } return false;">
7 else {n.style.display ='none'; } return false;">
4 - Compiler message</a> (click to see)
8 + (click to see)</a>
5 - </div>
6 - <div style="display: none">
7 - <div class="compilermsgbody" style="border: thin solid grey; margin: 2px">
8 - <%=h(compiler_message).gsub(/\n/,'<br/>') %>
9 </div>
9 </div>
10 - </div></div>
10 + <div style="display: none">
11 + <div class="compilermsgbody" style="border: thin solid grey; margin: 2px">
12 + <%=h(compiler_message).gsub(/\n/,'<br/>') %>
13 + </div>
14 + </div></div>
15 + <% end %>
@@ -10,7 +10,7
10 <%= @prob_submissions[problem_counter][:count] %>
10 <%= @prob_submissions[problem_counter][:count] %>
11 </td>
11 </td>
12 <td class="info">
12 <td class="info">
13 - <%= render :partial => 'submission',
13 + <%= render :partial => 'submission_short',
14 :locals => { :submission => @prob_submissions[problem_counter][:submission]} %>
14 :locals => { :submission => @prob_submissions[problem_counter][:submission]} %>
15 </td>
15 </td>
16 </tr>
16 </tr>
@@ -1,13 +1,14
1
1
2 - - if submission==nil
2 + %tr{:class => ((submission_counter%2==0) ? "info-even" : "info-odd")}
3 - = "-"
3 + %td.info{:align => "center"}
4 - - else
4 + = submission_counter+1
5 - - if submission.graded_at==nil
5 + %td.info= format_short_time(submission.submitted_at)
6 - Submitted at
6 + %td.info= link_to('[source]',{:action => 'get_source', :id => submission.id})
7 - = format_short_time(submission.submitted_at)
7 + %td.info
8 - - else
8 + - if submission.graded_at!=nil
9 - = "Graded at #{format_short_time(submission.graded_at)}, "
9 + = "Graded at #{format_short_time(submission.graded_at)}."
10 - = "score: #{submission.points} "
10 + %br/
11 - = " [" + submission.grader_comment + "]"
11 + = "Score: #{submission.points} "
12 - = " | "
12 + = " [" + submission.grader_comment + "]"
13 - = link_to('[source]',{:action => 'get_source', :id => submission.id})
13 + %td.info
14 + = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message }
@@ -1,11 +1,11
1 - %tr.test-request
1 + %tr{:class => (test_request_counter%2==0) ? "info-even" : "info-odd"}
2 - %td= test_request_counter +1
2 + %td.info= test_request_counter +1
3 - %td= test_request.problem.full_name
3 + %td.info= test_request.problem.full_name
4 - %td= test_request.submission.number
4 + %td.info= test_request.submission.number
5 - %td= test_request.status_str
5 + %td.info= test_request.status_str
6 - %td= test_request.running_stat or ''
6 + %td.info= test_request.running_stat or ''
7 - %td
7 + %td.info
8 - if test_request.output_file_name!=nil
8 - if test_request.output_file_name!=nil
9 = link_to '[output]', :action => 'read', :id => test_request.id
9 = link_to '[output]', :action => 'read', :id => test_request.id
10 - %td= test_request.grader_comment or ''
10 + %td.info= test_request.grader_comment or ''
11 - %td= test_request.compiler_message or ''
11 + %td.info= test_request.compiler_message or ''
@@ -39,7 +39,7
39 <td>
39 <td>
40 <%= select(:test_request,
40 <%= select(:test_request,
41 :submission_number,
41 :submission_number,
42 - (1..@submissions[0].number).collect {|n| [n,n]}) %>
42 + ((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %>
43 </td>
43 </td>
44 </tr>
44 </tr>
45 <tr>
45 <tr>
@@ -55,18 +55,18
55
55
56 <h3>Previous requests</h3>
56 <h3>Previous requests</h3>
57
57
58 - <table border="1">
58 + <table class="info">
59 - <tr>
59 + <tr class="info-head">
60 - <th></td>
60 + <th class="info"></td>
61 - <th>problem</th>
61 + <th class="info">problem</th>
62 - <th>#</th>
62 + <th class="info">#</th>
63 - <th>status</th>
63 + <th class="info">status</th>
64 - <th>running stat</th>
64 + <th class="info">running stat</th>
65 - <th>output (first 2kb)</th>
65 + <th class="info">output (first 2kb)</th>
66 - <th>grading comment</th>
66 + <th class="info">grading comment</th>
67 - <th>compiler message</th>
67 + <th class="info">compiler message</th>
68 </tr>
68 </tr>
69 - <%= render :partial => 'test_request', :collection => @user.test_requests %>
69 + <%= render :partial => 'test_request', :collection => @user.test_requests %>
70 </table>
70 </table>
71
71
72 <% end %>
72 <% end %>
@@ -9,11 +9,6
9 padding: 2px;
9 padding: 2px;
10 }
10 }
11
11
12 - div.problist-each {
13 - margin-top: 2px;
14 - margin-bottom: 2px
15 - }
16 -
17 div.userbar {
12 div.userbar {
18 border-top: thin solid grey;
13 border-top: thin solid grey;
19 border-bottom: thin solid grey;
14 border-bottom: thin solid grey;
@@ -21,21 +16,6
21 font-size: 12px;
16 font-size: 12px;
22 }
17 }
23
18
24 - div.probname {
25 - background-color: #eeeeee;
26 - font-weight: bold;
27 - padding: 2px;
28 - border: 1px solid black;
29 - }
30 -
31 - div.subinfo {
32 - margin-left: 20px;
33 - margin-top: 2px;
34 - border-bottom: thin solid grey;
35 - border-left: thin solid grey;
36 - font-size: 12px;
37 - }
38 -
39 div.compilermsgbody {
19 div.compilermsgbody {
40 font-family: monospace;
20 font-family: monospace;
41 }
21 }
@@ -46,16 +26,15
46 color: white;
26 color: white;
47 background-color: #777777;
27 background-color: #777777;
48 font-weight: bold;
28 font-weight: bold;
29 + font-size: 13px;
49 }
30 }
50
31
51 -
52 table.uinfo {
32 table.uinfo {
53 border-collapse: collapse;
33 border-collapse: collapse;
54 border: 1px solid black;
34 border: 1px solid black;
55 font-size: 13px;
35 font-size: 13px;
56 }
36 }
57
37
58 -
59 td.uinfo {
38 td.uinfo {
60 vertical-align: top;
39 vertical-align: top;
61 border: 1px solid black;
40 border: 1px solid black;
@@ -92,3 +71,13
92 tr.info-even {
71 tr.info-even {
93 background: #eeeeee;
72 background: #eeeeee;
94 }
73 }
74 +
75 + div.task-menu {
76 + text-align: center;
77 + font-size: 13px;
78 + font-weight: bold;
79 + border-top: 1px solid black;
80 + border-bottom: 1px solid black;
81 + margin-top: 2px;
82 + margin-bottom: 4px;
83 + }
You need to be logged in to leave comments. Login now