mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 50 forks source link

Refactor info boxes on MPs profiles #1712

Open ajparsons opened 1 year ago

ajparsons commented 1 year ago

I'm confusing myself about how each of these boxes is working and is connected to the navigation, and am tempted to refactor this a bit for the long term.

Possible approach of having subclasses of something like MPInfoBox that has:

Methods

properties

Where a view will then initialise a model with with the MP info, and render the contents in order (so these pages themselves become quite simple, with the complexity more isolated in each MpInfoBox subclass.

The simplest approach is of course to just do mild tweaks, but I think in the long run the flexibility might be nicer. Writing up to come back to later.