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 | 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 | 9 | def index |
|
6 | 10 | list |
|
7 | 11 | render :action => 'list' |
@@ -5,7 +5,7 | |||
|
5 | 5 | st = '' |
|
6 | 6 | if (time.yday != now.yday) or |
|
7 | 7 | (time.year != now.year) |
|
8 | - st = time.strftime("%x") | |
|
8 | + st = time.strftime("%x ") | |
|
9 | 9 | end |
|
10 | 10 | st + time.strftime("%X") |
|
11 | 11 | end |
@@ -26,13 +26,13 | |||
|
26 | 26 | end |
|
27 | 27 | |
|
28 | 28 | def format_submission(sub, count) |
|
29 |
- msg = "#{count} submission(s) |
|
|
29 | + msg = "#{count} submission(s)." | |
|
30 | 30 | if count>0 |
|
31 | 31 | msg = msg + "Last on " + |
|
32 | 32 | format_short_time(sub.submitted_at) + ' ' + |
|
33 |
- link_to('[source]',{:action => 'get_source', :id => sub.id}) |
|
|
34 | - "<br />" | |
|
33 | + link_to('[source]',{:action => 'get_source', :id => sub.id}) | |
|
35 | 34 | end |
|
35 | + msg += "<br/>" | |
|
36 | 36 | if sub!=nil and sub.graded_at!=nil |
|
37 | 37 | msg = msg + 'Graded at ' + format_short_time(sub.graded_at) + ', score: '+ |
|
38 | 38 | sub.points.to_s + |
@@ -6,6 +6,7 | |||
|
6 | 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
7 | 7 | <title>Problems: <%= controller.action_name %></title> |
|
8 | 8 | <%= stylesheet_link_tag 'scaffold' %> |
|
9 | + <%= javascript_include_tag :defaults %> | |
|
9 | 10 | </head> |
|
10 | 11 | <body> |
|
11 | 12 |
@@ -1,5 +1,5 | |||
|
1 |
- < |
|
|
2 | - (<%= Time.new %>) | |
|
1 | + <div class="title">Hello <%=h @user.full_name %></div> | |
|
2 | + Current time is <%= format_short_time(Time.new) %>. | |
|
3 | 3 | |
|
4 | 4 | <div class="submitbox"> |
|
5 | 5 | <% form_tag({:action => 'submit'}, :multipart => true) do %> |
@@ -22,7 +22,7 | |||
|
22 | 22 | <div class="problist-each"> |
|
23 | 23 | <div class="probname"> |
|
24 | 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 | 26 | </div> |
|
27 | 27 | <div class="subinfo"> |
|
28 | 28 | <%= format_submission(@prob_submissions[i][1], |
@@ -33,18 +33,5 | |||
|
33 | 33 | <% end %> |
|
34 | 34 | </div> |
|
35 | 35 | |
|
36 | - <br /> | |
|
37 | 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 | 7 | <table> |
|
8 | 8 | <tr> |
|
9 | - <% for column in Problem.content_columns %> | |
|
10 |
- <th> |
|
|
11 | - <% end %> | |
|
9 | + <th>Name</th> | |
|
10 | + <th>Full name</th> | |
|
11 | + <th>Full score</th> | |
|
12 | + <th>Date added</th> | |
|
13 | + <th>Available</th> | |
|
12 | 14 | </tr> |
|
13 | 15 | |
|
14 | 16 | <% for problem in @problems %> |
|
15 | 17 | <tr> |
|
16 | - <% for column in Problem.content_columns %> | |
|
17 | - <td><%=h problem.send(column.name) %></td> | |
|
18 | - <% end %> | |
|
18 | + <% @problem=problem %> | |
|
19 | + <td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %> | |
|
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 | 25 | <td><%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %></td> |
|
20 | 26 | <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td> |
|
21 | 27 | <td><%= link_to '[Show]', :action => 'show', :id => problem %></td> |
@@ -2,6 +2,13 | |||
|
2 | 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 | 12 | div.problist-each { |
|
6 | 13 | margin-top: 2px; |
|
7 | 14 | margin-bottom: 2px |
@@ -10,7 +17,8 | |||
|
10 | 17 | div.usermenu { |
|
11 | 18 | border-top: thin solid grey; |
|
12 | 19 | border-bottom: thin solid grey; |
|
13 | - text-align: right | |
|
20 | + text-align: right; | |
|
21 | + font-size: 12px; | |
|
14 | 22 | } |
|
15 | 23 | |
|
16 | 24 | div.probname { |
@@ -24,7 +32,8 | |||
|
24 | 32 | margin-left: 20px; |
|
25 | 33 | margin-top: 2px; |
|
26 | 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 | 39 | div.compilermsgbody { |
@@ -36,6 +45,7 | |||
|
36 | 45 | padding: 5px; |
|
37 | 46 | color: white; |
|
38 | 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