Mailing List Archive

[The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: daniel
Type: enhancement | Status: new
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: normal | Keywords:
---------------------------------+------------------------------------------
The following code
{{{
#!python
implements(INavigationContributor)

def get_navigation_items(self, req):
yield 'projnav', 'guide', html.a( 'Project Guide',
href=self.env.href.wiki('ProjectGuide') )
}}}
crashes within source:/trunk/trac/web/chrome.py, as there's no Option
"projnav_order" defined.

The attached patch enables that code without the need to define an Option.

This way, new custom navigation items can be generated dynamically,
without any modifications in the source code / ini-files.

--
Ticket URL: <http://trac.edgewall.org/ticket/3692>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: new
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Changes (by cboos):

* owner: daniel => cboos
* severity: normal => minor

Comment:

A few (minor) remarks:
- in attachment:ChromeNavigationLinks.diff, you used a "catch all"
exception handler, which is generally a bad idea. Better be specific, in
this case catching `AttributeError` is enough.
- if you can, please directly provide us with a full-contained example
component, in this case something like:
{{{
#!python
from trac.core import *
from trac.util.html import html
from trac.web.chrome import INavigationContributor

class ProjectNavigation(Component):
implements(INavigationContributor)

def get_active_navigation_item(self, req):
return 'guide'

def get_navigation_items(self, req):
yield 'projnav', 'guide', \
html.a('Project Guide', href=req.href.wiki('ProjectGuide'))
}}}
Note also that you should get used to write `req.href` instead of
`self.env.href`, as the latter form is now deprecated and will probably go
away in [milestone:0.11].

As for the (fixed) patch itself, I'm +1 if you can show us how you intend
to make use of the non-standard navigation category (i.e. something else
than 'metanav' and 'mainnav').

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:1>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: new
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment (by mgood):

Well, if we're going to support custom navigation items then they should
probably support ordering as well. However, I don't want to keep pushing
back 0.10 for new features. Can we at least push this to 0.10.1 to get
some more information?

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:2>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: new
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment (by ilias@lazaridis.com):

Replying to [comment:1 cboos]:

> - if you can, please directly provide us with a full-contained example
component,

the code is located
[http://dev.lazaridis.com/base/browser/infra/TracX/tracx/menus.py here]
(corrected to use "self.env.href"):

> As for the (fixed) patch itself, I'm +1 if you can show us how you
intend to make use of the non-standard navigation category (i.e. something
else than 'metanav' and 'mainnav').

You can find an example usage here (menu below project title):

http://dev.lazaridis.com/base

I'll attach a corrected patch.

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:3>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: new
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment (by ilias@lazaridis.com):

Replying to [comment:2 mgood]:
> Well, if we're going to support custom navigation items then they should
probably support ordering as well. However, I don't want to keep pushing
back 0.10 for new features. Can we at least push this to 0.10.1 to get
some more information?

* Custom navigation items '''are already supported'''. This patch removes
just a tiny defect (possibly I should have filed a "defect" instead of
"enhancement"), thus "custom navigation items" can be created again. This
patch can/should be applied now, as it corrects the defect behaviour of
the ordering-mechanism.

* See #3695: The ordering mechanism could be refactored in order to avoid
the necessity to hardcode the option within chrome.py. This should be
implemented later, as it changes behaviour and would possibly block the
0.10 release.

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:4>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: closed
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution: fixed
Keywords: |
---------------------------------+------------------------------------------
Changes (by cboos):

* status: new => closed
* resolution: => fixed

Comment:

Implemented slightly differently in r3717.

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:5>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: [PATCH] - Enable Generic use of INavigationContributor [ In reply to ]
#3692: [PATCH] - Enable Generic use of INavigationContributor
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: enhancement | Status: closed
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution: fixed
Keywords: |
---------------------------------+------------------------------------------
Comment (by ilias@lazaridis.com):

very nice, follow-up issue: #3704

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:6>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #3692: smart+question [ In reply to ]
#3692: smart+question
---------------------------------+------------------------------------------
Reporter: ilias@lazaridis.com | Owner: cboos
Type: defect | Status: closed
Priority: normal | Milestone: 0.10
Component: project | Version: 0.10b1
Severity: minor | Resolution: fixed
Keywords: |
---------------------------------+------------------------------------------
Changes (by Nathaniell):

* type: enhancement => defect
* summary: [PATCH] - Enable Generic use of INavigationContributor =>
smart+question

Comment:

hello guys! http://hometown.aol.com/skylineblog/

--
Ticket URL: <http://trac.edgewall.org/ticket/3692#comment:7>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---