Description:
styling announcements, added notes
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

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