How normal users read the detail of versions?

15 views
Skip to first unread message

胡争辉

unread,
Nov 17, 2007, 6:19:04 AM11/17/07
to trac-...@googlegroups.com
Thanks for any clue.
I am an administrator of a Trac system. So I can edit version at /admin/ticket/versions. I noticed that I can edit the name, time and description of a version. But normal users only can see the name of a version. How normal users read the time and description of versions?

--
http://www.goumin.com/
QQ: 443089607
QQ mail: 4430...@qq.com
Skype: huzhenghui
Gtalk: huzhengh

Thijs Triemstra | Collab

unread,
Nov 17, 2007, 11:10:18 AM11/17/07
to trac-...@googlegroups.com
I'd also like to know. Where are those descriptions visible for the user?

Thijs

Peter Suter

unread,
Jun 21, 2012, 1:28:58 PM6/21/12
to trac-...@googlegroups.com
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

Ino

unread,
Jun 22, 2012, 12:25:31 PM6/22/12
to trac-...@googlegroups.com
Dear Peter,

The macro works and it is exactly what I needed!

Thank you very much! I have only recently started to dive into and maintain our Trac environment, it is a steep learning curve but I am getting there. You have now introduced me to a powerful way of customizing the wiki pages - I am going to get better acquainted with the macro's and plugins now, thank you for jumpstarting me on this track.

Regards,
Ino
Reply all
Reply to author
Forward
0 new messages