Description:
+in_place_editing for problems
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@45 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r21:e66aa2c506e7 - - 6 files changed: 36 inserted, 28 deleted
@@ -2,6 +2,10 | |||||
|
2 |
|
2 | ||
|
3 | before_filter :authenticate, :authorization |
|
3 | before_filter :authenticate, :authorization |
|
4 |
|
4 | ||
|
|
5 | + in_place_edit_for :problem, :name | ||
|
|
6 | + in_place_edit_for :problem, :full_name | ||
|
|
7 | + in_place_edit_for :problem, :full_score | ||
|
|
8 | + | ||
|
5 | def index |
|
9 | def index |
|
6 | list |
|
10 | list |
|
7 | render :action => 'list' |
|
11 | render :action => 'list' |
@@ -5,7 +5,7 | |||||
|
5 | st = '' |
|
5 | st = '' |
|
6 | if (time.yday != now.yday) or |
|
6 | if (time.yday != now.yday) or |
|
7 | (time.year != now.year) |
|
7 | (time.year != now.year) |
|
8 | - st = time.strftime("%x") |
|
8 | + st = time.strftime("%x ") |
|
9 | end |
|
9 | end |
|
10 | st + time.strftime("%X") |
|
10 | st + time.strftime("%X") |
|
11 | end |
|
11 | end |
@@ -26,13 +26,13 | |||||
|
26 | end |
|
26 | end |
|
27 |
|
27 | ||
|
28 | def format_submission(sub, count) |
|
28 | def format_submission(sub, count) |
|
29 |
- msg = "#{count} submission(s) |
|
29 | + msg = "#{count} submission(s)." |
|
30 | if count>0 |
|
30 | if count>0 |
|
31 | msg = msg + "Last on " + |
|
31 | msg = msg + "Last on " + |
|
32 | format_short_time(sub.submitted_at) + ' ' + |
|
32 | format_short_time(sub.submitted_at) + ' ' + |
|
33 |
- link_to('[source]',{:action => 'get_source', :id => sub.id}) |
|
33 | + link_to('[source]',{:action => 'get_source', :id => sub.id}) |
|
34 | - "<br />" |
|
||
|
35 | end |
|
34 | end |
|
|
35 | + msg += "<br/>" | ||
|
36 | if sub!=nil and sub.graded_at!=nil |
|
36 | if sub!=nil and sub.graded_at!=nil |
|
37 | msg = msg + 'Graded at ' + format_short_time(sub.graded_at) + ', score: '+ |
|
37 | msg = msg + 'Graded at ' + format_short_time(sub.graded_at) + ', score: '+ |
|
38 | sub.points.to_s + |
|
38 | sub.points.to_s + |
@@ -6,6 +6,7 | |||||
|
6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
7 | <title>Problems: <%= controller.action_name %></title> |
|
7 | <title>Problems: <%= controller.action_name %></title> |
|
8 | <%= stylesheet_link_tag 'scaffold' %> |
|
8 | <%= stylesheet_link_tag 'scaffold' %> |
|
|
9 | + <%= javascript_include_tag :defaults %> | ||
|
9 | </head> |
|
10 | </head> |
|
10 | <body> |
|
11 | <body> |
|
11 |
|
12 |
@@ -1,5 +1,5 | |||||
|
1 |
- < |
|
1 | + <div class="title">Hello <%=h @user.full_name %></div> |
|
2 | - (<%= Time.new %>) |
|
2 | + Current time is <%= format_short_time(Time.new) %>. |
|
3 |
|
3 | ||
|
4 | <div class="submitbox"> |
|
4 | <div class="submitbox"> |
|
5 | <% form_tag({:action => 'submit'}, :multipart => true) do %> |
|
5 | <% form_tag({:action => 'submit'}, :multipart => true) do %> |
@@ -22,7 +22,7 | |||||
|
22 | <div class="problist-each"> |
|
22 | <div class="problist-each"> |
|
23 | <div class="probname"> |
|
23 | <div class="probname"> |
|
24 | <%= "#{i+1}: #{p.full_name} (#{p.name})" %> |
|
24 | <%= "#{i+1}: #{p.full_name} (#{p.name})" %> |
|
25 | - <%= link_to '[task description]', p.url if p.url!=nil %> |
|
25 | + <%= link_to '[task description]', p.url if (p.url!=nil) and (p.url!='') %> |
|
26 | </div> |
|
26 | </div> |
|
27 | <div class="subinfo"> |
|
27 | <div class="subinfo"> |
|
28 | <%= format_submission(@prob_submissions[i][1], |
|
28 | <%= format_submission(@prob_submissions[i][1], |
@@ -33,18 +33,5 | |||||
|
33 | <% end %> |
|
33 | <% end %> |
|
34 | </div> |
|
34 | </div> |
|
35 |
|
35 | ||
|
36 | - <br /> |
|
||
|
37 | <hr /> |
|
36 | <hr /> |
|
38 | - <br /> |
|
||
|
39 |
|
37 | ||
|
40 | - <div class="submitbox"> |
|
||
|
41 | - <% form_tag({:action => 'submit'}, :multipart => true) do %> |
|
||
|
42 | - Problem: <%= select 'submission', 'problem_id', |
|
||
|
43 | - [['Specified in header','-1']] + |
|
||
|
44 | - @problems.collect {|p| [p.full_name, p.id]}, |
|
||
|
45 | - :selected => '-1' %> |
|
||
|
46 | - File: <%= file_field_tag 'file' %> |
|
||
|
47 | - <%= submit_tag 'Submit' %> |
|
||
|
48 | - <% end %> |
|
||
|
49 | - </div> |
|
||
|
50 | - |
|
@@ -6,16 +6,22 | |||||
|
6 |
|
6 | ||
|
7 | <table> |
|
7 | <table> |
|
8 | <tr> |
|
8 | <tr> |
|
9 | - <% for column in Problem.content_columns %> |
|
9 | + <th>Name</th> |
|
10 |
- <th> |
|
10 | + <th>Full name</th> |
|
11 | - <% end %> |
|
11 | + <th>Full score</th> |
|
|
12 | + <th>Date added</th> | ||
|
|
13 | + <th>Available</th> | ||
|
12 | </tr> |
|
14 | </tr> |
|
13 |
|
15 | ||
|
14 | <% for problem in @problems %> |
|
16 | <% for problem in @problems %> |
|
15 | <tr> |
|
17 | <tr> |
|
16 | - <% for column in Problem.content_columns %> |
|
18 | + <% @problem=problem %> |
|
17 | - <td><%=h problem.send(column.name) %></td> |
|
19 | + <td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %> |
|
18 | - <% end %> |
|
20 | + <td><%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %> |
|
|
21 | + <td><%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %> | ||
|
|
22 | + <td><%= problem.date_added %> | ||
|
|
23 | + <td><%= problem.available %> | ||
|
|
24 | + | ||
|
19 | <td><%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %></td> |
|
25 | <td><%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %></td> |
|
20 | <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td> |
|
26 | <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td> |
|
21 | <td><%= link_to '[Show]', :action => 'show', :id => problem %></td> |
|
27 | <td><%= link_to '[Show]', :action => 'show', :id => problem %></td> |
@@ -2,6 +2,13 | |||||
|
2 | font-size: 12px; |
|
2 | font-size: 12px; |
|
3 | } |
|
3 | } |
|
4 |
|
4 | ||
|
|
5 | + div.title { | ||
|
|
6 | + font-size: 20px; | ||
|
|
7 | + font-weight: bold; | ||
|
|
8 | + background: lightgreen; | ||
|
|
9 | + padding: 2px; | ||
|
|
10 | + } | ||
|
|
11 | + | ||
|
5 | div.problist-each { |
|
12 | div.problist-each { |
|
6 | margin-top: 2px; |
|
13 | margin-top: 2px; |
|
7 | margin-bottom: 2px |
|
14 | margin-bottom: 2px |
@@ -10,7 +17,8 | |||||
|
10 | div.usermenu { |
|
17 | div.usermenu { |
|
11 | border-top: thin solid grey; |
|
18 | border-top: thin solid grey; |
|
12 | border-bottom: thin solid grey; |
|
19 | border-bottom: thin solid grey; |
|
13 | - text-align: right |
|
20 | + text-align: right; |
|
|
21 | + font-size: 12px; | ||
|
14 | } |
|
22 | } |
|
15 |
|
23 | ||
|
16 | div.probname { |
|
24 | div.probname { |
@@ -24,7 +32,8 | |||||
|
24 | margin-left: 20px; |
|
32 | margin-left: 20px; |
|
25 | margin-top: 2px; |
|
33 | margin-top: 2px; |
|
26 | border-bottom: thin solid grey; |
|
34 | border-bottom: thin solid grey; |
|
27 | - border-left: thin solid grey |
|
35 | + border-left: thin solid grey; |
|
|
36 | + font-size: 12px; | ||
|
28 | } |
|
37 | } |
|
29 |
|
38 | ||
|
30 | div.compilermsgbody { |
|
39 | div.compilermsgbody { |
@@ -36,6 +45,7 | |||||
|
36 | padding: 5px; |
|
45 | padding: 5px; |
|
37 | color: white; |
|
46 | color: white; |
|
38 | background-color: #777777; |
|
47 | background-color: #777777; |
|
|
48 | + font-weight: bold; | ||
|
39 | } |
|
49 | } |
|
40 |
|
50 | ||
|
41 |
|
51 |
You need to be logged in to leave comments.
Login now