Description:
[web] better ui for announcement and prob stat git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@195 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

r103:c7b351b3b685 - - 3 files changed: 6 inserted, 2 deleted

@@ -8,7 +8,8
8 # GET /announcements
8 # GET /announcements
9 # GET /announcements.xml
9 # GET /announcements.xml
10 def index
10 def index
11 - @announcements = Announcement.find(:all)
11 + @announcements = Announcement.find(:all,
12 + :order => "created_at DESC")
12
13
13 respond_to do |format|
14 respond_to do |format|
14 format.html # index.html.erb
15 format.html # index.html.erb
@@ -30,7 +30,8
30 "(SELECT MAX(id) FROM submissions AS subs " +
30 "(SELECT MAX(id) FROM submissions AS subs " +
31 "WHERE subs.user_id = submissions.user_id AND " +
31 "WHERE subs.user_id = submissions.user_id AND " +
32 "problem_id = " + problem_id.to_s + " " +
32 "problem_id = " + problem_id.to_s + " " +
33 - "GROUP BY user_id)")
33 + "GROUP BY user_id) " +
34 + "ORDER BY user_id")
34 end
35 end
35
36
36 def self.find_last_for_all_available_problems(user_id)
37 def self.find_last_for_all_available_problems(user_id)
@@ -5,6 +5,8
5
5
6 <h1>Listing announcements</h1>
6 <h1>Listing announcements</h1>
7
7
8 + <%= link_to 'New announcement', new_announcement_path %>
9 +
8 <table>
10 <table>
9 <tr>
11 <tr>
10 <th>Body</th>
12 <th>Body</th>
You need to be logged in to leave comments. Login now