alphagov/whitehall — pull request #471 by tekin (2013-04-22 12:56:36+00:00)
Title: Historical accounts

Two stories:
Back-end - https://www.pivotaltracker.com/story/show/45246029
Front-end - https://www.pivotaltracker.com/story/show/45018455

This adds the concept of historical accounts for people in roles, primarily to allow the Past Prime Ministers within the History section to be administered.

An HistoricalAccount can be added to a person for a given role (or multiple roles). There are no restrictions on the roles for which historical accounts can be added, although only historic prime ministerial appointments have been wired up on the front-end.

This branch also reworks the management of People in admin, giving them a show page and simplifies the index action, reducing it's load time considerably. It does mean that both the "Manage translations" and "Delete" controls are no longer on the index action, but given that these actions should not be used very often, moving them to the show page seems like a good tradeoff to speed things up.

The actual process for adding an historical account is slightly convoluted due to the dependencies required: First, the Person must be created; Second, an historic RoleAppointment must be created for the Person and the Role. Once both the person and role appointment exists, an HistoricalAccount can be created for that person in that role. I did consider making it easier to appoint people to roles by adding a "Roles" tab to the person page, but there is an urgency to get this out the door so the content can be loaded in time for launch.

Note that I've left in the routing/controller handling for listing the historical appointments of past chancellors, even though we now know that they will have a static page for the time being (https://www.pivotaltracker.com/story/show/48447585) - it will be easy enough to override the routing for that static page, and leaving the mechanism in place for listing historic appointments for different roles should make it easier to switch things around in future if/when chancellors/foreign secretaries are also managed from admin, rather than as static pages.