Description:
styling announcements, added notes
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r306:fbe0e6c466af - - 8 files changed: 47 inserted, 11 deleted
@@ -0,0 +1,9 | |||
|
1 | + class AddNotesToAnnouncements < ActiveRecord::Migration | |
|
2 | + def self.up | |
|
3 | + add_column :announcements, :notes, :string | |
|
4 | + end | |
|
5 | + | |
|
6 | + def self.down | |
|
7 | + remove_column :announcements, :notes | |
|
8 | + end | |
|
9 | + end |
@@ -9,6 +9,11 | |||
|
9 | 9 | </p> |
|
10 | 10 | |
|
11 | 11 | <p> |
|
12 | + <b>Notes</b> (shown internally, used to organize announcements)<br /> | |
|
13 | + <%= f.text_field :notes %> | |
|
14 | + </p> | |
|
15 | + | |
|
16 | + <p> | |
|
12 | 17 | <b>Body</b><br /> |
|
13 | 18 | <%= f.text_area :body %> |
|
14 | 19 | </p> |
@@ -6,19 +6,30 | |||
|
6 | 6 | |
|
7 | 7 | <%= link_to 'New announcement', new_announcement_path %> |
|
8 | 8 | |
|
9 | - <table> | |
|
10 | - <tr> | |
|
11 |
- <th> |
|
|
12 |
- <th> |
|
|
9 | + <table class="info"> | |
|
10 | + <tr class="info-head"> | |
|
11 | + <th>Updated</th> | |
|
12 | + <th>Announcement</th> | |
|
13 | 13 | <th>Author</th> |
|
14 | - <th>Published</th> | |
|
14 | + <th>Published</th> | |
|
15 | + <th></th> | |
|
16 | + <th></th> | |
|
17 | + <th></th> | |
|
15 | 18 | </tr> |
|
16 | 19 | |
|
17 | 20 | <% for announcement in @announcements %> |
|
18 | - <tr> | |
|
21 | + <tr class="info-<%= cycle 'odd', 'even' %>"> | |
|
19 | 22 | <% @announcement = announcement %> |
|
20 |
- <td><%= |
|
|
21 | - <td><%=h announcement.body %></td> | |
|
23 | + <td><%= time_ago_in_words announcement.updated_at %></td> | |
|
24 | + <td> | |
|
25 | + <% if !announcement.title.blank? %> | |
|
26 | + <b>Title:</b> <%=h announcement.title %><br/> | |
|
27 | + <% end %> | |
|
28 | + <% if !announcement.notes.blank? %> | |
|
29 | + <b>Notes: <%=h announcement.notes %></b><br/> | |
|
30 | + <% end %> | |
|
31 | + <%=h announcement.body %> | |
|
32 | + </td> | |
|
22 | 33 | <td><%=h announcement.author %></td> |
|
23 | 34 | <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> |
|
24 | 35 | <td><%= link_to 'Show', announcement %></td> |
@@ -9,6 +9,11 | |||
|
9 | 9 | </p> |
|
10 | 10 | |
|
11 | 11 | <p> |
|
12 | + <b>Notes</b> (shown internally, used to organize announcements)<br /> | |
|
13 | + <%= f.text_field :notes %> | |
|
14 | + </p> | |
|
15 | + | |
|
16 | + <p> | |
|
12 | 17 | <b>Body</b><br /> |
|
13 | 18 | <%= f.text_area :body %> |
|
14 | 19 | </p> |
@@ -9,6 +9,11 | |||
|
9 | 9 | </p> |
|
10 | 10 | |
|
11 | 11 | <p> |
|
12 | + <b>Notes:</b> | |
|
13 | + <%=h @announcement.notes %> | |
|
14 | + </p> | |
|
15 | + | |
|
16 | + <p> | |
|
12 | 17 | <b>Body:</b> |
|
13 | 18 | <%=h @announcement.body %> |
|
14 | 19 | </p> |
@@ -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 => 20100 |
|
|
12 | + ActiveRecord::Schema.define(:version => 20100506163112) do | |
|
13 | 13 | |
|
14 | 14 | create_table "announcements", :force => true do |t| |
|
15 | 15 | t.string "author" |
@@ -20,6 +20,7 | |||
|
20 | 20 | t.boolean "frontpage", :default => false |
|
21 | 21 | t.boolean "contest_only", :default => false |
|
22 | 22 | t.string "title" |
|
23 | + t.string "notes" | |
|
23 | 24 | end |
|
24 | 25 | |
|
25 | 26 | create_table "configurations", :force => true do |t| |
You need to be logged in to leave comments.
Login now