aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/CHANGES.md10
-rw-r--r--doc/INSTALL-exim4.md11
-rw-r--r--doc/INSTALL.md38
-rw-r--r--doc/THEMES-UPGRADE.md101
-rw-r--r--doc/THEMES.md18
5 files changed, 135 insertions, 43 deletions
diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index 9a027a3a8..e53dcfe0b 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -1,3 +1,13 @@
+# Version 0.11
+## Highlighted features
+* Upgrade of the Rails framework to version 3.1.12 (Henare Degan, Matthew Landauer, Mark Longair, Louise Crow)
+
+## Upgrade notes
+* Manually remove vendor/rails-locales
+* Themes created for 0.9 and below should be updated to work with Rails 3. See `THEMES-UPGRADE.md` for notes on upgrading your theme. You will need to manually remove your old theme directory before running `rails-post-deploy`.
+* The `config/httpd.conf` has moved to `config/httpd.conf`, as it may need customization before deploying. It also has a new line setting RackEnv to production - copy this to your config/httpd.conf file.
+* Alaveteli now uses the [mail gem](https://github.com/mikel/mail) rather than [tmail](https://github.com/mikel/tmail) to handle mail. If you're using Exim as your MTA, you'll need to use the setting `extract_addresses_remove_arguments = false` in your Exim conf (see INSTALL-exim4.md for details). This means it won't remove addresses specified with -t on command line from the mail recipient list.
+
# Version 0.9
## Highlighted features
* Consistent and more informative variable interpolation syntax in translated phrases. All of these phrases will now appear in the form "There are {{count}} people following this request", where some were previously in the form "There are %s people following this request". (Matthew Landauer)
diff --git a/doc/INSTALL-exim4.md b/doc/INSTALL-exim4.md
index e37da14ff..cdc33ab12 100644
--- a/doc/INSTALL-exim4.md
+++ b/doc/INSTALL-exim4.md
@@ -6,15 +6,16 @@ In `/etc/exim4/conf.d/main/04_alaveteli_options`:
ALAVETELI_HOME=/path/to/alaveteli/software
ALAVETELI_USER=www-data
log_file_path=/var/log/exim4/exim-%slog-%D
- MAIN_LOG_SELECTOR==+all -retry_defer
+ MAIN_LOG_SELECTOR==+all -retry_defer
+ extract_addresses_remove_arguments=false
(The user ALAVETELI_USER should have write permissions on ALAVETELI_HOME).
-Note that the name and location of the log files created by Exim must match
+Note that the name and location of the log files created by Exim must match
what the `load-mail-server-logs` script expects, hence the need for the extra
`log_file_path` setting. And the `check-recent-requests-sent` scripts expects
-the logs to contain the `from=<...>` envelope information, so we make the
-logs more verbose with `log_selector`.
+the logs to contain the `from=<...>` envelope information, so we make the
+logs more verbose with `log_selector`.
In `/etc/exim4/conf.d/router/04_alaveteli`:
@@ -33,7 +34,7 @@ In `/etc/exim4/conf.d/transport/04_alaveteli`:
home_directory = ALAVETELI_HOME
user = ALAVETELI_USER
group = ALAVETELI_USER
-
+
And, assuming you set `INCOMING_EMAIL_PREFIX` in your config at
`config/general` to "foi+", create `config/aliases` with the following
content:
diff --git a/doc/INSTALL.md b/doc/INSTALL.md
index 2156f4c4a..b6e8d2265 100644
--- a/doc/INSTALL.md
+++ b/doc/INSTALL.md
@@ -67,15 +67,7 @@ Some of the files also have a version number listed in config/packages
# Install Ruby dependencies
-Install rubygems 1.6.2 (we're not using the Debian package because we
-need an older version; see "Troubleshooting" below for an
-explanation):
-
- wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz -O /tmp/rubygems-1.6.2.tgz
- tar zxvf /tmp/rubygems-1.6.2.tgz -C /tmp/
- sudo ruby1.8 /tmp/rubygems-1.6.2/setup.rb
-
-To install Alaveteli's Ruby dependencies, we also need to install
+To install Alaveteli's Ruby dependencies, we need to install
bundler. In Debian, this is provided as a package (installed as part
of the package install process above). You could also install it as a
gem:
@@ -138,7 +130,8 @@ username and password of your postgres database.
Make sure that the user specified in database.yml exists, and has full
permissions on these databases. As they need the ability to turn off
constraints whilst running the tests they also need to be a superuser.
-(See http://dev.rubyonrails.org/ticket/9981)
+If you don't want your database user to be a superuser, you can add a line
+`disable_constraints: false` to the test config in database.yml, as seen in database.yml-example
You can create a `foi` user from the command line, thus:
@@ -230,7 +223,7 @@ for instructions on switching on local and remote performance analysis.
In the 'alaveteli' directory, run:
- ./script/rails-post-deploy
+ script/rails-post-deploy
(This will need execute privs so `chmod 755` if necessary.) This sets
up directory structures, creates logs, installs/updates themes, runs
@@ -245,11 +238,11 @@ If you want some dummy data to play with, you can try loading the
fixtures that the test suite uses into your development database. You
can do this with:
- ./script/load-sample-data
+ script/load-sample-data
Next we need to create the index for the search engine (Xapian):
- ./script/rebuild-xapian-index
+ script/rebuild-xapian-index
If this fails, the site should still mostly run, but it's a core
component so you should really try to get this working.
@@ -281,7 +274,7 @@ tests to pass by setting `export LD_PRELOAD=/lib/libuuid.so.1`.
Run the following to get the server running:
- ./script/server --environment=development
+ script/server --environment=development
By default the server listens on all interfaces. You can restrict it to the
localhost interface by adding ` --binding=127.0.0.1`
@@ -367,8 +360,8 @@ It is not recommended to run the website using the default Rails web
server. There are various recommendations here:
http://rubyonrails.org/deploy
-We usually use Passenger / mod_rails. The file at `conf/httpd.conf`
-contains the WhatDoTheyKnow settings. At a minimum, you should
+We usually use Passenger / mod_rails. The file at `conf/httpd.conf-example`
+gives you an example config file for WhatDoTheyKnow. At a minimum, you should
include the following in an Apache configuration file:
PassengerResolveSymlinksInDocumentRoot on
@@ -509,19 +502,6 @@ various other things that can be automated for deployment.
[https://github.com/mysociety/alaveteli/issues/128#issuecomment-1814845](this issue followup)
for further discussion.
-* **I'm getting lots of `SourceIndex.new(hash) is deprecated` errors when running the tests**
-
- The latest versions of rubygems contain a large number of noisy
- deprecation warnings that you can't turn off individually. Rails
- 2.x isn't under active development so isn't going to get fixed (in
- the sense of using a non-deprecated API). So the only vaguely
- sensible way to avoid this noisy output is to downgrade rubygems.
-
- For example, you might do this by uninstalling your
- system-packaged rubygems, and then installing the latest rubygems
- from source, and finally executing `sudo gem update --system
- 1.6.2`.
-
* **I'm seeing `rake: command not found` when running the post install script
The script uses `rake`.
diff --git a/doc/THEMES-UPGRADE.md b/doc/THEMES-UPGRADE.md
new file mode 100644
index 000000000..457274d7a
--- /dev/null
+++ b/doc/THEMES-UPGRADE.md
@@ -0,0 +1,101 @@
+This file contains some notes on changing your Alaveteli theme for the
+upgrade to Rails 3, in version 0.11 of Alaveteli. These were written
+by Henare Degan, with some additions by Mark Longair.
+
+# Alaveteli Theme Upgrade Checks
+
+## RAILS_ROOT/RAILS_ENV
+
+[Example](https://github.com/henare/adminbootstraptheme/commit/857e33c9b0bc577024b476404aec4f9749f65a0b)
+
+Check your theme for instances of:
+
+* `RAILS_ROOT` and replace it with `Rails.root`
+* `RAILS_ENV` and replace it with `Rails.env`
+
+Note that `Rails.root` is a `Pathname`, so you can replace, for
+example:
+
+ File.join(RAILS_ROOT, 'public', 'alavetelitheme')
+
+... with:
+
+ Rails.root.join('public', 'alavetelitheme')
+
+## Dispatcher
+
+[Example](https://github.com/henare/adminbootstraptheme/commit/fba2d6b7dfdc26a25fdc1596bfe120270dd4cd0d)
+
+This...
+
+```ruby
+require 'dispatcher'
+Dispatcher.to_prepare do
+```
+
+should be replaced with this...
+
+```ruby
+Rails.configuration.to_prepare do
+````
+
+## Routes
+
+[Example](https://github.com/henare/adminbootstraptheme/commit/87f1991dafb09401f9b17f642a94382d5a47a713)
+
+You need to upgrade your custom routes to the new Rails syntax.
+
+## list_public_bodies_default removed
+
+[Example](https://github.com/openaustralia/alavetelitheme/commit/5927877af996a1afb1a23a950f0d012b52c36f83)
+
+The list_public_bodies_default helper has been removed from Alaveteli
+
+## Patching mailer templates has changed
+
+[Example](https://github.com/openaustralia/alavetelitheme/commit/ffb5242973a0b2acc4981c25659fcb752b92eb97)
+
+In `lib/patch_mailer_paths.rb` change `ActionMailer::Base.view_paths.unshift File.join(File.dirname(__FILE__), "views")` to `ActionMailer::Base.prepend_view_path File.join(File.dirname(__FILE__), "views")`
+
+There's also `ActionMailer::Base.append_view_path` for replacing `ActionMailer::Base.view_paths <<`.
+
+## Rename view templates
+
+[Example](https://github.com/henare/adminbootstraptheme/commit/b616b636c283ae6cf696a6af1fa481f371baf2b6)
+
+Rename view templates from `filename.rhtml` to `filename.html.erb`.
+
+Run this in the root of your theme directory:
+
+ for r in $(find lib/views -name '*.rhtml'); do echo git mv $r ${r%.rhtml}.html.erb; done
+
+[GOTCHA!](https://github.com/openaustralia/alavetelitheme/commit/65e775488822367d981bb15ab2cbcf1fce842cc2)
+One exception is mailer templates, these should be renamed to
+`filename.text.erb` as we only use text emails.
+
+## The Configuration class has been renamed
+
+[Example](https://github.com/openaustralia/alavetelitheme/commit/db6cca4650216c6f85acffaea380727344f0f740)
+
+Due to a naming conflict, `Configuration` has been renamed to `AlaveteliConfiguration`.
+
+You may have this in your theme for things like `Configuration::site_name`, just change it to `AlaveteliConfiguration::site_name`
+
+## request.request_uri is deprecated
+
+[Example](https://github.com/openaustralia/alavetelitheme/commit/d670eeebfb049e1dc83fdb36a628f7722d2ad419)
+
+Replace instances of `request.request_uri` with `request.fullpath`
+
+## content-inserting <% %> block helpers are deprecated
+
+[Example](https://github.com/openaustralia/alavetelitheme/commit/a4b13bbd76249b3a28e2a755cede20dd9db30140)
+
+The Rails 3 releases notes are [irritatingly
+imprecise](http://edgeguides.rubyonrails.org/3_0_release_notes.html#helpers-with-blocks)
+about which such helpers have changed. You can find some candidates
+with this `git grep` command:
+
+ git grep -E '<%[^=].*(_for|_tag|link_to)\b'
+
+(Ignore `content_for` in those results.)
diff --git a/doc/THEMES.md b/doc/THEMES.md
index c5e4a3eee..8c4b927da 100644
--- a/doc/THEMES.md
+++ b/doc/THEMES.md
@@ -42,8 +42,8 @@ explanation.
You can also install the sample theme by hand, by running:
- ./script/plugin install git://github.com/mysociety/alavetelitheme.git
-
+ bundle exec rails plugin install git://github.com/mysociety/alavetelitheme.git -r rails-3
+
The sample theme contains examples for nearly everything you might
want to customise. You should probably make a copy, rename it, and
use that as the basis for your own theme.
@@ -66,8 +66,8 @@ add custom help pages, as described below.
The core templates that comprise the layout and user interface of an
Alaveteli site live in `app/views/`. They are use Rails' ERB syntax.
For example, the template for the home page lives at
-`app/views/general/frontpage.rhtml`, and the template for the "about
-us" page is at `app/views/help/about.rhtml`.
+`app/views/general/frontpage.html.erb`, and the template for the "about
+us" page is at `app/views/help/about.html.erb`.
Obviously, you *could* edit those core files directly, but this would
be a Bad Idea, because you would find it increasingly hard to do
@@ -90,7 +90,7 @@ the main Rails app -- see `alavetelitheme/install.rb` to see how this
happens.
The partial at
-`alavetelitheme/lib/views/general/_before_head_end.rhtml` includes the
+`alavetelitheme/lib/views/general/_before_head_end.html.erb` includes the
custom CSS in your theme's stylesheet folder (by convention, in
`alavetelitheme/public/stylesheets/`), with:
@@ -137,20 +137,20 @@ The latter must have one method:
When you've added your extra states, you also need to create the following files in your theme:
-* `lib/views/general/_custom_state_descriptions.rhtml`: Descriptions
+* `lib/views/general/_custom_state_descriptions.html.erb`: Descriptions
of your new states, suitable for displaying to end users
-* `lib/views/general/_custom_state_transitions_complete.rhtml`:
+* `lib/views/general/_custom_state_transitions_complete.html.erb`:
Descriptions for any new states that you might characterise as
'completion' states, for displaying on the categorisation form that
we ask requestors to fill out
-* `lib/views/general/_custom_state_transitions_pending.rhtml`: As
+* `lib/views/general/_custom_state_transitions_pending.html.erb`: As
above, but for new states you might characterise as 'pending'
states.
You can see examples of these customisations in
[this commit](https://github.com/sebbacon/informatazyrtare-theme/commit/2b240491237bd72415990399904361ce9bfa431d)
for the Kosovan version of Alaveteli, Informata Zyrtare (ignore the
-file `lib/views/general/_custom_state_transitions.rhtml`, which is
+file `lib/views/general/_custom_state_transitions.html.erb`, which is
unused).
# Adding new pages in the navigation