dimagi/core-hq — pull request #740 by mwhite (2013-03-08 19:06:26+00:00)
Title: fix pact sidebar issue

My dynamic navigation framework requires a structural isomorphism between URLs and navigation elements (tabs, subtabs, menu items, submenu items).

That is, a URL for a tab has to be a proper substring of the URL for all of it's subtabs if there are subtabs, which have to be proper substrings of the URLs for all of their menu items, which have to be proper substrings of the URLs for all of their submenu items.

I made some comments about not being sure whether this was ideal, but couldn't think of any better way to do it. Basically, to dynamically generate the navigation UI, you need some way to determine what navigation elements are currently active/should be highlighted. I couldn't think of any other way to do this without a lot more effort and/or complexity.

The side effect is that reports/ and reports/adm are both subtabs of the main reports tab even though reports/adm is a sub-url of reports, which breaks the isomorphism, so I added a hack here. This broke report URLs with 'admin' in them. Doh.

Ultimately we should maybe change reports/adm to adm_reports? Not sure.