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: 46 inserted, 10 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 | </p> |
|
9 | </p> |
|
10 |
|
10 | ||
|
11 | <p> |
|
11 | <p> |
|
|
12 | + <b>Notes</b> (shown internally, used to organize announcements)<br /> | ||
|
|
13 | + <%= f.text_field :notes %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + <p> | ||
|
12 | <b>Body</b><br /> |
|
17 | <b>Body</b><br /> |
|
13 | <%= f.text_area :body %> |
|
18 | <%= f.text_area :body %> |
|
14 | </p> |
|
19 | </p> |
@@ -6,19 +6,30 | |||||
|
6 |
|
6 | ||
|
7 | <%= link_to 'New announcement', new_announcement_path %> |
|
7 | <%= link_to 'New announcement', new_announcement_path %> |
|
8 |
|
8 | ||
|
9 | - <table> |
|
9 | + <table class="info"> |
|
10 | - <tr> |
|
10 | + <tr class="info-head"> |
|
11 |
- <th> |
|
11 | + <th>Updated</th> |
|
12 |
- <th> |
|
12 | + <th>Announcement</th> |
|
13 | <th>Author</th> |
|
13 | <th>Author</th> |
|
14 | <th>Published</th> |
|
14 | <th>Published</th> |
|
|
15 | + <th></th> | ||
|
|
16 | + <th></th> | ||
|
|
17 | + <th></th> | ||
|
15 | </tr> |
|
18 | </tr> |
|
16 |
|
19 | ||
|
17 | <% for announcement in @announcements %> |
|
20 | <% for announcement in @announcements %> |
|
18 | - <tr> |
|
21 | + <tr class="info-<%= cycle 'odd', 'even' %>"> |
|
19 | <% @announcement = announcement %> |
|
22 | <% @announcement = announcement %> |
|
20 |
- <td><%= |
|
23 | + <td><%= time_ago_in_words announcement.updated_at %></td> |
|
21 | - <td><%=h announcement.body %></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 | <td><%=h announcement.author %></td> |
|
33 | <td><%=h announcement.author %></td> |
|
23 | <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> |
|
34 | <td><%= in_place_editor_field :announcement, :published, {}, :rows => 1 %></td> |
|
24 | <td><%= link_to 'Show', announcement %></td> |
|
35 | <td><%= link_to 'Show', announcement %></td> |
@@ -9,6 +9,11 | |||||
|
9 | </p> |
|
9 | </p> |
|
10 |
|
10 | ||
|
11 | <p> |
|
11 | <p> |
|
|
12 | + <b>Notes</b> (shown internally, used to organize announcements)<br /> | ||
|
|
13 | + <%= f.text_field :notes %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + <p> | ||
|
12 | <b>Body</b><br /> |
|
17 | <b>Body</b><br /> |
|
13 | <%= f.text_area :body %> |
|
18 | <%= f.text_area :body %> |
|
14 | </p> |
|
19 | </p> |
@@ -9,6 +9,11 | |||||
|
9 | </p> |
|
9 | </p> |
|
10 |
|
10 | ||
|
11 | <p> |
|
11 | <p> |
|
|
12 | + <b>Notes:</b> | ||
|
|
13 | + <%=h @announcement.notes %> | ||
|
|
14 | + </p> | ||
|
|
15 | + | ||
|
|
16 | + <p> | ||
|
12 | <b>Body:</b> |
|
17 | <b>Body:</b> |
|
13 | <%=h @announcement.body %> |
|
18 | <%=h @announcement.body %> |
|
14 | </p> |
|
19 | </p> |
@@ -9,7 +9,7 | |||||
|
9 | # |
|
9 | # |
|
10 | # It's strongly recommended to check this file into your version control system. |
|
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 | create_table "announcements", :force => true do |t| |
|
14 | create_table "announcements", :force => true do |t| |
|
15 | t.string "author" |
|
15 | t.string "author" |
@@ -20,6 +20,7 | |||||
|
20 | t.boolean "frontpage", :default => false |
|
20 | t.boolean "frontpage", :default => false |
|
21 | t.boolean "contest_only", :default => false |
|
21 | t.boolean "contest_only", :default => false |
|
22 | t.string "title" |
|
22 | t.string "title" |
|
|
23 | + t.string "notes" | ||
|
23 | end |
|
24 | end |
|
24 |
|
25 | ||
|
25 | create_table "configurations", :force => true do |t| |
|
26 | create_table "configurations", :force => true do |t| |
You need to be logged in to leave comments.
Login now