aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
...
* | | Merge branch 'feature/1269-improve-quoting-recognition' into rails-3-developLouise Crow2014-01-27-0/+4
|\ \ \
| * | | Handle gmail-style quoting from the HTML part of a mail.Louise Crow2014-01-22-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We already handled this type of quoting when coming directly from a text part of a mail, but when we choose the HTML part as the main part and then convert it to text, the 'On [date] <email> person said:' part can get split over two lines.
* | | | Merge remote-tracking branch 'origin/translatable-report-reasons' into ↵Louise Crow2014-01-27-2/+6
|\ \ \ \ | | | | | | | | | | | | | | | rails-3-develop
| * | | | The reasons for making a report need to be translatableMark Longair2014-01-02-2/+6
| | |/ / | |/| | | | | | | | | | Thanks to György Peng for pointing out this omission.
* | | | Merge branch 'feature/fix-profile-photo-errors' into rails-3-developLouise Crow2014-01-27-4/+8
|\ \ \ \ | |_|/ / |/| | |
| * | | Make custom error messages translated.Louise Crow2014-01-08-4/+8
| |/ /
* / / Ignore translations when finding the internal admin bodyMark Longair2014-01-14-15/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you change the default locale after having set up your site, and exception would always be thrown by PublicBody.internal_admin_body, which looks up that distinguished body based on url_name. Since that's a translated field, and there would be no translation for it in the new locale, it wouldn't be found, and the code would try to create a second internal_admin_body, which would fail because of the url_name being non-unque in public_bodies. There are various ways of fixing this; the one introduced in this commit is to use raw SQL to find the public body, bypassing the public_body_translations table. Fixes #1001.
* | Merge branch 'feature/locale-underscore-fixes' into rails-3-developLouise Crow2013-12-09-3/+4
|\ \
| * | Make sure globalize uses the right locale version when updating.Louise Crow2013-12-05-2/+2
| | |
| * | Search for bodies using the underscore version of the locale.Louise Crow2013-12-05-1/+2
| |/
* / Fix the command-line CSV importer under Ruby 1.9Mark Longair2013-12-03-4/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under Ruby 1.8.7, you can parse a CSV file with the following code (Example A): require 'csv' CSV.parse('foo.csv') do |row| puts "got row: #{row.inspect}" end Rather confusingly, under Ruby 1.8.7, CSV.parse can also take a string representation of the contents of the file as its parameter, so this also works (Example B): require 'csv' CSV.parse("1,hello,red\n2,goodbye,green") do |row| puts "got row: #{row.inspect}" end However under Ruby 1.9.3, CSV.parse only expects a string representation of the contents of the CSV file, so only Example B works; Example B fails silently (interpreting the filename as a single cell CSV file, typically). The import:import_csv rake task unfortunately relied on both A and B working. This commit fixes this by adding PublicBody.import_csv_from_file, and refactoring PublicBody.import_csv to use the newly added class method, and adds a test to check for any regression in this behaviour. (This means that the usage of import_csv in the admin public body controller's import_csv action could now be changed to use PublicBody.import_csv_from_file directly from the uploaded file, which would be more efficient and cope with larger files without using lots of memory.) Fixes #1229
* Merge branch 'feature/1201-close-attachment-files-after-read' into ↵Louise Crow2013-12-03-1/+1
|\ | | | | | | rails-3-develop
| * Use a block to automatically close file.Louise Crow2013-11-12-1/+1
| |
* | Merge remote-tracking branch 'origin/merged-rails-3-2-assset-pipeline' into ↵Louise Crow2013-11-29-5/+4
|\ \ | | | | | | | | | | | | | | | | | | rails-3-develop Conflicts: Gemfile.lock
| * \ Merge branch 'feature/rails-3-2-upgrade-spike' into ↵Mark Longair2013-11-29-5/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/switch-to-asset-pipeline Conflicts: Gemfile.lock app/assets/images/admin-theme/ui-bg_flat_0_aaaaaa_40x100.png app/assets/images/admin-theme/ui-bg_flat_55_fbf9ee_40x100.png app/assets/images/admin-theme/ui-bg_flat_65_ffffff_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_cccccc_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_dadada_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_e6e6e6_40x100.png app/assets/images/admin-theme/ui-bg_flat_75_ffffff_40x100.png app/assets/images/admin-theme/ui-bg_inset-soft_95_fef1ec_1x100.png app/assets/images/admin-theme/ui-icons_222222_256x240.png app/assets/images/admin-theme/ui-icons_2e83ff_256x240.png app/assets/images/admin-theme/ui-icons_454545_256x240.png app/assets/images/admin-theme/ui-icons_888888_256x240.png app/assets/images/admin-theme/ui-icons_cd0a0a_256x240.png app/assets/javascripts/admin.js app/assets/javascripts/admin/jquery-ui.min.js app/assets/javascripts/application.js app/assets/javascripts/jquery-ui.min.js app/assets/javascripts/jquery.flot.errorbars.min.js app/assets/javascripts/jquery.flot.min.js app/assets/javascripts/stats.js app/assets/stylesheets/application.css app/assets/stylesheets/fonts.scss app/views/general/_stylesheet_includes.html.erb app/views/layouts/admin.html.erb app/views/layouts/default.html.erb app/views/public_body/statistics.html.erb config/application.rb config/environments/development.rb
| | * | Use calls to write_attributeLouise Crow2013-11-12-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Under the Rails hood, using the setters for attributes now involves calling the getters too, (for a will_change? check), so these calls became circular - use write_attribute instead.
| | * | Remove virtual attribute created_atLouise Crow2013-11-12-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | The need for this was removed in 0ec315c52a731ff149977b9231a15770fa3bd742, and it now causes a MissingAttribute error.
* | | | Move getting recent requests into a helper method.Louise Crow2013-11-25-0/+48
| | | |
* | | | Use built-in SQL quoting.Louise Crow2013-11-25-2/+3
| | | |
* | | | Move getting popular bodies into a model method.Louise Crow2013-11-25-0/+23
| | | |
* | | | Move getting similar requests to the InfoRequest model.Louise Crow2013-11-25-0/+15
|/ / /
* | / Reduce the memory used to serve /body/all-authorities.csvMark Longair2013-11-14-5/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On WDTK, /body/all-authorities was using lots of memory - this commit reduces that by (a) fetching the public bodies in batches, rather than keeping them all in memory at one time and (b) writing the CSV to a file and then returning it with X-Sendfile (or equivalent), rather than returning the whole file from memory with send_data. There's a FIXME to do with the layout of download directories; if that's changed, the example nginx config, etc. will need to be updated too. This commit also adds a basic test for reasonable CSV being returned and switches from FasterCSV to CSV in order to fix this NotImplementedError under Ruby 1.9: Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus support for Ruby 1.9's m17n encoding engine. (The CSV version seems to still work fine under 1.8.7.)
* | Don't include public bodies tagged 'test' in public body statisticsMark Longair2013-11-07-2/+12
| | | | | | | | | | | | | | | | | | | | In the initial release of public body statistics to WhatDoTheyKnow a public body only intended for testing ("mySociety Test Quango") was included in the statistics. This commit causes public bodies tagged with "test" to be excluded from the public body statistics page. Fixes #1115.
* | Update the calculation of the numerator for percentage statisticsMark Longair2013-11-05-8/+13
| | | | | | | | | | | | | | | | | | We have changed the denominator of the proportion-based statistics to only include requests that are both visible and not 'awaiting_description'. This would mean, however, that the numerator could be larger than the denominator. This commit updates the calculation of those statistics to also exclude any hidden or unclassified requests.
* | Add "(n)" to the tooltips on the stats graphsMark Longair2013-11-05-2/+4
| |
* | For percentage stats, exclude hidden or unclassified requestsMark Longair2013-11-05-1/+1
| | | | | | | | | | | | | | | | The WDTK volunteers pointed out that it's not fair to include hidden requests in the denominator, since they're typically hidden for a good reason (e.g. being vexatious, spam, etc.), and we have no information about those that are awaiting_description (i.e. unclassified) so they should be excluded as well.
* | Add a info_requests_visible_classified_count column to PublicBodyMark Longair2013-11-05-20/+26
| | | | | | | | | | | | This counts only those info requests that have prominence 'normal' (i.e. are not hidden) and are not 'awaiting_description' (i.e. that they have had some basic status classification).
* | Update the helpful model schema annotationsMark Longair2013-11-01-19/+22
| | | | | | | | These are regenerated with "bundle exec annotate"
* | Add a rake task to import public bodies from a CSV fileMark Longair2013-10-15-0/+2
| | | | | | | | | | | | | | | | For importing a very large number of public bodies, it's mostly likely less frustrating to import them from the CSV file using this rake task instead of using the form in the admin interface. Fixes #1132
* | Merge branch 'feature/email-subject-cleanup' into rails-3-developLouise Crow2013-10-07-8/+2
|\ \
| * | Move special case to whatdotheyknow-themeLouise Crow2013-10-04-8/+2
| |/ | | | | | | | | Apart from anything else, we don't want translators to have to worry about the special case text. See https://github.com/mysociety/whatdotheyknow-theme/commit/2078febca5181ce3b1a9c0fae0123ae5f6448718 for the corresponding change to whatdotheyknow-theme.
* | Merge branch 'feature/followup-translators-notes' into rails-3-developLouise Crow2013-10-07-0/+3
|\ \
| * | Add some translator's notes on the use of 'follow up'.Louise Crow2013-10-04-0/+3
| |/
* / Fix upcasing of a non-US-ASCII first letter under Ruby 1.8Mark Longair2013-10-04-1/+1
|/ | | | | | | | In the rare circumstance that someone created a public body whose name started with a lower case letter outside [a-z] with Alaveteli running under Ruby 1.8, the letter would not be upcased correctly before saving to the first_letter column. This commit fixes that by using a Unicode-aware upcase function.
* Handle salutations with regexp special characters.Louise Crow2013-09-19-1/+1
| | | | Fixes #1104.
* Merge branch 'hotfix/0.13.0.3' into rails-3-developLouise Crow2013-09-18-1/+11
|\
| * Restrict old_unclassified methods to normal prominence.0.13.0.3hotfix/0.13.0.3Louise Crow2013-09-18-1/+11
| | | | | | | | Fixes #1082.
* | Merge branch 'feature/hide-individual-responses' into rails-3-developLouise Crow2013-09-17-198/+243
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile app/views/admin_request/edit_outgoing.html.erb config/packages doc/CHANGES.md doc/INSTALL.md spec/models/info_request_spec.rb spec/models/public_body_spec.rb
| * | Exclude hidden responses when calculating old_unclassifiedLouise Crow2013-09-16-4/+14
| | | | | | | | | | | | | | | Make old_unclassified_params method consistent with last_public_response_event and associated methods.
| * | Only include public messages in who_can_followup_toLouise Crow2013-09-16-0/+2
| | |
| * | Add public criteria for message event access methodsLouise Crow2013-09-16-16/+18
| | | | | | | | | | | | | | | | | | | | | get_last_response_event and get_last_outgoing_event are used in various places to determine which events to link to, use in queries etc. Restrict them to refer to the last publicly visible event of the relevant type, and rename them to make that clear.
| * | Hide hidden outgoing messages in download.Louise Crow2013-09-16-5/+3
| | |
| * | InfoRequestEvent.indexed_by_search consults OutgoingMessage.Louise Crow2013-09-16-0/+3
| | |
| * | Move indexed_by_search to MessageProminenceLouise Crow2013-09-16-4/+0
| | | | | | | | | | | | Add some tests that it's working on the outgoing message model.
| * | Add hidden messages for outgoing message.Louise Crow2013-09-16-1/+4
| | | | | | | | | | | | | | | | | | Conflicts: app/views/request/_incoming_correspondence.html.erb
| * | Create MessageProminence module.Louise Crow2013-09-16-6/+2
| | | | | | | | | | | | | | | | | | At least some of the logic for incoming and outgoing message prominence is going to be identical, so move it to a module they can both include and use.
| * | Move some download methods to InfoRequest.Louise Crow2013-09-16-0/+34
| | | | | | | | | | | | | | | | | | Use send_file to send zips. Also adds 'all_can_view_all_correspondence?' - is this request completely cachable, or do we need to cache different versions for different levels of privilege?
| * | Move display text generation to outgoing message.Louise Crow2013-09-16-2/+8
| | |
| * | Move a couple of complex conditionals to helper methods.Louise Crow2013-09-16-0/+9
| | | | | | | | | | | | We're about to reuse them for the text view.
| * | Normalize method spacing.Louise Crow2013-09-16-0/+3
| | |