aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-08-29 18:22:53 +0000
committerfrancis <francis>2008-08-29 18:22:53 +0000
commit2a531155b5dbecd11486a80845e3b2374cc2cad7 (patch)
treee08e2c18b48e1f33c7b9afafa2232ae4b30c3788
parentda88548aedb2dc62fe2648f7d47a48358539050b (diff)
Find mime types we don't yet handle.
Icon for BMP
-rw-r--r--app/models/incoming_message.rb18
-rw-r--r--db/schema.rb5
-rw-r--r--public/images/icon_image_bmp_large.pngbin0 -> 2774 bytes
-rw-r--r--spec/controllers/request_controller_spec.rb4
-rw-r--r--todo.txt16
5 files changed, 29 insertions, 14 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 2f666a318..bb40adc92 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.134 2008-08-22 04:18:18 francis Exp $
+# $Id: incoming_message.rb,v 1.135 2008-08-29 18:22:54 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -73,6 +73,7 @@ $file_extension_to_mime_type = {
"gif" => 'image/gif',
"jpg" => 'image/jpeg', # XXX add jpeg
"png" => 'image/png',
+ "bmp" => 'image/bmp',
"html" => 'text/html', # XXX add htm
"zip" => 'application/zip'
}
@@ -804,6 +805,21 @@ class IncomingMessage < ActiveRecord::Base
self.destroy
end
end
+
+ # Search all info requests for
+ def IncomingMessage.find_all_unknown_mime_types
+ for incoming_message in IncomingMessage.find(:all)
+ for attachment in incoming_message.get_attachments_for_display
+ raise "internal error incoming_message " + incoming_message.id.to_s if attachment.content_type.nil?
+ if mimetype_to_extension(attachment.content_type).nil?
+ STDERR.puts "Unknown type for /request/" + incoming_message.info_request.id.to_s + "#incoming-"+incoming_message.id.to_s
+ STDERR.puts " " + attachment.filename.to_s + " " + attachment.content_type.to_s
+ end
+ end
+ end
+
+ return nil
+ end
end
diff --git a/db/schema.rb b/db/schema.rb
index 99ced4c04..c8ce541a8 100644
--- 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 => 63) do
+ActiveRecord::Schema.define(:version => 64) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -51,6 +51,9 @@ ActiveRecord::Schema.define(:version => 63) do
t.integer "comment_id"
end
+ add_index "info_request_events", ["created_at"], :name => "index_info_request_events_on_created_at"
+ add_index "info_request_events", ["info_request_id"], :name => "index_info_request_events_on_info_request_id"
+
create_table "info_requests", :force => true do |t|
t.text "title", :null => false
t.integer "user_id", :null => false
diff --git a/public/images/icon_image_bmp_large.png b/public/images/icon_image_bmp_large.png
new file mode 100644
index 000000000..f6e8dbaed
--- /dev/null
+++ b/public/images/icon_image_bmp_large.png
Binary files differ
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 8c1c99200..d6856d421 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -401,7 +401,7 @@ describe RequestController, "comment alerts" do
# updated created_at timestamp, so is in last month (as alerts are only
# for comments in last month, see RequestMailer.alert_comment_on_request
existing_comment = info_requests(:fancy_dog_request).comments[0]
- existing_comment.created_at = Time.now()
+ existing_comment.created_at = Time.now() - 2.weeks
existing_comment.save!
# send comment alert
@@ -437,7 +437,7 @@ describe RequestController, "comment alerts" do
# XXX check mail_url here somehow, can't call comment_url like this:
# mail_url.should == comment_url(comments(:silly_comment))
- #STDERR.puts mail.body
+ STDERR.puts mail.body
end
end
diff --git a/todo.txt b/todo.txt
index b615affd2..53333dff9 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,6 @@
+ for e in info_request.info_request_events.sort { |a,b| a.created_at <=> b.created_at}.reverse
+
+
Site move:
Install PostgresSQL 8.3
Move database
@@ -9,12 +12,6 @@ Next
Test: Check where followups are going to now
Test: Check new .zips are being indexed
-"Then you will be emailed whenever 'Martin Stabe' requests something or gets a
-response" doesn't word wrap in confirmation email, and no full stop.
-
-Email subjects badly escaped
-Subject: Confirm you want to be emailed about requests to 'HM Revenue &amp; Customs'
-
VSD files vsdump - example in zip file
http://www.whatdotheyknow.com/request/dog_control_orders#incoming-3510
doing file RESPONSE/Internal documents/Briefing with Contact Islington/Contact Islington Flowchart Jul 08.vsd content type
@@ -24,7 +21,6 @@ Comments interleaved with body
- Annotation thing too far down when much sidebar e.g. http://localhost:3000/request/heya#outgoing-199
- Put classification box above annotation one?
- - Test spell checker
- Flag bad comments
- Delete comments from admin interface
- Check annotation email alerts are working (e.g. when subscribed to a request)
@@ -50,18 +46,18 @@ Grrr - so here I wanted to clarify my request, but don't want the timer to be re
user/show.rhtml sidebar vs. generic sidebar? (ask Tommy)
There is grey on grey text in header? bad idea?
-Make it clearer people should ask for documents
-http://www.whatdotheyknow.com/request/unusual_markings_in_the_uk_skies
-
Clear out all the need admin attention requests
Clear out all the need classifying requests
Admin:
+ Optimise loading of front admin page
Have internal links to different parts of request page
Somehow fold up the enormous pages on many admin pages
Search FAQ etc.
+Icon for annotations in search results
+
Later
=====