Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#52781 closed enhancement (fixed)

Trac: link "Keywords:" label in ticket viewer and editor with the corresponding guideline wiki page

Reported by: mkae (Marko Käning) Owned by: admin@…
Priority: Normal Milestone:
Component: server/hosting Version:
Keywords: Cc:
Port:

Description

Often I stumbled over that I had to search for the TicketsKeywordGuidelines wiki page, although it probably could easily be linked to via the "Keywords:" label in the ticket editor and view.

Change History (9)

comment:1 Changed 7 years ago by neverpanic (Clemens Lang)

This can be done using Genshi, Trac's template engine. See https://github.com/macports/trac.macports.org/blob/master/templates/site.html for an example using py:match statements. Unfortunately those matches and ifs are quite compute-heavy and would have to be run on every page, so we might decide not to do this for performance reasons.

comment:2 Changed 7 years ago by mkae (Marko Käning)

Could we perhaps hard-code this URL into trac's template instead?

Not so infrequently people fill in invalid keywords...

comment:3 Changed 7 years ago by raimue (Rainer Müller)

Trac should be extensible enough that we do not need to edit the upstream templates. It will probably even be the same Genshi code, no matter where we place it.

comment:4 in reply to:  3 ; Changed 7 years ago by mkae (Marko Käning)

Replying to raimue:

Trac should be extensible enough

I don't doubt that, but according to Clemens Genshi would require too much CPU.

comment:5 in reply to:  4 Changed 7 years ago by raimue (Rainer Müller)

I don't think there would be any real problem. We are already adding the ticket guidelines banner that way and that is also evaluated on every page load.

comment:6 Changed 7 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: newclosed

In 73c7689e7f95d950e1e72105ccaad4bd92b0633a/trac.macports.org:

templates: Link ticket keyword label to guidelines

Closes: #52781

comment:7 Changed 7 years ago by raimue (Rainer Müller)

I added the link only to the forms for editing, as I think it is only relevant there.

It is now deployed on trac.macports.org. We can always disable it again later, if we observe an increase in CPU usage.

comment:8 Changed 7 years ago by neverpanic (Clemens Lang)

Since you used req.path_info.startswith('/ticket') I'd expect this to show up on this ticket as well, but that doesn't seem to be the case. Am I misunderstanding something?

comment:9 Changed 7 years ago by raimue (Rainer Müller)

It only shows up below on the form below to modify the ticket (if you expand it). I did not think it would be useful in the summary at the top, as I thought it would only be necessary when editing.

Note: See TracTickets for help on using tickets.