aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeLines
...
* | | Merge branch 'feature/1176-automate-authority-contacts' into rails-3-developLouise Crow2014-01-28-3/+4
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: doc/CHANGES.md
| * | | Allow from_admin_message to take a name and email.Louise Crow2014-01-13-3/+4
| | | | | | | | | | | | | | | | | | | | Previously it accepted a user, but for this usage we won't necessarily have one.
* | | | Merge branch 'feature/cache-request-lists' into rails-3-developLouise Crow2014-01-28-0/+85
|\ \ \ \
| * | | | Move make_query_from_params to XapianQueriesLouise Crow2013-12-19-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is involved with the construction of meaningful xapian queries with respect to InfoRequestEvents. This commit also removes the get_tags_from_params method, which presumably was targeted at PublicBodies, but doesn't seem to actually be used anywhere. XapianQueries is used to extend InfoRequestEvent in order to prevent InfoRequestEvent becoming too unwieldy and to preserve the association between these methods.
* | | | | Merge branch 'trap-abnormal-exits' into rails-3-developLouise Crow2014-01-23-1/+5
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Make sure to detect abnormal exits before looking at exit codeIan Chard2014-01-14-5/+5
| | | | |
| * | | | Trap and report abnormal exits by external processesIan Chard2014-01-08-0/+4
| | | | |
| * | | | Session keys are stored as strings in Rails 3.0.15.0.1hotfix/0.15.0.1Louise Crow2013-11-19-2/+2
| | | | | | | | | | | | | | | | | | | | Update our session-stripping code.
* | | | | Add extra argument for MissingInterpolationArgument errorLouise Crow2013-12-12-1/+1
| |_|/ / |/| | | | | | | | | | | Revert translation of interpolated variable in French locale.
* | | | Remove old patch.Louise Crow2013-12-11-15/+0
| |/ / |/| |
* | | Add the newest Alaveteli sites.Louise Crow2013-12-09-1/+14
| | |
* | | Merge branch 'feature/less-destructive-themes-install' of ↵Louise Crow2013-12-09-59/+79
|\ \ \ | | | | | | | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into feature/less-destructive-themes-install
| * | | Make 'rake themes:install' safer for developersMark Longair2013-12-06-59/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the themes:install rake task would remove the existing theme with 'rm -rf' and re-clone the theme into place. This is unfortunate for a developer who has been making changes to a theme and then runs the rails-post-deploy script, since it calls the themes:install task which will wipe out those changes. In addition, when installing themes it would deliberately remove the .git directory of the theme, so if you do want to work in that theme you'd have to reinitialize the theme directory to be a git repository again. This commit changes the task so that now: - If a theme directory is present but it isn't a git repository, it's moved out of the way. - If there's no theme directory at the expected location after that step, the theme repository is cloned into place - The task ensures that the origin remote points to the theme's URL, and fetches from that remote. - If there are any uncommitted changes in the theme repository or the current commit appears not to have been pushed, the task exits with a helpful error. - The preferred branch or tag is checked out in the theme repository as before. (The uninstall, install and post_install hooks are run as before.) This shouldn't make a difference to deployed instances of Alaveteli but will be helpful for developers who want to work on developing a theme. Fixes #1111.
* | | | Merge branch 'document-pdf-fix' into rails-3-developMark Longair2013-12-09-1/+1
|\ \ \ \
| * | | | Treat any document/pdf attachment as if it were application/pdfMark Longair2013-12-03-1/+1
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for issue #1232. Richard Taylor pointed out that some PDF attachments had the non-standard content-type document/pdf, and that these weren't being treated as PDFs. (Ganesh Sittampalam discovered that all of these PDFs were generated by a Lexmark X945e, according to the PDF metadata.) This commit adds an extra case to normalise_content_type to map document/pdf to application/pdf. In fact, since the upgrade of the Mail gem in ccebe3c3d6d4dc5f81 the behaviour when handling the non-standard content-type document/pdf was much better, but this commit also means that you get the right icon for the attachment, and can be cherry-picked onto older versions to fix #1232.
* | | | Merge branch 'fix-command-line-csv' into rails-3-developMark Longair2013-12-09-6/+6
|\ \ \ \ | |_|/ / |/| | |
| * | | Fix the command-line CSV importer under Ruby 1.9Mark Longair2013-12-03-6/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'openaustralia/ruby-2' into rails-3-developMark Longair2013-12-05-8/+29
|\ \ \ | |/ / |/| | | | | | | | Conflicts: Gemfile
| * | Fix quietly_try_to_purge on Ruby 2.0Mark Longair2013-11-22-8/+29
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests of quietly_try_to_purge were failing on Ruby 2.0 due to the net-http-local gem not working with that Ruby version. When Net::HTTP::bind is called, it temporarily replaces the open method of TCPSocket with a version of open that only takes two parameters. The Ruby 1.9 version of net/http.rb calls TCPSocket.open with two parameters, but the Ruby 2.0 version calls it with 4, and so fails with a mismatched number of arguments error. In fact, net-http-local doesn't seem to be necessary with Ruby 2.0, where one can supply a :local_port argument to Net::HTTP.start, so this commit patches lib/quiet_opener.rb to use that approach with Ruby >= 2.0, and net-http-local on earlier versions.
* | Try to uninstall the old theme from vendor/plugins and lib/themesMark Longair2013-12-03-8/+17
| | | | | | | | | | | | | | | | | | | | | | The theme install task would fail if there's an old theme present in vendor/plugins, since it doesn't try to uninstall the plugin from that location, only the new location. Then when the install.rb in the new plugin runs, it'll complain that there's a public/alavetelitheme symlink already present. This commit changes themes:install to try to uninstall the plugin from both locations.
* | Ensure that the lib/themes directory exists before installing to thereMark Longair2013-12-03-0/+1
| | | | | | | | | | | | (An alternative would have been to add an empty lib/themes/.gitkeep file to this directory, but that makes ignoring the installed themes more complicated.)
* | Merge branch 'move-plugins-out-of-vendor-plugins' into rails-3-developMark Longair2013-12-03-3/+1793
|\ \
| * | Move themes from vendor/plugins to lib/themesMark Longair2013-12-03-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are essentially required in exactly the same way as before, but from lib/themes rather than vendor/plugins. This is the simplest possible change in order make the themes work outside vendor/plugins, I think, but it's not necessarily ideal. It would be worth considering whether these should be changed to Rails engines, as described here: http://guides.rubyonrails.org/engines.html
| * | Update the acts_as_xapian generator to work under Rails 3Mark Longair2013-11-29-11/+8
| | |
| * | Move the acts_as_xapian generator into lib/generatorsMark Longair2013-11-29-0/+0
| | |
| * | Move acts_as_xapian out of vendor/pluginsMark Longair2013-11-29-0/+1373
| | | | | | | | | | | | | | | This includes making making sure that xapiandbs directory is moved with this version of the code.
| * | Move has_tag_string out of vendor/pluginsMark Longair2013-11-29-0/+166
| | |
| * | Move strip_attributes out of vendor/pluginsMark Longair2013-11-29-0/+254
| | |
* | | Merge remote-tracking branch 'origin/merged-rails-3-2-assset-pipeline' into ↵Louise Crow2013-11-29-66/+6
|\| | | | | | | | | | | | | | | | | | | | rails-3-develop Conflicts: Gemfile.lock
| * | Merge branch 'feature/rails-3-2-upgrade-spike' into ↵Mark Longair2013-11-29-66/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | Update method name in patched method.Louise Crow2013-11-12-2/+3
| | | |
| | * | Remove obsolete patches.Louise Crow2013-11-12-61/+0
| | | |
| | * | Change class for newer version of mail gem.Louise Crow2013-11-12-2/+2
| | | |
| | * | Disambiguate File from ActiveRecord::Fixture::FileLouise Crow2013-11-12-1/+1
| | | |
* | | | Ruby 1.8 compatibility fixes.Louise Crow2013-11-25-3/+3
| | | |
* | | | Make fragment caching dependent on a config variable.Louise Crow2013-11-25-0/+1
| | | |
* | | | Add a rake task to analyse the distribution of hits to requests.Louise Crow2013-11-25-284/+32
|/ / / | | | | | | | | | Also removes old temp tasks.
* | / Session keys are stored as strings in Rails 3.Louise Crow2013-11-18-2/+2
| |/ |/| | | | | Update our session-stripping code.
* | Merge branch 'install-script' into rails-3-developMark Longair2013-11-07-6/+21
|\ \
| * | Add a rake task to rewrite the crontab-example fileMark Longair2013-11-07-0/+18
| | | | | | | | | | | | | | | | | | As suggested by Louise Crow, this new rake task reuses the convert_ugly function to rewrite the crontab-example file into a usable crontab file.
| * | Fix an undefined variable errorMark Longair2013-11-07-6/+2
| | | | | | | | | | | | | | | I assume 'skip' must have been an argument to this function before it was introduced into our repository.
| * | Add a config option for whether to use mailcatcher in developmentMark Longair2013-10-29-0/+1
| |/ | | | | | | | | Sometimes it's useful to be able to really send mail in development mode, so add a config option for that.
* | Merge branch 'rails-3-develop' of ↵Louise Crow2013-11-07-1/+5
|\ \ | | | | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
| * | Update the calculation of the numerator for percentage statisticsMark Longair2013-11-05-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Allow start and end dates to be supplied to stats:showLouise Crow2013-11-07-2/+8
|/ / | | | | | | This is in the service of #1173 and #1174.
* | Merge branch 'switch-theme-script' into rails-3-developMark Longair2013-10-30-1/+4
|\ \ | | | | | | | | | | | | Conflicts: config/initializers/alaveteli.rb
| * | Make theme URL to theme name mapping consistentMark Longair2013-10-15-1/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that extracted the theme name from each entry in THEME_URLS (in order to require code from a directory whose leaf name is the theme name) only supported git URLs that ended in '.git'. However, the themes:install rake task usefully supports a wider range of git URLs - for example, all of the following were supported: /home/whoever/themes/blah-theme => blah-theme /home/whoever/themes/blah-theme/ => blah-theme git://wherever/blah-theme.git => blah-theme ssh://wherever/blah-theme.git// => blah-theme This commit factors out a theme_url_to_theme_name method, adds tests for it, and uses that method in both: lib/tasks/themes.rake config/initializers/theme_loader.rb ... so that a wider range of theme URLs are consistently supported.
* | Merge remote-tracking branch 'origin/command-line-csv-import' into ↵Louise Crow2013-10-30-0/+78
|\ \ | | | | | | | | | rails-3-develop
| * | Remove the confusing "time remaining" messageMark Longair2013-10-29-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The time estimates were confusing on two counts: - The messages mixed locales - The estimates were hugely inaccurate, since the import slows down as time goes on
| * | Make sure that the temporary file is closed before reading from itMark Longair2013-10-29-2/+5
| | | | | | | | | | | | Thanks to Louise Crow for pointing out this problem.