Edgewall Software
Modify

Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#3293 closed defect (fixed)

Add "No Tickets" Result to TicketQuery macro

Reported by: brian Owned by: Jonas Borgström
Priority: high Milestone: 0.11
Component: ticket system Version: 0.9.5
Severity: normal Keywords: query
Cc: bpelton@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I think the TicketQuery macro should display "No results" or "No tickets" or something to indicate the query worked, but that there are no tickets.

For instance, I have some pages the describe the modules of the program. Each page lists the open tickets for that module (yes, I know this is available elsewhere, but sometimes it is helpful to have in the wiki too) The heading says "Open Tickets" and if there aren't any, it just has whitespace under it. This hints that there are no open tickets, but it isn't concrete.

I modified query.py to write "No open tickets" so it would be clear.

This isn't the best way, because not all TicketQuery usage will be looking for open tickets. It would be nice to have a parameter of the TicketQuery macro be "message if none found". So you could write:

[[TicketQuery(status=new,"No new tickets")]]

This would list all the new tickets, or if there aren't any, it would display "No new tickets"

Attachments (2)

query.py (27.6 KB ) - added by brian 19 years ago.
Modified query.py to allow param for no results message
brian_patch.patch (1.2 KB ) - added by brian 19 years ago.
An attempt at making a patch

Download all attachments as: .zip

Change History (10)

comment:1 by brian, 19 years ago

I do not know the Python programming language, but I took a stab at making this work.

I'm attaching the whole query.py file.

by brian, 19 years ago

Attachment: query.py added

Modified query.py to allow param for no results message

by brian, 19 years ago

Attachment: brian_patch.patch added

An attempt at making a patch

comment:2 by Christian Boos, 19 years ago

Milestone: 0.100.11

Not for 0.10

comment:3 by sid <sid.wiesner@…>, 18 years ago

Keywords: custom ticket query added

comment:4 by sid, 18 years ago

Keywords: TracQuery custom ticket removed

Or why not something even simpler (based on trunk / r4326):

  • trac/ticket/query.py

     
    782782                return html.DL([(html.DT(ticket_anchor(ticket)),
    783783                                 html.DD(ticket['summary']))
    784784                                for ticket in tickets], class_='wiki compact')
     785        else:
     786            return html.P('No tickets found.')

comment:5 by brian, 18 years ago

There might be some cases when no query results should be blank. Or the text might be specific to the query.

It seems like having a parameter just gives more flexibility and the query macro seems to be a good place to have lots of flexibility.

comment:6 by anonymous, 18 years ago

Priority: normalhigh
Severity: minornormal
Type: enhancementdefect

Uh, yeah… looking at the version of this page on my trac site is massively confusing, because there's nothing in the list and it looks like the query isn't working. One really can't tell from that what the macro is supposed to be doing.

I've upped the priority because unless addressed, for many people I think this feature will just appear to be broken.

comment:7 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

comment:8 by Christian Boos, 18 years ago

Implemented in r5458. That "No results" string is returned in a span.query_no_results element, so that it's possible to tweak its presentation further (red, blink … or even display: none to match the previous behavior).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.