aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
Commit message (Collapse)AuthorAgeLines
* 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
| | |
| * | Add the meat of the update action.Louise Crow2013-09-16-0/+19
| | |
| * | Add a simple edit action and templateLouise Crow2013-09-16-0/+4
| | |
| * | Add incoming message update action and route.Louise Crow2013-09-16-0/+3
| | | | | | | | | | | | | | | We'll use this for saving the changes to the prominence of an incoming message in a relatively RESTful url structure.
| * | Slightly nicer action names.Louise Crow2013-09-16-2/+2
| | |
| * | Move incoming message admin to its own controller.Louise Crow2013-09-16-52/+54
| | | | | | | | | | | | | | | Make specs that depend on multiple controllers and models interacting integration specs.
| * | Move outgoing message admin actions to their own controller.Louise Crow2013-09-16-33/+36
| | | | | | | | | | | | Eventually this should use standard RESTful routing.
* | | Make graph title and axis labels translatableMark Longair2013-09-12-11/+11
| | | | | | | | | | | | | | | The labels on the public body statistics graphs weren't marked as being translatable. Fixes #1079.
* | | Merge branch 'public-body-locale-fallback' into rails-3-developLouise Crow2013-09-12-23/+84
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/controllers/public_body_controller.rb config/general.yml-example lib/configuration.rb
| * | | Don't display duplicate public bodies with the fallbackMark Longair2013-09-12-30/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces some raw SQL statement for the fallback case, but we can't see an easy way to avoid that in this case. This commit also adds some tests that assert the sorting and non-duplication properties of the listing. Thanks to Louise Crow for working out the SQL expression for falling back to the default locale.
| * | | Fix locales used to find public bodies in AdminPublicBodyControllerMark Longair2013-09-10-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The locale returned from locale_from_params may be dash-separated, (the I18n module convention) whereas those in the public_body_translations table are underscore-separated. The AdminPublicBodyController was looking for dash-separated locales in that table, so ensure that dashes are substituted for underscores before using them in a query.
| * | | Make falling back to default locale in public body listings optionalMark Longair2013-09-10-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the code stood, the list method in PublicBodyController would only return results that had translations of the public body in the default locale. This has a variety of problems if you're viewing pages in the non-default locale - for example, the "first letter" links wouldn't bring up the public bodies that began with that letter in the current locale, only those that began with it in the default locale. Ideally, every public body would be translated into every available locale for the site, but there are cases where deployers wish to have public body listings also include those from the default locale, in case there are untralsated public bodies: https://groups.google.com/d/msg/alaveteli-dev/zUY_USaAMAM/M7KTQ9RC5YUJ This commit makes the default behaviour to look for public body listings only in the current locale, but if the new configuration option PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE is set, then public body listings will be looked for in both the current locale and the default locale. Fixes #1000
| * | | Tidy up SQL query stringsMark Longair2013-08-29-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the list method of PublicBodyController, capitalize the SQL keywords consistenly and don't include extraneous whitespace in the strings. (On the former point, previously only some were - the convention is a matter of some debate, but in this case the you editor's not doing to do syntax highlighting of SQL so having the keywords capitalized helps its readibility, I think.) I wouldn't normally do this kind of cosmetic tidying up, since it affects the tidiness of diffs and merges, but in this case I'm going to change all these lines in the next commit anyway, so that reasoning doesn't apply.
* | | | Merge branch 'body-statistics' into rails-3-developLouise Crow2013-09-04-1/+79
|\ \ \ \
| * | | | Reduce the number of public bodies per graphMark Longair2013-08-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems to be difficult to customize the display of the tick labels (see the body-statistics-rotated-label branch for an as-yet-not-working alternative) so for the moment just reduce the number of public bodies shown per graph from 10 to 8.
| * | | | Add a config option to enable the public body statistics pageMark Longair2013-08-20-0/+4
| | | | |
| * | | | Refactor calculation of statisticsMark Longair2013-08-20-77/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the calculation of statistics on public bodies into the PublicBody model, so that there's less logic in the controller.
| * | | | Make the minimum requests for statistics configurableMark Longair2013-08-20-1/+3
| | | | | | | | | | | | | | | | | | | | This adds the MINIMUM_REQUESTS_FOR_STATISTICS config option.
| * | | | Add a page with experimental statistics on public bodiesMark Longair2013-08-20-1/+102
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The statistics on the status of the requests to a particular public body are too slow to calculate on-the-fly, so this commit adds: * Extra columns on public_bodies to store counts of the successful, not held, and overdue request counts for each public body. * A rake task which should be run periodically to update the overdue request count column. If Javascript is not available, the summary statistics are shown as tables. If Javascript is available, graphs are drawn with Flot.
* | | | Serve admin.js as a static fileMark Longair2013-08-21-5/+0
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | admin.js was being generated from a view so that the config variable ADMIN_PUBLIC_URL could be used to direct AJAX requests in the admin interface correctly. ADMIN_PUBLIC_URL was necessary for WhatDoTheyKnow when the admin interface was proxied over SSL, while the rest of the site was non-SSL. Now that the whole site is served over SSL, however, the proxy for the admin interface is not longer used and ADMIN_PUBLIC_URL / ADMIN_BASE_URL have been removed. As a result, admin.js is now being generated from a Rails view unnecessarily, and at some performance cost. This commit moves admin.coffee and admin.js to the public directory, so they will be served more efficiently. In addition, this commit removes admin.coffee / admin.js from public/javascripts/ where there was a second (and different) version that now appears to be unused.