Opened 16 years ago
Closed 11 years ago
#3610 closed enhancement (fixed)
ListTagged macro should have distinct, optionally configurable formatting of closed tickets
Reported by: | anonymous | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | TagsPlugin |
Severity: | normal | Keywords: | ListTagged formatting |
Cc: | Michael Renzmann | Trac Release: | 0.11 |
Description
When ListTagged returns a ticket as a result, it does like that:
#id Open ticket description
#id Closed ticket description (closed)
It would be more intuitive if the closed ticket id was striked out, just like TracLinks. I'm using TagsPlugin 0.6 (I think I got it from trunk rather than tags at the time, though).
Attachments (3)
Change History (17)
comment:1 Changed 15 years ago by
Owner: | changed from Alec Thomas to Michael Renzmann |
---|
comment:2 Changed 15 years ago by
In version 0.6
, even with the option ignore_closed_tickets = False
, the closed tickets are not displayed with a strikethrough as one would expect. I'll test this behavior on the trunk version and if open a ticket if necessary.
comment:3 follow-ups: 4 5 Changed 15 years ago by
Summary: | ListTagged macro should display closed tickets striked → ListTagged macro should have an option to display closed tickets |
---|
With the latest version of the TagsPlugin from the trunk, [7384], when ignore_closed_tickets = False
, here is what the tickets associated with a particular tag looks like (from the /tags page, not generated with the ListTagged
macro, however the ListTagged
macro produces the same results).
In the 0.6 version of the plugin running under Trac 0.11.4
, the ticket status was not shown. It would be nice if the closed tickets were shown with a strikethrough for consistency with other behavior in Trac, but that seems to be an issue separate from having a ListTagged
macro option to show closed tickets. Currently, closed tickets are only shown if ignore_closed_tickets = False
.
It would also be nice to have a filter option on the /tags page to show / not show closed tickets in the results.
Changed 15 years ago by
Attachment: | TagsOpenClosedTickets.png added |
---|
comment:4 Changed 13 years ago by
Cc: | Steffen Hoffmann added; anonymous removed |
---|
Replying to rjollos:
With the latest version of the TagsPlugin from the trunk, [7384], when
ignore_closed_tickets = False
, here is what the tickets associated with a particular tag looks like (from the /tags page, not generated with theListTagged
macro, however theListTagged
macro produces the same results).
Here is my attempt at resolving this issue. I struggled with this, and think there must be a cleaner way, but the attached patch seems to work at least. I'd really appreciate any feedback I get on this.
The patch was generated against r10679 of the TagsPlugin trunk, and Trac 0.11.8dev.
Changed 13 years ago by
Attachment: | th3610-r10679-0.11.8dev-1.patch added |
---|
comment:5 follow-up: 7 Changed 13 years ago by
Keywords: | formatting added |
---|---|
Owner: | changed from Michael Renzmann to Steffen Hoffmann |
Status: | new → assigned |
Summary: | ListTagged macro should have an option to display closed tickets → ListTagged macro should have configurable formatting of closed tickets |
Replying to rjollos:
With the latest version of the TagsPlugin from the trunk, [7384], when
ignore_closed_tickets = False
, here is what the tickets associated with a particular tag looks like (from the /tags page, not generated with theListTagged
macro, however theListTagged
macro produces the same results).
Sure, same code used under the hood.
In the 0.6 version of the plugin running under Trac
0.11.4
, the ticket status was not shown. It would be nice if the closed tickets were shown with a strikethrough for consistency with other behavior in Trac, but that seems to be an issue separate from having aListTagged
macro option to show closed tickets. Currently, closed tickets are only shown ifignore_closed_tickets = False
.
Thats, what this option is meant for. Keep that, and formatting is a separate issue - agreed. I adjust the summary accordingly. But I'd rather not given an option to totally disable strike-through display. Numbers of closed tickets should always be displayed that way for overall consistency - agreed again.
How about an ListOption('tags', 'closed_ticket_format', 'strike-id')
and some other supported values like 'strike-id,strike-description', 'strike-id,grey-description' or similar?
It would also be nice to have a filter option on the /tags page to show / not show closed tickets in the results.
+1 for that, thinking exactly the same lately, even if feature bloat is luring at the corner, because I thought of switching oldlist/compact/table style via dropdown too.
comment:6 Changed 13 years ago by
Cc: | Michael Renzmann added; Steffen Hoffmann removed |
---|
comment:7 Changed 13 years ago by
Replying to hasienda:
How about an
ListOption('tags', 'closed_ticket_format', 'strike-id')
and some other supported values like 'strike-id,strike-description', 'strike-id,grey-description' or similar?
While keeping those options you mention open as possibilities for future enhancements, I support the idea that by default the Tags cloud page and ListTaggedMacro would generate output that looks like default Trac. In Trac, every reference for a closed ticket (e.g. #100) displays with strike-through, so I hope for the same with every plugin, for their default behavior at least.
However, many plugins don't achieve this, the BookmarkPlugin (#9212) being one example. Perhaps it is because the plugin developer needs to go out of his way to determine whether the ticket is opened or closed and apply the appropriate style. My patch seems very clunky and I'd hope there would be a better way, but I have my doubts. For some example, see:
- [t 10643]
- ChildTicketTreeMacro implements a solution that looks similar to mine, see macro.py#L76
Of related interest, see th:#9981 discussion on alternative styles for indicating closed tickets.
comment:8 Changed 13 years ago by
Summary: | ListTagged macro should have configurable formatting of closed tickets → ListTagged macro should have distinct, optionally configurable formatting of closed tickets |
---|
Well, t:9981 looks like an open call for suggestions to me. Fine, will think about it and hopefully present options. Of course current strike-through style would be default.
comment:9 Changed 13 years ago by
Here is how it's done as in an inline function of the TicketQueryMacro
:
def ticket_anchor(ticket): return tag.a('#%s' % ticket['id'], class_=ticket['status'], href=req.href.ticket(int(ticket['id'])), title=shorten_line(ticket['summary']))
So maybe my patch isn't too far off.
Changed 13 years ago by
Attachment: | th3610-r10708-0.11.7.patch added |
---|
comment:11 Changed 13 years ago by
Replying to rjollos:
Here is a better patch.
KISS, just works. I'll drop more complicated ideas for now - as you already suggested before.
comment:12 Changed 13 years ago by
(In [10713]) TagsPlugin: Add common Trac strike-through style for closed tickets, refs #3610.
Thanks to Ryan for code to address this enhancement - straight, effective.
comment:13 Changed 13 years ago by
Thanks for pulling that in. I'm running r10713 on my server now and it is working well.
I have some related refactoring ideas that I'd like to run by you. I'll try to post by tomorrow.
It would be nice if there was an 'option' for the
ListTagged
macro to specify whether or not to display closed tickets.