Mailing List Archive

Milestone list
Hello all,

Is there a way to create a short list of (completed) milestones within
a Wiki page, as it is possible to create ticket lists using the
embedded TicketQuery macro ?

Thanks,
Manu

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: Milestone list [ In reply to ]
> Is there a way to create a short list of (completed) milestones within
> a Wiki page, as it is possible to create ticket lists using the
> embedded TicketQuery macro ?

How about [[TicketQuery(format=table,col=milestone)]]?

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: Re: Milestone list [ In reply to ]
> [[TicketQuery(format=table,col=milestone)]]

It shows all the milestones' tickets, I'd like to get the milestone
list only (milestone name and date, mostly).

Manu.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
RE: Re: Milestone list [ In reply to ]
On 2011-06-06 at 08:11:29, Emmanuel Blot wrote:
>> [[TicketQuery(format=table,col=milestone)]]
>
> It shows all the milestones' tickets, I'd like to get the milestone
> list only (milestone name and date, mostly).

Ah, I was afraid of that. Sorry, I don't have any other suggestions.
Unless TicketQuery has some deduplication option. But it likely doesn't
because it usually only gets each ticket once.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
RE: Re: Milestone list [ In reply to ]
Emmanuel Blot wrote:

> It shows all the milestones' tickets, I'd like to get the milestone
> list only (milestone name and date, mostly).

isn't this a roadmap thingy?
how about
roadmap?show=completed

Have a nice day,
Berny

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: Re: Milestone list [ In reply to ]
> Ah, I was afraid of that.  Sorry, I don't have any other suggestions.
> Unless TicketQuery has some deduplication option.  But it likely doesn't
> because it usually only gets each ticket once.

I wrote a simple macro, it was just a matter of a couple of lines.

Thanks anyway,
Cheers,
Manu

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
RE: Re: Milestone list [ In reply to ]
Emmanuel Blot wrote:

>> Ah, I was afraid of that.  Sorry, I don't have any other suggestions.
>> Unless TicketQuery has some deduplication option.  But it likely doesn't
>> because it usually only gets each ticket once.

> I wrote a simple macro, it was just a matter of a couple of lines.

something like
select name,due,completed from milestone where completed > 0 order by name
?

Have a nice day,
Berny

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: Re: Milestone list [ In reply to ]
> something like
>  select name,due,completed from milestone where completed > 0 order by name
> ?

The macro code:

from datetime import datetime
from genshi.builder import tag
from trac.ticket import Milestone
from trac.util.datefmt import format_datetime, utc
from trac.wiki.api import parse_args
from trac.wiki.macros import WikiMacroBase

class MilestonesMacro(WikiMacroBase):
"""Show a list of milestones

This macro accepts a comma-separated list of optional formatters:
- `all` shows all milestones
- `format` is a keyed parameter accepting a Python time formatting string
"""

def expand_macro(self, formatter, name, content):

def milestone_anchor(milestone):
return tag.a(milestone.name,
href=formatter.href.milestone(milestone.name))

formatter.perm.require('MILESTONE_VIEW')
largs, kwargs = parse_args(content)
milestones = Milestone.select(self.env, True)
if 'all' not in largs:
milestones = [m for m in milestones if m.completed]
return tag.div(tag.dl([(tag.dt(milestone_anchor(milestone)),
tag.dd(format_datetime(milestone.due,
kwargs.get('format','%x'))))
for milestone in milestones],
class_='wiki compact'))

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
RE: Re: Milestone list [ In reply to ]
Emmanuel Blot wrote:

> The macro code:
...

thanks for sharing this.

Have a nice day,
Berny

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