Hi

> In administration view, I get a table of all the versions and
accompanying dates.
Is there a way to include this table in a wiki page so that anyone can
read it?
A macroor query ...

The simplest way would probably be a "Ticket Report". Create a new ticket report and write the following SQL query in the "Query for Report" field:

SELECT * FROM version

If you prefer a macro, try this:

from genshi.builder import tag
from trac.wiki.macros import WikiMacroBase
from trac.ticket import model
from trac.util.datefmt import format_datetime

class ListVersionsMacro(WikiMacroBase):
    """List all versions and their dates.
    """

    def expand_macro(self, formatter, name, content):
        versions = model.Version.select(self.env)
        return tag.table(
            tag.thead(tag.tr(tag.th("Version"), tag.th("Released"))),
            tag.tbody([tag.tr(
                tag.td(version.name),
                tag.td(version.time and format_datetime(version.time))
            ) for version in versions]), class_="listing")

Hope this helps,
Peter

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to