aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
Commit message (Collapse)AuthorAgeLines
* Handle a request with no user in the show request function0.16.0.5hotfix/0.16.0.5Louise Crow2014-01-28-1/+4
|
* Merge branch 'feature/cleanup-popups' into release/0.16Louise Crow2014-01-14-3/+0
|\ | | | | | | | | | | | | | | Conflicts: Gemfile.lock app/views/layouts/default.html.erb config/application.rb public/admin/stylesheets/admin.css
| * Cleanup popup notices.Louise Crow2014-01-14-3/+0
| | | | | | | | | | | | | | | | Move HTML to view from controller, use same elements for other country popup and everypage - partly so they don't display on top of each other anymore. Don't position them over existing content, position them at the top of the page. Use consistent styling, and keep the javascript unobtrusive.
* | Merge branch 'feature/display-social-media-when-configured' into rails-3-developLouise Crow2013-12-09-0/+4
|\ \
| * | Only show the blog if a BLOG_FEED is configured.Louise Crow2013-12-09-0/+4
| | |
* | | Fix the command-line CSV importer under Ruby 1.9Mark Longair2013-12-03-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 remote-tracking branch 'origin/merged-rails-3-2-assset-pipeline' into ↵Louise Crow2013-11-29-5/+11
|\ \ | |/ |/| | | | | | | | | rails-3-develop Conflicts: Gemfile.lock
| * Merge branch 'feature/rails-3-2-upgrade-spike' into ↵Mark Longair2013-11-29-5/+11
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Add a dummy exception notification address for testingLouise Crow2013-11-12-1/+3
| | | | | | | | | | | | | | | | | | ActionMailer now checks for a 'to' address on sending mail, so supply one so that we can check exception notification mail sending. Also check that we have one before trying to call the exception notification code.
| | * Don't specify format in template name.Louise Crow2013-11-12-4/+8
| | | | | | | | | | | | | | | In render calls, that's now deprecated in favour of using the :formats option.
* | | Move getting recent requests into a helper method.Louise Crow2013-11-25-24/+0
| | |
* | | Move getting popular bodies into a model method.Louise Crow2013-11-25-21/+0
| | |
* | | Cache the similar requests for 1 dayLouise Crow2013-11-25-0/+7
| | |
* | | Move getting similar requests to the InfoRequest model.Louise Crow2013-11-25-9/+0
|/ /
* | Reduce the memory used to serve /body/all-authorities.csvMark Longair2013-11-14-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | Merge branch 'feature/1118-fix-ask-us-to-add-links' into rails-3-developMark Longair2013-11-07-5/+6
|\ \
| * | Show highlights and correction regardless of search type.Louise Crow2013-11-07-5/+6
| | | | | | | | | | | | Contributes to #1118.
* | | Factor out code for generating graphable data and add testsMark Longair2013-11-05-23/+48
| | | | | | | | | | | | | | | | | | This simplifies the statistics action of the PublicBodyController and makes it easier to test the functionality now in the simplify_stats_for_graphs method.
* | | Add "(n)" to the tooltips on the stats graphsMark Longair2013-11-05-1/+2
|/ /
* | Fix a small error in stats-graphs-improvementsMark Longair2013-11-03-2/+2
| |
* | Merge branch 'stats-graphs-improvements' into rails-3-developMark Longair2013-10-31-14/+14
|\ \
| * | Avoid an error when the statistics column hasn't been populatedMark Longair2013-10-31-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | The 'if data' needs to be earlier to avoid an error if one of the statistics columns hasn't been filled in by the stats:update_public_bodies_stats rake task yet. Thanks to Louise Crow for pointing this out in code review.
* | | Merge remote-tracking branch 'origin/stats-graphs-improvements' into ↵Louise Crow2013-10-30-5/+15
|\| | | | | | | | | | | rails-3-develop
| * | Refactor to avoid repeating .each_with_index.mapMark Longair2013-10-15-4/+9
| | |
| * | Increase the number of public bodies per graph to 10Mark Longair2013-10-15-1/+1
| | | | | | | | | | | | | | | | | | Now that there are rotated names on the x axis we shouldn't need to worry about them overlapping, which was the reason for limiting the number to 8 in the first place.
| * | Only include minimal information about public bodies in JSONMark Longair2013-10-15-1/+6
| | | | | | | | | | | | | | | | | | | | | Previously, the JSON included all the columns from the public body table, which was unnecessary and included the public body's email address. Instead, just include the name and URL of the public body.
* | | Merge branch 'hotfix/0.14.0.3' into rails-3-developLouise Crow2013-10-24-1/+2
|\ \ \ | |/ / |/| |
| * | Don't allow redirects to another host.Louise Crow2013-10-02-1/+2
| |/
* / Allow public body listing based on first letter outside US-ASCIIMark Longair2013-10-04-2/+2
|/ | | | | | | | | | | | | Under Ruby 1.8, it was previously impossible to use one of the "first letter" alphabet links on the public body listing page if the first letter was outside [A-Za-z] since the test for the parameter only being a single letter wasn't aware of the possibly of multi-byte characters. In addition, upcasing of letters outside [A-Za-z] didn't work because String#upcase in Ruby 1.8 isn't Unicode-aware. This commit fixes these two problems, so that non-US-ASCII first letter links will work under Ruby 1.8. (Fixes #1112.)
* Revert "No need to set permissions on file now."Louise Crow2013-09-19-0/+1
| | | | | | In fact, we do still need to set permissions. This reverts commit 56ce526acdcb1b5493bc11f14b751b5c3f02f686.
* Remove extra "is invalid" message.Louise Crow2013-09-18-1/+1
| | | | Fixes #1101.
* Merge branch 'hotfix/0.13.0.3' into rails-3-developLouise Crow2013-09-18-2/+1
|\
| * Restrict old_unclassified methods to normal prominence.0.13.0.3hotfix/0.13.0.3Louise Crow2013-09-18-2/+1
| | | | | | | | Fixes #1082.
* | Merge branch 'feature/hide-individual-responses' into rails-3-developLouise Crow2013-09-17-167/+220
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Use 403, not 410, for hidden items.Louise Crow2013-09-16-2/+2
| | | | | | | | | | | | | | | As @mhl points out, this more clearly indicates that they may come back at some point.
| * | No need to set permissions on file now.Louise Crow2013-09-16-1/+0
| | | | | | | | | | | | | | | Either rails or the webserver will be sending it, we're not redirecting anymore.
| * | Add message index to attachment filesLouise Crow2013-09-16-1/+3
| | | | | | | | | | | | | | | So that files attached to different messages with the same name and url_part don't get overwritten.
| * | Add public criteria for message event access methodsLouise Crow2013-09-16-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Shorter way of getting text template.Louise Crow2013-09-16-1/+1
| | |
| * | Add prominence fields and cache expiry to outgoing adminLouise Crow2013-09-16-4/+15
| | |
| * | Move some download methods to InfoRequest.Louise Crow2013-09-16-25/+7
| | | | | | | | | | | | | | | | | | 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?
| * | Restore the download for hidden requestsLouise Crow2013-09-16-4/+4
| | | | | | | | | | | | | | | | | | This was disabled for hidden requests as the download was by redirect, allowing people who have not been authenticated to conceivably access the download. We'll be moving to send_file instead, so can restore it.
| * | Make sure that info_request gets assigned to the viewLouise Crow2013-09-16-2/+2
| | | | | | | | | | | | | | | | | | This should be handled by assign_variables_for_show_template. Otherwise, the make_request_summary_file method shouldn't depend on instance variables
| * | Move zip file creation to its own method.Louise Crow2013-09-16-16/+15
| | |
| * | Remove hidden incoming messages from correspondence.txtLouise Crow2013-09-16-1/+2
| | | | | | | | | | | | | | | | | | | | | Adds a spec for what we want to see - no message text in correspondence.txt, and no attachments. Refactors the simple_correspondence templates to make it clearer that these are doing the same job as the html.erb ones, for text.
| * | Extract calculation of last update hashLouise Crow2013-09-16-2/+1
| | |
| * | Extract out code for making a request summary fileLouise Crow2013-09-16-26/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Render the show template within the current thread rather than making another request - we're going to need to use the current session in order to know what do include in the zip file, now that we have more fine-grained visibility of messages. Also, this will mean we can use this functionality in single threaded contexts, and test it more easily. Don't display profile photos as this would require another process, and hide other icons so we don't need to include them. Use render_to_string as a more standard way of rendering templates to a string for further manipulation.
| * | Extract the various info_request assignsLouise Crow2013-09-16-9/+15
| | | | | | | | | | | | | | | | | | So we can reuse them when rendering the show template to a file. Lots of the sidebar prep isn't going to be needed for that view, so make that optional in the template.
| * | Reorder assignsLouise Crow2013-09-16-12/+12
| | | | | | | | | | | | | | | Split into those that come from request params and those that come from the model
| * | Add new code and specs for hiding attachments.Louise Crow2013-09-16-1/+14
| | |