Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor info boxes on MPs profiles #1712

Open
ajparsons opened this issue Apr 26, 2023 · 0 comments
Open

Refactor info boxes on MPs profiles #1712

ajparsons opened this issue Apr 26, 2023 · 0 comments

Comments

@ajparsons
Copy link
Contributor

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

  • setup(member_obj)
  • yield_sub_menu_items()
  • get_context()

properties

  • template_name
  • mp_page
  • page_order

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant