Opened 9 years ago
Closed 6 years ago
Last modified 3 years ago
#11317 closed enhancement (fixed)
Allow navigation items to be added through the mainnav or metanav sections
|Reported by:||Ryan J Ollos||Owned by:||Ryan J Ollos|
Added configurable features to the navigation:
Description (last modified by )
As mentioned at the bottom of the TracNavigation page, NavAddPlugin or MenusPlugin are still needed in order to add items to the navigation bars. It would be nice to be able to add new items that are defined in the
metanav sections, and without the use of plugins.
Two other features to consider:
- NavAddPlugin allows a permission to be specified for controlling visibility of the nav item.
- It would be useful to allow items to be moved between the metanav and mainnav by putting to item to the corresponding section of trac.ini (
Change History (18)
comment:1 by , 9 years ago
follow-up: 3 comment:2 by , 8 years ago
comment:3 by , 8 years ago
Replying to lkraav <leho@…>:
what are we thinking here @rjollos? probably an admin panel? or just imnproved handling of unknown
First, providing support for adding unknown
[mainnav] items. Eventually, add an admin panel.
comment:4 by , 8 years ago
th:NavAddPlugin is working well for me so far. shouldn't be difficult to import that code into core. are you aware of any shortcomings with it?
comment:5 by , 8 years ago
Unfortunately the code in th:NavAddPlugin doesn't provide a useful starting point. One major defect is that the active navigation item is not highlighted (th:#592). When implementing the feature in Trac we'll need to define the extra navigation items in the
[metanav] sections. The code will need to be implemented in Chrome.prepare_request().
I have a PoC of the feature that I'll post in a short while along with some issues that need to be solved.
comment:6 by , 8 years ago
Initial implementation in log:rjollos.git:t11317. The active navigation item is not highlighted, so more work is needed.
comment:7 by , 8 years ago
comment:8 by , 7 years ago
|Milestone:||next-dev-1.1.x → next-dev-1.3.x|
comment:9 by , 6 years ago
comment:10 by , 6 years ago
comment:11 by , 6 years ago
- DONE Edit 1.3/TracNavigation@2
- DONE Edited 1.3/TracInterfaceCustomization@2 and 1.3/TracInterfaceCustomization@3.
- DONE Edited 1.3/TracUpgrade@7
- DONE Edited wiki:NavAddPlugin@35 and wiki:NavAddPlugin@36.
comment:12 by , 6 years ago
|Milestone:||next-dev-1.3.x → 1.3.2|
|Status:||new → assigned|
comment:13 by , 6 years ago
Proposed changes in [c5641582/rjollos.git].
- I'll add more test coverage before committing changes.
- Documentation has been updated to describe the new features, see comment:11.
The changes include a new method
ComponentMeta.deregister. This aims to be a replacement for
EnvironmentStub.restore_component_registry. The downside to using those methods is that all components are removed from the registry, including those you may want to be active in the test case.
clear_component_registry must be called after the
EnvironmentStub is activated, so it doesn't allow selectively enabling/disabling components through the arguments to the initializer, instead it's necessary to call
EnvironmentStub.enable_component or define the test component class after the registry is cleared. With
ComponentMeta.deregister we can just cleanup the test components at the end of the test case, in
tearDownClass, and selectively enable/disable the built-in components that we want to be visible in the test case.
comment:14 by , 6 years ago
Tests and fixes in [01e17f99/rjollos.git] (log:rjollos.git:t11317_navadd.1). The active menu item is only highlighted when the path matches the
comment:15 by , 6 years ago
|Status:||assigned → closed|
Committed to trunk in r15777.
comment:16 by , 5 years ago
comment:17 by , 3 years ago
|Release Notes:||modified (diff)|
comment:18 by , 3 years ago
|Release Notes:||modified (diff)|
what are we thinking here @rjollos? probably an admin panel? or just improved handling of unknown