Description:
better announcement effects
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@413 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
r193:e9aaeb17b5bc - - 7 files changed: 58 inserted, 17 deleted
@@ -0,0 +1,9 | |||
|
1 | + class AddTitleToAnnouncements < ActiveRecord::Migration | |
|
2 | + def self.up | |
|
3 | + add_column :announcements, :title, :string | |
|
4 | + end | |
|
5 | + | |
|
6 | + def self.down | |
|
7 | + remove_column :announcements, :title | |
|
8 | + end | |
|
9 | + end |
@@ -4,6 +4,11 | |||
|
4 | 4 | |
|
5 | 5 | <% form_for(@announcement) do |f| %> |
|
6 | 6 | <p> |
|
7 | + <b>Title</b><br /> | |
|
8 | + <%= f.text_field :title %> | |
|
9 | + </p> | |
|
10 | + | |
|
11 | + <p> | |
|
7 | 12 | <b>Body</b><br /> |
|
8 | 13 | <%= f.text_area :body %> |
|
9 | 14 | </p> |
@@ -8,6 +8,7 | |||
|
8 | 8 | |
|
9 | 9 | <table> |
|
10 | 10 | <tr> |
|
11 | + <th>Title</th> | |
|
11 | 12 | <th>Body</th> |
|
12 | 13 | <th>Author</th> |
|
13 | 14 | <th>Published</th> |
@@ -16,6 +17,7 | |||
|
16 | 17 | <% for announcement in @announcements %> |
|
17 | 18 | <tr> |
|
18 | 19 | <% @announcement = announcement %> |
|
20 | + <td><%=h announcement.title %></td> | |
|
19 | 21 | <td><%=h announcement.body %></td> |
|
20 | 22 | <td><%=h announcement.author %></td> |
|
21 | 23 | <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> |
@@ -4,6 +4,11 | |||
|
4 | 4 | |
|
5 | 5 | <% form_for(@announcement) do |f| %> |
|
6 | 6 | <p> |
|
7 | + <b>Title</b><br /> | |
|
8 | + <%= f.text_field :title %> | |
|
9 | + </p> | |
|
10 | + | |
|
11 | + <p> | |
|
7 | 12 | <b>Body</b><br /> |
|
8 | 13 | <%= f.text_area :body %> |
|
9 | 14 | </p> |
@@ -4,6 +4,11 | |||
|
4 | 4 | </p> |
|
5 | 5 | |
|
6 | 6 | <p> |
|
7 | + <b>Title:</b> | |
|
8 | + <%=h @announcement.title %> | |
|
9 | + </p> | |
|
10 | + | |
|
11 | + <p> | |
|
7 | 12 | <b>Body:</b> |
|
8 | 13 | <%=h @announcement.body %> |
|
9 | 14 | </p> |
@@ -1,17 +1,19 | |||
|
1 |
- .announcement{:id => "announcement-#{announcement.id}", :style => "#{'opacity: 0 |
|
|
2 | - -# .announcement-title | |
|
3 | - -# .toggles | |
|
4 | - -# %a{:href => '#', :onclick => "$(\"announcement-body-#{announcement.id}\").hide(); return false;"} | |
|
5 | - -# [hide] | |
|
6 | - -# %a{:href => '#', :onclick => "$(\"announcement-body-#{announcement.id}\").show(); return false;"} | |
|
7 | - -# [show] | |
|
8 | - -# Announcement Title | |
|
9 | - .announcement-body{:id => "announcement-body-#{announcement.id}"} | |
|
10 | - = markdown(announcement.body) | |
|
11 | - -#.pub-info | |
|
12 | - -# %p= "#{announcement.author}, #{announcement.created_at}" | |
|
13 | - :javascript | |
|
14 | - Announcement.updateRecentId(#{announcement.id}); | |
|
15 | - - if (defined? announcement_effect) and announcement_effect | |
|
1 | + .announcement{:id => "announcement-#{announcement.id}", :style => "#{'display: none; opacity: 0' if (defined? announcement_effect) and announcement_effect }"} | |
|
2 | + %div | |
|
3 | + .announcement-title | |
|
4 | + -# .toggles | |
|
5 | + -# %a{:href => '#', :onclick => "$(\"announcement-body-#{announcement.id}\").blindUp({duration: 0.2}); return false;"} | |
|
6 | + -# [hide] | |
|
7 | + -# %a{:href => '#', :onclick => "$(\"announcement-body-#{announcement.id}\").blindDown({duration: 0.2}); return false;"} | |
|
8 | + -# [show] | |
|
9 | + = announcement.title | |
|
10 | + .announcement-body{:id => "announcement-body-#{announcement.id}"} | |
|
11 | + = markdown(announcement.body) | |
|
12 | + -#.pub-info | |
|
13 | + -# %p= "#{announcement.author}, #{announcement.created_at}" | |
|
16 | 14 | :javascript |
|
17 |
- |
|
|
15 | + Announcement.updateRecentId(#{announcement.id}); | |
|
16 | + - if (defined? announcement_effect) and announcement_effect | |
|
17 | + :javascript | |
|
18 | + $("announcement-#{announcement.id}").blindDown({duration: 0.2}); | |
|
19 | + $("announcement-#{announcement.id}").appear({duration: 0.5, queue: 'end'}); |
@@ -9,7 +9,7 | |||
|
9 | 9 | # |
|
10 | 10 | # It's strongly recommended to check this file into your version control system. |
|
11 | 11 | |
|
12 |
- ActiveRecord::Schema.define(:version => 20090 |
|
|
12 | + ActiveRecord::Schema.define(:version => 20090815171610) do | |
|
13 | 13 | |
|
14 | 14 | create_table "announcements", :force => true do |t| |
|
15 | 15 | t.string "author" |
@@ -19,6 +19,7 | |||
|
19 | 19 | t.datetime "updated_at" |
|
20 | 20 | t.boolean "frontpage", :default => false |
|
21 | 21 | t.boolean "contest_only", :default => false |
|
22 | + t.string "title" | |
|
22 | 23 | end |
|
23 | 24 | |
|
24 | 25 | create_table "configurations", :force => true do |t| |
@@ -42,6 +43,18 | |||
|
42 | 43 | t.datetime "updated_at" |
|
43 | 44 | end |
|
44 | 45 | |
|
46 | + create_table "grader_messages", :force => true do |t| | |
|
47 | + t.integer "grader_process_id" | |
|
48 | + t.integer "command" | |
|
49 | + t.string "options" | |
|
50 | + t.integer "target_id" | |
|
51 | + t.boolean "accepted" | |
|
52 | + t.boolean "completed" | |
|
53 | + t.integer "accepting_grader_process_id" | |
|
54 | + t.datetime "created_at" | |
|
55 | + t.datetime "updated_at" | |
|
56 | + end | |
|
57 | + | |
|
45 | 58 | create_table "grader_processes", :force => true do |t| |
|
46 | 59 | t.string "host", :limit => 20 |
|
47 | 60 | t.integer "pid" |
You need to be logged in to leave comments.
Login now