Edgewall Software
Modify

Opened 11 years ago

Closed 10 years ago

#11195 closed enhancement (worksforme)

New Quickjump for displaying "Custom Query"

Reported by: franz.mayer@… Owned by:
Priority: normal Milestone:
Component: search system Version: 1.0.1
Severity: normal Keywords: search quickjump
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Currently you need to click to "View Tickets" and then to "Custom Query" to get to the "Custom Query" page (in our trac environment, we have by default a specific report displayed).

It would be nice if there is a quickjump / quick link to get to page "Custom Query" and "Available Reports".

For example entering {q} in the search box would jump to page "Custom Query" and {r} to "Available Reports".

Attachments (0)

Change History (1)

comment:1 by Peter Suter, 10 years ago

Resolution: worksforme
Status: newclosed

So far, two forms of Quickjump search terms are recognized:

  1. Search terms starting with / quickjump into the source browser.
  2. Search terms that are local wiki links quickjump to that link.

So {1}, [42] or #42 are quickjumps because they are wiki links. More quickjumps can be implemented by adding more wiki links. You could add a tiny plugin to do something like this:

from genshi.builder import tag

from trac.core import *
from trac.wiki import IWikiSyntaxProvider


class QuickJumpToReportOrQueryPage(Component):
    implements(IWikiSyntaxProvider)

    def get_link_resolvers(self):
        return []

    def get_wiki_syntax(self):
        yield (r'\{r\}', self._format_report_link)
        yield (r'\{q\}', self._format_query_link)

    def _format_report_link(self, formatter, ns, match):
        return tag.a("Reports", href=formatter.href.report(), title="Reports")

    def _format_query_link(self, formatter, ns, match):
        return tag.a("Query", href=formatter.href.query(), title="Query")

Adding this to Trac itself seems questionable though, as reasonable wiki link syntax already exists to link to the report and query pages. And existing wiki links can be used as quickjumps. So you can already use [/query] and [/report] as quickjumps.

These are not exactly quick to type though. (With #9643 this might not be a problem anymore.)

But I'm still closing as worksforme since it technically already works (with slightly longer search terms, or a tiny plugin for customized search shorter terms).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.