aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Merge branch 'feature/less-destructive-themes-install' into rails-3-developLouise Crow2013-12-09-59/+79
|\
| * 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/+117
|\ \
| * | Treat any document/pdf attachment as if it were application/pdfMark Longair2013-12-03-1/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10/+41
|\ \ \
| * | | Fix the command-line CSV importer under Ruby 1.9Mark Longair2013-12-03-10/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/asset-fixes' into rails-3-developMark Longair2013-12-09-2/+2
|\ \ \ \
| * | | | Remove link to the now-removed theme.cssMark Longair2013-12-05-1/+0
| | | | |
| * | | | Fix the link to the fancybox CSSMark Longair2013-12-05-1/+2
| | |_|/ | |/| |
* | | | Merge branch 'feature/fix-fake-response' into rails-3-developMark Longair2013-12-09-1/+23
|\ \ \ \
| * | | | Use a better subject line than "Fake Response" for uploaded responsesMark Longair2013-12-06-1/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The subject line wasn't being explicitly specified in RequestMailer.fake_response and a default of "Fake Response" (somehow based on the method name) was being used instead; this subject line would sometimes be visible to users and authorities and caused alarm to them. Instead, we use the standard subject lines for followup emails for the InfoRequest. Fixes #1105.
* | | | Revert "Add byebug, for interactive debugging under Ruby 2"Mark Longair2013-12-09-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3b86cb6129140fc123dc3aeffcccdb5652f19085. Conflicts: Gemfile The problem with this is the combination of these things: * bundler's behaviour on seeing a platform that it doesn't understand is to error, rather than to ignore it: https://github.com/bundler/bundler/issues/2428 * mySociety's servers currently only have version 1.1.4 of bundler * The :ruby_20 platform was only introduced in version 1.3.0 of bundler: https://github.com/bundler/bundler/blob/master/CHANGELOG.md#130pre3-dec-21-2012 So, for the moment we're just going to revert this change; upgrading bundler on our servers is a non-trivial job and being able to deploy on our servers is urgent and important.
* | | | Merge remote-tracking branch 'openaustralia_github/consistent-admin-links' ↵Louise Crow2013-12-09-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | into rails-3-develop
| * | | | Make admin link order consistentHenare Degan2013-12-07-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | Previously the admin links and permalinks on annotations and incoming correspondence were reversed, this commit makes the admin link consistently appear on the left and the permalink thingo appear on the right.
* / / / Correct small typo in README.mdGuy Freeman2013-12-09-1/+1
|/ / /
* | | Merge remote-tracking branch 'origin/feature/cleaner-attachment-image-path' ↵Mark Longair2013-12-05-1/+1
|\ \ \ | | | | | | | | | | | | into rails-3-develop
| * | | Slightly nicer and more robust path reference.Louise Crow2013-12-03-1/+1
| | | |
* | | | Merge remote-tracking branch 'openaustralia/ruby-2' into rails-3-developMark Longair2013-12-05-11/+38
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile
| * | | | Specify a build as rbenv doesn't fuzzy match versions (Thanks to @mhl)Henare Degan2013-11-26-1/+1
| | | | |
| * | | | Fix quietly_try_to_purge on Ruby 2.0Mark Longair2013-11-22-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Add byebug, for interactive debugging under Ruby 2Mark Longair2013-11-22-0/+5
| | | | |
| * | | | Get Travis building against Ruby 2.0Henare Degan2013-11-15-0/+1
| | | | |
| * | | | Set default development version to Ruby 2.0Henare Degan2013-11-15-1/+1
| | | | |
| * | | | `bundle update vpim` for Ruby 2.0 supportHenare Degan2013-11-15-1/+1
| | | | |
* | | | | Merge branch 'feature/switch-theme-none-option' into rails-3-developMark Longair2013-12-05-8/+17
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: script/switch-theme.rb
| * | | | | Update the switch-theme.rb script allow switching to no themeMark Longair2013-11-25-8/+17
| | | | | |
* | | | | | Update INSTALL.md to say that Alaveteli won't run in a EC2 Micro instanceMark Longair2013-12-05-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constrained memory on Micro instances has caused two separate bug reports on alaveteli-dev, so update the documentation to discourage people from trying that.
* | | | | | Fix label.Louise Crow2013-12-04-1/+1
| | | | | |
* | | | | | Add some instructions on removing the symlinking code.Louise Crow2013-12-04-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in install.rb and uninstall.rb for a theme that symlinks its public directory from the main application directory is no longer needed.
* | | | | | Merge remote-tracking branch 'origin/restore-xapian-rake-tasks' into ↵Louise Crow2013-12-04-1/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | rails-3-develop
| * | | | | | Use Rails.root in the RakefileMark Longair2013-12-03-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems more robust (or certainly easier to understand on reading the code) to make these paths relative to the Rails root rather than File.dirname(__FILE__).
| * | | | | | Add back the acts_as_xapian Rake tasksMark Longair2013-12-03-0/+2
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An effect of moving the acts_as_xapian plugin out of vendor/plugins is that its Rake tasks are no longer found. A fix for this (although not necessarily the best) is in this commit - load everything in lib/acts_as_xapian/tasks/*.rake in the Rakefile.
* | | | | | Set enforce_available_locales to false.Louise Crow2013-12-04-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was the previous behaviour. Setting it explicitly avoids a deprecation warning.
* | | | | | Upgrade Rails to 3.2.16 to get fixes for CVE-2013-6414, CVE-2013-4491, ↵Louise Crow2013-12-04-29/+29
| |_|_|_|/ |/| | | | | | | | | | | | | | CVE-2013-6417, CVE-2013-6415.
* | | | | Merge branch 'rails-3-develop' of ↵Louise Crow2013-12-03-9/+19
|\| | | | | | | | | | | | | | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
| * | | | Merge branch 'theme-install-fixes' into rails-3-developMark Longair2013-12-03-9/+19
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: script/rails-post-deploy
| | * | | | 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.
| | * | | | Precompile assets only for production.Louise Crow2013-12-03-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: script/rails-post-deploy
| | * | | | 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 'feature/1201-close-attachment-files-after-read' into ↵Louise Crow2013-12-03-2/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | rails-3-develop
| * | | | Use a block to automatically close file.Louise Crow2013-11-12-1/+1
| | |_|/ | |/| |
* | | | Only precompile assets on non-staging sites.Louise Crow2013-12-03-0/+3
| | | |
* | | | Ignore db/structure.sqlLouise Crow2013-12-03-0/+1
| |/ / |/| | | | | | | | Rails 3.2 uses structure.sql for schema dumps
* | | Merge branch 'move-plugins-out-of-vendor-plugins' into rails-3-developMark Longair2013-12-03-42/+57
|\ \ \
| * | | Revert "Silence deprecation warnings."Mark Longair2013-12-03-3/+0
| | | | | | | | | | | | | | | | This reverts commit 084cc9574c254cc0af2de4cd615fa99a5be8bc83.
| * | | Move themes from vendor/plugins to lib/themesMark Longair2013-12-03-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14/+31
| | | | | | | | | | | | | | | | | | | | This includes making making sure that xapiandbs directory is moved with this version of the code.