Ticket list in a box on the wiki page

News

This macro is unified for several trac versions (0.9, 0.10, 0.11, 0.12dev) since 2008-07-31 (r4088). Note that repository structure is changed and the version directory are no longer exist. Get latest source from here.

Description

This macro displays the list of ticket numbers in a box on the right side of the page compactly. You can specify the tickets explicitly or use the result of reporting. The tickets will be displayed as sorted and uniq'ed. An example image is shown on the right of this page.

Note: 'query' format is not yet supported.

Bugs/Feature Requests

Existing bugs and feature requests for TicketBoxMacro are here.

If you have any issues, create a new ticket.

Download and Source


(2008/07/31 : Files for each trac versions are unified.)
(2008/03/28 : TicketBoxMacro for 0.8 is obsoleted.)

Install

For trac 0.10 or before, copy TicketBox.py to wiki-macros directory of your trac environment or system wide wiki-macros directory.

For trac 0.11 or later, copy TicketBox.py to plugins directory of your trac environment (no need enable this plugin explicitly). Or copy it to system wide plugins directory then enable the TicketBox plugin via admin page.

Basic Usage

These example shows the simple list of tickets by specifiying ticket numbers. '#' character can be omitted:

[[TicketBox(#1,#7,#31)]]
[[TicketBox(1,7,31)]]

These examples lists the tickets from the report result. Second examplesh uses dynamic variable 'COMPONENT'. The special variable 'USER' is always avaiable and it is your login name (or 'anonymous' if not logged in). You can override the variable 'USER' like third example.

[[TicketBox({1})]]
[[TicketBox([report:1])]]
[[TicketBox([report:9?COMPONENT=TicketBox])]]
[[TicketBox([report:9?USER=foo])]]

If field name of ticket id is not 'ticket' in report report definition, You can specify by ticket=xxx:

[[Ticketbox({20},ticket=id)]]

TracQuery style of query string can be used. And it aslo can be used in report defintion (starting with query:),

[[TicketBox([query:status=new])]]

The combination of above is allowed. The tickets are listed as sorted and uniq'ed:

[[TicketBox({1},#50,{2},[query:keywords~=important],100)]]

If nosort option is specified, tickets are listed without sorting:

[[TicketBox(3,2,1,{1},nosort)]]

Displaying

You can specify the size of the box:

[[TicketBox(500pt,{1})]]
[[TicketBox(200px,{1})]]
[[TicketBox(25%,{1})]]

You can specify the title. The value should be surrounded by single or double quote. You can also embed the number of tickets by '%d' in title string like third example:

[[TicketBox('Related Tickets',#1,#2)]]
[[TicketBox("Related Tickets",#1,#2)]]
[[TicketBox("There are %d tickets",{1})]]

If you do not make box floating, put the 'inline' argument. The box is placed in the text. If you want to show with summary string, put 'summary' argument:

[[TicketBox({1},inline)]]
[[TicketBox({1},summary,inline)]]

nowrap forces no wrap of line. It is usefull with summary option. If this option is specified, line length may exceeds specified width.

[[TicketBox({1},summary,nowrap)]]

Text color, background color, border line color and float position can be specified:

[[TicketBox({1},float=left,color=green,background=transparent,border-color=red)]]

Author/Contributors

Author: gotoh
Contributors:

[4091] by gotoh on 07/31/08 03:42:12

Remove unnecessary debug code which works on only windows.

[4090] by gotoh on 07/30/08 22:12:49

Stop managing indivisual files for each trac versions. Use unified one on the top.

[4089] by gotoh on 07/30/08 22:09:24

Move files version directory to the top.

[4088] by gotoh on 07/30/08 22:03:51

Unify the versions for 0.9, 0.10, 0.11 and 0.12. Tested on 0.9.6, 0.10.5, 0.11 and 0.12dev-r7419.

[4087] by gotoh on 07/30/08 21:45:35

Fix bug of style changing. Without this fix, changed style remains next use of macro by overwriting global data.

[4085] by gotoh on 07/30/08 12:54:21

Better error handling when specified report number is not found.

Attachments