Description:
[web] better css styling git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@129 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

r57:45a526b9fbd3 - - 9 files changed: 45 inserted, 54 deleted

@@ -1,16 +1,16
1 1 <tr class="info-<%= (problem_counter%2==0) ? "even" : "odd" %>">
2 - <td class="info">
2 + <td>
3 3 <%= "#{problem_counter + 1}" %>
4 4 </td>
5 - <td class="info">
5 + <td>
6 6 <%= "#{problem.full_name} (#{problem.name})" %>
7 7 <%= link_to '[desc]', problem.url, :popup => true if (problem.url!=nil) and (problem.url!='') %>
8 8 </td>
9 - <td class="info" align="center">
9 + <td align="center">
10 10 <%= @prob_submissions[problem_counter][:count] %>
11 11 </td>
12 - <td class="info">
12 + <td>
13 13 <%= render :partial => 'submission_short',
14 14 :locals => { :submission => @prob_submissions[problem_counter][:submission]} %>
15 15 </td>
16 16 </tr>
@@ -1,26 +1,26
1 1 <div class="title">Hello <%=h @user.full_name %></div>
2 2 Current time is <%= format_short_time(Time.new) %>.
3 3
4 4 <div class="submitbox">
5 5 <%= error_messages_for 'submission' %>
6 6 <%= render :partial => 'submission_box' %>
7 7 </div>
8 8
9 9 <hr/>
10 10
11 11 <table class="info">
12 12 <tr class="info-head">
13 - <th class="info"></th>
14 - <th class="info">Tasks</th>
15 - <th class="info"># of sub(s)</th>
16 - <th class="info">Results</th>
13 + <th></th>
14 + <th>Tasks</th>
15 + <th># of sub(s)</th>
16 + <th>Results</th>
17 17 </tr>
18 18 <%= render :partial => 'problem', :collection => @problems %>
19 19 </table>
20 20
21 21 <hr />
22 22
23 23 <div class="submitbox">
24 24 <%= render :partial => 'submission_box' %>
25 25 </div>
26 26
@@ -1,36 +1,32
1 1 <% content_for :head do %>
2 2 <%= stylesheet_link_tag 'scaffold' %>
3 3 <%= stylesheet_link_tag 'problems' %>
4 4 <%= javascript_include_tag :defaults %>
5 5 <% end %>
6 6
7 7 <h1>Listing problems</h1>
8 8
9 - <div class="usermenu">
10 - <%= link_to 'Main', :controller => 'main', :action => 'list' %>
11 - </div>
12 -
13 9 <%= link_to 'New problem', :action => 'new' %>
14 10 <%= link_to 'Turn off all problems', :action => 'turn_all_off' %><br/>
15 11
16 12 <table>
17 13 <tr>
18 14 <th>Name</th>
19 15 <th>Full name</th>
20 16 <th>Full score</th>
21 17 <th>Date added</th>
22 18 <th>Available</th>
23 19 </tr>
24 20
25 21 <% for problem in @problems %>
26 22 <tr class="<%= (problem.available) ? "available" : "not-available" %>">
27 23 <% @problem=problem %>
28 24 <td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %>
29 25 <td><%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %>
30 26 <td><%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %>
31 27 <td><%= problem.date_added %>
32 28 <td><%= problem.available %>
33 29
34 30 <td><%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %></td>
35 31 <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td>
36 32 <td><%= link_to '[Show]', :action => 'show', :id => problem %></td>
@@ -1,23 +1,26
1 1 <h1>Problem stat: <%= @problem.name %></h1>
2 2
3 - <div class="usermenu">
4 - <%= link_to 'Main', :controller => 'main', :action => 'list' %>
5 - </div>
6 -
7 3 <i>This is just a hack. Really not efficient.</i><br/><br/>
8 4
9 5 <% if @submissions!=nil %>
10 - <table border="1">
11 - <tr><td>user_id</td><td>submitted_at</td><td>points</td><td>comment</td></tr>
6 + <table class="info">
7 + <tr class="info-head">
8 + <th>user_id</th>
9 + <th>submitted_at</th>
10 + <th>points</th>
11 + <th>comment</th>
12 + </tr>
13 + <% count = 0 %>
12 14 <% @submissions.each do |sub| %>
13 - <tr>
15 + <tr class="<%= (count % 2 ==0) ? "info-even" : "info-odd" %>">
14 16 <td><%= sub.user_id %></td>
15 17 <td><%= sub.submitted_at.to_s %></td>
16 18 <td><%= sub.points %></td>
17 19 <td><div style="font-family: monospace"><%= sub.grader_comment %></div></td>
18 20 </tr>
21 + <% count += 1 %>
19 22 <% end %>
20 23 </table>
21 24 <% else %>
22 25 No submission
23 26 <% end %>
@@ -1,11 +1,11
1 1 %tr{:class => (test_request_counter%2==0) ? "info-even" : "info-odd"}
2 - %td.info= test_request_counter +1
3 - %td.info= test_request.problem.full_name
4 - %td.info= test_request.submission.number
5 - %td.info= test_request.status_str
6 - %td.info= test_request.running_stat or ''
7 - %td.info
2 + %td= test_request_counter +1
3 + %td= test_request.problem.full_name
4 + %td= test_request.submission.number
5 + %td= test_request.status_str
6 + %td= test_request.running_stat or ''
7 + %td
8 8 - if test_request.output_file_name!=nil
9 9 = link_to '[output]', :action => 'read', :id => test_request.id
10 - %td.info= test_request.grader_comment or ''
11 - %td.info= test_request.compiler_message or ''
10 + %td= test_request.grader_comment or ''
11 + %td= test_request.compiler_message or ''
@@ -36,38 +36,38
36 36 </tr>
37 37 <tr>
38 38 <td>Submission:</td>
39 39 <td>
40 40 <%= select(:test_request,
41 41 :submission_number,
42 42 ((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %>
43 43 </td>
44 44 </tr>
45 45 <tr>
46 46 <td>Input data:</td>
47 47 <td><%= f.file_field :input_file %></td>
48 48 <tr>
49 49 <td colspan="2">
50 50 <%= submit_tag 'submit' %>
51 51 </td>
52 52 </tr>
53 53 </table>
54 54 <% end %>
55 55
56 56 <h3>Previous requests</h3>
57 57
58 58 <table class="info">
59 59 <tr class="info-head">
60 - <th class="info"></td>
61 - <th class="info">problem</th>
62 - <th class="info">#</th>
63 - <th class="info">status</th>
64 - <th class="info">running stat</th>
65 - <th class="info">output (first 2kb)</th>
66 - <th class="info">grading comment</th>
67 - <th class="info">compiler message</th>
60 + <th></td>
61 + <th>problem</th>
62 + <th>#</th>
63 + <th>status</th>
64 + <th>running stat</th>
65 + <th>output (first 2kb)</th>
66 + <th>grading comment</th>
67 + <th>compiler message</th>
68 68 </tr>
69 69 <%= render :partial => 'test_request', :collection => @user.test_requests %>
70 70 </table>
71 71
72 72 <% end %>
73 73
@@ -1,32 +1,30
1 - <h1>User stat</h1>
2 -
3 - <div class="usermenu">
4 - <%= link_to 'List', :action => 'list' %>
5 - <%= link_to 'Main', :controller => 'main', :action => 'list' %>
6 - </div>
1 + <h1>User grading results</h1>
7 2
8 - <table border="1">
9 - <tr><td>User</td>
3 + <table class="info">
4 + <tr class="info-head"><th>User</th>
10 5 <% @problems.each do |p| %>
11 - <td><%= p.name %></td>
6 + <th><%= p.name %></th>
12 7 <% end %>
13 - <td>Total</td>
8 + <th>Total</th>
9 + <th>Passed</th>
14 10 </tr>
11 + <% counter = 0 %>
15 12 <% @scorearray.each do |sc| %>
16 - <tr>
13 + <tr class="<%= (counter %2 ==0) ? "info-even" : "info-odd" %>">
17 14 <% total = 0 %>
18 15 <% num_passed = 0 %>
19 16 <% sc.each_index do |i| %>
20 17 <% if i==0 %>
21 18 <td><%= sc[i] %></td>
22 19 <% else %>
23 20 <td><%= sc[i][0] %></td>
24 21 <% total += sc[i][0] %>
25 22 <% num_passed += 1 if sc[i][1] %>
26 23 <% end %>
27 24 <% end %>
28 25 <td><%= total %></td>
29 26 <td><%= num_passed %></td>
30 27 </tr>
28 + <% counter += 1 %>
31 29 <% end %>
32 30 </table>
@@ -5,53 +5,53
5 5
6 6 /* This is the main menu bad*/
7 7 div.userbar {
8 8 border-top: thin solid grey;
9 9 border-bottom: thin solid grey;
10 10 text-align: right;
11 11 font-size: 12px;
12 12 }
13 13
14 14 /* This is the top bar, displaying user's full name */
15 15 div.title {
16 16 font-size: 20px;
17 17 font-weight: bold;
18 18 background: lightgreen;
19 19 padding: 2px;
20 20 }
21 21
22 22 /* Standard table with header and rows with alternating background */
23 23 table.info {
24 24 border: 1px solid black;
25 25 border-collapse: collapse;
26 26 font-size: 12px;
27 27 }
28 28
29 - th.info {
29 + table.info th {
30 30 border: 1px solid black;
31 31 }
32 32
33 - td.info {
33 + table.info td {
34 34 border-left: 1px solid black;
35 35 border-right: 1px solid black;
36 36 }
37 37
38 38 tr.info-head {
39 39 background: #777777;
40 40 color: white;
41 41 }
42 42
43 43 tr.info-odd {
44 44 background: #dddddd;
45 45 }
46 46
47 47 tr.info-even {
48 48 background: #f0f0f0;
49 49 }
50 50
51 51 /*******************************
52 52 [Main]
53 53 ********************************/
54 54 div.submitbox {
55 55 border: thin solid black;
56 56 padding: 5px;
57 57 color: white;
@@ -1,32 +1,26
1 1 body { background-color: #fff; color: #333; }
2 2
3 - div.usermenu {
4 - border-top: thin solid grey;
5 - border-bottom: thin solid grey;
6 - text-align: right
7 - }
8 -
9 3 body, p, ol, ul, td {
10 4 font-family: verdana, arial, helvetica, sans-serif;
11 5 font-size: 13px;
12 6 line-height: 18px;
13 7 }
14 8
15 9 pre {
16 10 background-color: #eee;
17 11 padding: 10px;
18 12 font-size: 11px;
19 13 }
20 14
21 15 a { color: #000; }
22 16 a:visited { color: #666; }
23 17 a:hover { color: #fff; background-color:#000; }
24 18
25 19 .fieldWithErrors {
26 20 padding: 2px;
27 21 background-color: red;
28 22 display: table;
29 23 }
30 24
31 25 #errorExplanation {
32 26 width: 400px;
You need to be logged in to leave comments. Login now