alphagov/whitehall — pull request #293 by tomafro (2013-03-01 11:23:15+00:00)
Title: View all editions of a type for a particular language and world location

Pivotal: https://www.pivotaltracker.com/story/show/44634725

This story is essentially to implement the pages 'view all' links go to on world location pages, when viewed in a language other than English. When looking at, say `/world/spain.es` in Spanish, only policies, announcements, etc both relating to spain and translated to Spanish are shown. The 'view all' links should therefore go to the full list of documents relating to Spain and translated to Spanish.

After discussion with Ross and the developers, it was decided that the most consistent experience would be to extend the current filter pages that the `view all` links would go to if viewed in English, to work for different locales. As they are (mostly) based on rummager that doesn't yet support restricting by locale, a valuable first step would be to provide minimal versions of these pages when viewed in a non-english locale, using the old Mysql document filter. This commit achieves this.

Some points to note:

For announcements and publications, when viewed in another locale the index will be displayed but only allowing choice of world location. Although not part of the story, it's therefore possible to view all documents in a language by selecting 'All locations'. All other filters are hidden. All other filtering options are hidden, and the results summary is also not shown (as translating a complex generated sentence would be a massive pain).

For policies, even the world location filter is hidden as it is not available in even the English language version of the filter. I'm going to fix this next, but feel this pull request is already getting too big.

For world priorities there is no 'view all' link so I have skipped them.