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 |
@@ -6,12 +6,17 | |||
|
6 | 6 | <p> |
|
7 | 7 | <b>Title</b><br /> |
|
8 | 8 | <%= f.text_field :title %> |
|
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> |
|
15 | 20 | |
|
16 | 21 | <p> |
|
17 | 22 | <b>Author</b><br /> |
@@ -3,25 +3,36 | |||
|
3 | 3 | <% end %> |
|
4 | 4 | |
|
5 | 5 | <h1>Listing announcements</h1> |
|
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> |
|
25 | 36 | <td><%= link_to 'Edit', edit_announcement_path(announcement) %></td> |
|
26 | 37 | <td><%= link_to 'Destroy', announcement, :confirm => 'Are you sure?', :method => :delete %></td> |
|
27 | 38 | </tr> |
@@ -6,12 +6,17 | |||
|
6 | 6 | <p> |
|
7 | 7 | <b>Title</b><br /> |
|
8 | 8 | <%= f.text_field :title %> |
|
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> |
|
15 | 20 | |
|
16 | 21 | <p> |
|
17 | 22 | <b>Author</b><br /> |
@@ -6,12 +6,17 | |||
|
6 | 6 | <p> |
|
7 | 7 | <b>Title:</b> |
|
8 | 8 | <%=h @announcement.title %> |
|
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> |
|
15 | 20 | |
|
16 | 21 | <p> |
|
17 | 22 | <b>Published:</b> |
@@ -6,23 +6,24 | |||
|
6 | 6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
7 | 7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
8 | 8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
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" |
|
16 | 16 | t.text "body" |
|
17 | 17 | t.boolean "published" |
|
18 | 18 | t.datetime "created_at" |
|
19 | 19 | t.datetime "updated_at" |
|
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| |
|
26 | 27 | t.string "key" |
|
27 | 28 | t.string "value_type" |
|
28 | 29 | t.string "value" |
@@ -74,13 +74,13 | |||
|
74 | 74 | tr.info-head { |
|
75 | 75 | background: #777777; |
|
76 | 76 | color: white; } |
|
77 | 77 | tr.info-odd { |
|
78 | 78 | background: #eeeeee; } |
|
79 | 79 | tr.info-even { |
|
80 |
- background: #f |
|
|
80 | + background: #fcfcfc; } | |
|
81 | 81 | |
|
82 | 82 | .infobox { |
|
83 | 83 | background: #eeeeff; |
|
84 | 84 | border: 1px dotted #99aaee; |
|
85 | 85 | padding: 5px; |
|
86 | 86 | margin: 10px 0px; |
You need to be logged in to leave comments.
Login now