Changes to base Alaveteli app from AsktheEU theme

36 views
Skip to first unread message

David Cabo

unread,
Dec 6, 2011, 3:55:07 PM12/6/11
to alavet...@googlegroups.com
 Hi everyone,
 
 Seb asked me a while ago to list the changes I did to the "core Alaveteli" from the AsktheEU theme, in order to see whether we can make the core app a bit more flexible to cover some of them. 
 
 I'm including all the changes from the theme, even if some are obvious and already documented, just to be thorough. I'm ordering them from the basic to the hack-ish (monkey-patching classes when I couldn't find a 'documented' plugin extension mechanism in Rails 2.x).
 
 1. Branded the site by overriding existing views as explained in the Themes doc [1]. Since we support multiple languages we have four versions of each view template: index.rhtml, index.de.rhtml...
 
 2. Added a number of custom states by modifying lib/customstates.rb; this is explained in the Themes doc already [1].
 
 3. In order to override some files in the lib/ folder (see next two points), we have to add the theme lib/ folder the LOAD_PATH, as shown in [2].
 
 4. Replaced default public body categories - which are defined in a .rb file in lib/ - with EU ones. [3]
 
 5. There's now a mechanism in the base Alaveteli to add custom routes, which were needed for a few extra help pages and a new listing page. The theme routes are added to lib/config/custom-routes.rb [4]
 
 6. We had to ammend the email footers and templates because of legalese, wording or references to FOI (which is UK-specific, and had to be replaced by 'access to information'). Note that just adding view template files in the right location as in point 1 will have _no_ effect. This patch is needed [5].
 
 7. We needed small changes to two controller actions (to have the blog items in the homepage, for example), so I had to patch two controllers [6].
 
 8. For i18n, some of the English strings from Transifex had to be ammended, mostly because they refer to FOI and a few times because AccessInfo didn't like the particular wording. This was sorted by having FastGetText use two linked repositories [7]: first it checks the app.po file from the theme, where some English strings are overriden [8], and if nothing is found it falls back to the core Alaveteli app.po.
 Also, some of the custom pages introduced by the theme - like the all-new homepage - had text that needed i18n; this was also handled through this mechanism. 
 There were just a few strings to i18n, so the app.po files were created by hand, and no Transifex project was really needed. However, overriding the base English strings like this is not easy to maintain, since it has to be done by a developer; ideally we would set up something in Transifex so Core English gets translated _by translators/editors_ to "AsktheEU English" for example. Haven't thought much about whether it's possible.

 9. Finally, we had to monkey patch some model classes [9] in order to a) get rid of FOI references in the law name, b) add an intro paragraph to the default letter, while ignoring it in the search snippets and c) not allow FOI officers to reply through the website, as AccessInfo wasn't sure this was safe in the EU case because of the email domain names.
 
 And that's it. :) Oh, well, there are a bunch of CSS tweaks too, some of them hiding a few links here and there, but that's quite straightforward.
 
 Any question, just let me know. And if I missed some simpler way I'd love to hear.

/david



Seb Bacon

unread,
Dec 7, 2011, 4:27:13 AM12/7/11
to alavet...@googlegroups.com
Thanks David, that's really useful!

I doubt I'll get a chance to address it properly until after the
holiday season. Right now, I'm looking into continuing performance
issues on WhatDoTheyKnow. These issues are to do with scale (WDTK has
around 90000 requests right now) so other Alaveteli users needn't
worry! We should have them fixed in due course. I will report back,
of course...

Thanks,

Seb

--
skype: seb.bacon
mobile: 07790 939224
land: 01531 671074

Francis Irving

unread,
Dec 7, 2011, 1:25:17 PM12/7/11
to alavet...@googlegroups.com
How many Gb of data ia WDTK up to now?

Francis

Seb Bacon

unread,
Dec 8, 2011, 3:56:49 AM12/8/11
to alavet...@googlegroups.com
On 7 December 2011 18:25, Francis Irving <fra...@mysociety.org> wrote:
> How many Gb of data ia WDTK up to now?

* The xapian database is 3.8G;
* The postgres database is 5.4G;
* The "raw emails" (stored on the filesystem these days) are nearly 50G!

Seb

Francis Irving

unread,
Dec 8, 2011, 12:22:57 PM12/8/11
to alavet...@googlegroups.com
Ah, 50G is a proper amount of data!

Will be curious to hear what the scaling bottleneck was...

Francis

Reply all
Reply to author
Forward
0 new messages