Searching

11 views
Skip to first unread message

Jason Dunham

unread,
Jun 8, 2007, 12:54:41 AM6/8/07
to trac-...@googlegroups.com
Some questions/suggestions

1. It would be great to have a drop-down next to the search textbox to
search only tickets, or only wiki, or the changesets, etc.
2. I usually search with the search button, but 99% of the time, I only
want to search tickets so it would be nice to default the other
checkboxes to unchecked. Is there a way to make that change in my local
version? (#1 would probably eliminate this need, but seems harder to
implement).
3. When searching tickets, it would be great to search only open
tickets, or failing that, it would be great to see the ticket status, or
else have the ticket number or name shown in a strikethrough font if closed.

Thanks,
Jason Dunham

Michael Renzmann

unread,
Jun 8, 2007, 4:48:31 AM6/8/07
to trac-...@googlegroups.com
Hi.

The search form is part of the header.cs template. Search for '<form
id="search" ...>'.

> 1. It would be great to have a drop-down next to the search textbox to
> search only tickets, or only wiki, or the changesets, etc.

In header.cs replace the current "<form ...>...</form>" stuff with:

=== cut ===
<form id="search" action="<?cs var:trac.href.search ?>" method="get">
<?cs if:trac.acl.SEARCH_VIEW ?><div>
<label for="proj-search" style="display: none;">Search:</label>
<input type="text" id="proj-search" name="q" size="10" accesskey="f"
value="" />
<input type="submit" value="Search" /><br />
Search in:
<input type="checkbox" name="ticket" value="on" checked="checked" />
<label for="ticket">Tickets</label>
<input type="checkbox" name="wiki" value="on" checked="checked" />
<label for="wiki">Wiki</label>
<input type="checkbox" name="changeset" value="on" checked="checked" />
<label for="changeset">Changesets</label>
</div><?cs /if ?>
</form>
=== cut ===

In order to fix the display you should adjust the following in trac.css:
=== cut ===
/* Quick search */
#search {
...
margin: -1em 0 3em;
...
}
=== cut ===

and remove the following line (or comment it out with "/* ... */"):
=== cut ===
#search label { display: none }
=== cut ===

> 2. I usually search with the search button, but 99% of the time, I only
> want to search tickets so it would be nice to default the other
> checkboxes to unchecked.

In the "original" header.cs use this:
=== cut ===
<input type="hidden" name="wiki" value="off" />
<input type="hidden" name="changeset" value="off" />
<input type="hidden" name="ticket" value="on" />
=== cut ===

If you use the suggestion from one, use the following instead:
=== cut ===
<input type="checkbox" name="ticket" value="off" />
<label for="ticket">Tickets</label>
<input type="checkbox" name="wiki" value="on" checked="checked" />
<label for="wiki">Wiki</label>
<input type="checkbox" name="changeset" value="off" />
<label for="changeset">Changesets</label>
=== cut ===

> 3. When searching tickets, it would be great to search only open
> tickets, or failing that, it would be great to see the ticket status, or
> else have the ticket number or name shown in a strikethrough font if
> closed.

No idea for that one at this time.

Bye, Mike

Emmanuel Blot

unread,
Jun 10, 2007, 9:27:45 AM6/10/07
to trac-...@googlegroups.com
> 1. It would be great to have a drop-down next to the search textbox to
> search only tickets, or only wiki, or the changesets, etc.

We try to keep the main UI unobstructed with extra buttons/fields, etc.
However, if you want to search something specific, simply click on the
"Search" item of the navigation bar to jump to the search page that
offers such filter options.

> 2. I usually search with the search button, but 99% of the time, I only
> want to search tickets so it would be nice to default the other
> checkboxes to unchecked. Is there a way to make that change in my local
> version? (#1 would probably eliminate this need, but seems harder to
> implement).

I'd like to have this feature too. I think it could be quite useful to
store the search option on a per-user basis, so that the default
search options are restored from one search session to the other.

Search the ticket DB on trac.edgewall.org to see if this feature has
already been
requested, and feel free to fill in a new ticket if not.

> 3. When searching tickets, it would be great to search only open
> tickets, or failing that, it would be great to see the ticket status, or
> else have the ticket number or name shown in a strikethrough font if closed.

I miss this feature as well.
The second option (strikethrough) has already been requested, AFAICT,
but is yet to be implemented.

Cheers,
Manu

Reply all
Reply to author
Forward
0 new messages