<% @announcement = announcement %>
- <%=h announcement.title %> |
- <%=h announcement.body %> |
+ <%= time_ago_in_words announcement.updated_at %> |
+
+ <% if !announcement.title.blank? %>
+ Title: <%=h announcement.title %>
+ <% end %>
+ <% if !announcement.notes.blank? %>
+ Notes: <%=h announcement.notes %>
+ <% end %>
+ <%=h announcement.body %>
+ |
<%=h announcement.author %> |
<%= in_place_editor_field :announcement, :published, {}, :rows => 1 %> |
<%= link_to 'Show', announcement %> |
diff --git a/app/views/announcements/new.html.erb b/app/views/announcements/new.html.erb
--- a/app/views/announcements/new.html.erb
+++ b/app/views/announcements/new.html.erb
@@ -9,6 +9,11 @@
+ Notes (shown internally, used to organize announcements)
+ <%= f.text_field :notes %>
+
+
+
Body
<%= f.text_area :body %>
diff --git a/app/views/announcements/show.html.erb b/app/views/announcements/show.html.erb
--- a/app/views/announcements/show.html.erb
+++ b/app/views/announcements/show.html.erb
@@ -9,6 +9,11 @@
+ Notes:
+ <%=h @announcement.notes %>
+
+
+
Body:
<%=h @announcement.body %>
diff --git a/db/migrate/20100506163112_add_notes_to_announcements.rb b/db/migrate/20100506163112_add_notes_to_announcements.rb
new file mode 100644
--- /dev/null
+++ b/db/migrate/20100506163112_add_notes_to_announcements.rb
@@ -0,0 +1,9 @@
+class AddNotesToAnnouncements < ActiveRecord::Migration
+ def self.up
+ add_column :announcements, :notes, :string
+ end
+
+ def self.down
+ remove_column :announcements, :notes
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100328123325) do
+ActiveRecord::Schema.define(:version => 20100506163112) do
create_table "announcements", :force => true do |t|
t.string "author"
@@ -20,6 +20,7 @@
t.boolean "frontpage", :default => false
t.boolean "contest_only", :default => false
t.string "title"
+ t.string "notes"
end
create_table "configurations", :force => true do |t|
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -77,7 +77,7 @@
tr.info-odd {
background: #eeeeee; }
tr.info-even {
- background: #f9f9f9; }
+ background: #fcfcfc; }
.infobox {
background: #eeeeff;
diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass
--- a/public/stylesheets/sass/application.sass
+++ b/public/stylesheets/sass/application.sass
@@ -99,7 +99,7 @@
background: #eeeeee
&.info-even
- background: #f9f9f9
+ background: #fcfcfc
=basicbox
background: #eeeeff