Edgewall Software

Ticket #6005 (closed enhancement: wontfix)

Opened 15 months ago

Last modified 15 months ago

[PATCH] Associate arbitrary navigation contributors to handlers

Reported by: Paolo Capriotti Owned by: jonas
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc:

Description

This patch allows a navigation contributor to be different from a request handler, and still have the corresponding navigation item being active when the handler is running. To associate a handler with a navigation contributor just set a 'contributor_delegate' member in your handler instance.

Attachments

contributor-delegate.diff (1.1 KB) - added by Paolo Capriotti 15 months ago.

Change History

Changed 15 months ago by Paolo Capriotti

follow-ups: ↓ 2 ↓ 3   Changed 15 months ago by nkantrowitz

Whats the use case for this? -1 unless there is a very compelling one.

in reply to: ↑ 1   Changed 15 months ago by anonymous

Replying to nkantrowitz:

Whats the use case for this? -1 unless there is a very compelling one.

The idea behind this and #6003 is to be able to override a builtin navigation item. For instance, if you define anIRequestHandler that overrides BrowserModule by assigning it a higher priority, when this handler is activated, the "Browse Source" link is not highlighted. So with this patch you can simply add a line

self.contributor_delegate = BrowserModule(self.env)

to solve the issue. Is there perhaps a better way to do all of this?

in reply to: ↑ 1   Changed 15 months ago by Paolo Capriotti

  • status changed from new to closed
  • resolution set to wontfix

I've just found how this is supposed to be done: just let the request handler implement INavigationContributor as well, and let it return:

  • an empty list in get_navigation_items;
  • the correct navigation item to highlight in get_active_navigation_item.

Sorry, I didn't think about that. No need for this patch.

Add/Change #6005 ([PATCH] Associate arbitrary navigation contributors to handlers)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.