Permalink
Browse files

Merge branch 'master' of git://github.com/ncr/rubyflow into ncr/master

Conflicts:

	db/schema.rb
  • Loading branch information...
technicalpickles committed Aug 13, 2008
2 parents 2d53a75 + c7b6f3e commit c8668ab804f6e06fc68324ad29fdab3a4b1a7d10
@@ -13,32 +13,7 @@ def title
end
def safe(txt)
- # Poor mans' sanitization!
-
- txt = h(txt)
- txt.gsub!(/\"/, '"')
- txt.gsub!(/\>/, '>')
-
- txt.gsub!(/\n/, '<br />')
-
- txt.gsub!(/\&lt;a href/, '<a href')
- txt.gsub!(/\&lt;\/a>/, '</a>')
-
- txt.gsub!(/\&lt;\/blockquote>/, '</blockquote>')
- txt.gsub!(/\&lt;\/code>/, '</code>')
- txt.gsub!(/\&lt;\/b>/, '</b>')
- txt.gsub!(/\&lt;\/strong>/, '</strong>')
- txt.gsub!(/\&lt;\/i>/, '</i>')
- txt.gsub!(/\&lt;\/em>/, '</em>')
-
- txt.gsub!(/\&lt;blockquote>/, '<blockquote>')
- txt.gsub!(/\&lt;code>/, '<code>')
- txt.gsub!(/\&lt;b>/, '<b>')
- txt.gsub!(/\&lt;strong>/, '<strong>')
- txt.gsub!(/\&lt;i>/, '<i>')
- txt.gsub!(/\&lt;em>/, '<em>')
-
- txt
+ sanitize(txt, :tags => %w(a p code b strong i em blockquote), :attributes => %w(href)).split("\n").join("\n<br />")
end
end
@@ -10,18 +10,11 @@ def user_link(item)
end
def star_link(item)
- starred = item.is_starred_by_user(current_user)
- path = starred ? item_remove_star_path(item) : item_add_star_path(item)
- if starred
+ if item.is_starred_by_user(current_user)
return " &ndash; " + content_tag(:span, link_to("unstar this post", item_remove_star_path(item), :class => item.starred_class(current_user)), :class => "star")
end
end
- # Convert URLs in text automatically to links
- def auto_link(text)
- text.gsub(/ (http:\/\/[^ !,\?]+)/, ' <a href="\1">\1</a>')
- end
-
# Shows the time left to edit the current item, or nil if it's always allowed
def edit_time_left(item)
diff = Time.now - item.updated_at
@@ -12,7 +12,6 @@
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
-config.action_view.cache_template_extensions = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
View
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 15) do
+ActiveRecord::Schema.define(:version => 17) do
create_table "categories", :force => true do |t|
t.string "name"
@@ -35,13 +35,14 @@
t.text "content"
t.text "metadata"
t.string "name"
- t.text "tags", :limit => 255
+ t.text "tags", :limit => 255
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "byline"
- t.integer "comments_count", :default => 0
- t.integer "stars_count", :default => 0
+ t.integer "comments_count", :default => 0
+ t.integer "stars_count", :default => 0
+ t.integer "spam_reports_count", :default => 0
end
create_table "open_id_authentication_associations", :force => true do |t|
@@ -63,6 +64,13 @@
t.binary "value"
end
+ create_table "spam_reports", :force => true do |t|
+ t.integer "item_id"
+ t.integer "user_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "stars", :force => true do |t|
t.integer "user_id"
t.integer "item_id"
@@ -129,14 +129,14 @@ A.home {
font-weight: bold;
}
+/* Commented for annoyance-factor (gray gets annoying / ruins the look imho)
.even {
background-color: #ffffff;
}
.odd {
background-color: #f0f0f0;
-
-}
+}*/
BODY.inner .entry {
line-height: 1.6em;

0 comments on commit c8668ab

Please sign in to comment.