Ticket #3610 (assigned enhancement)

Opened 5 years ago

Last modified 2 years ago

ListTagged macro should have distinct, optionally configurable formatting of closed tickets

Reported by: anonymous Assigned to: hasienda (accepted)
Priority: normal Component: TagsPlugin
Severity: normal Keywords: ListTagged formatting
Cc: otaku42 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

TagsOpenClosedTickets.png (18.2 kB) - added by rjollos on 02/04/10 20:30:32.
th3610-r10679-0.11.8dev-1.patch (1.9 kB) - added by rjollos on 09/27/11 10:04:13.
th3610-r10708-0.11.7.patch (1.7 kB) - added by rjollos on 09/30/11 08:53:18.

Change History

02/04/10 02:59:37 changed by rjollos

  • owner changed from athomas to otaku42.

It would be nice if there was an 'option' for the ListTagged macro to specify whether or not to display closed tickets.

02/04/10 03:15:26 changed by rjollos

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.

(follow-ups: ↓ 4 ↓ 5 ) 02/04/10 20:30:11 changed by rjollos

  • summary changed from ListTagged macro should display closed tickets striked to 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.

02/04/10 20:30:32 changed by rjollos

  • attachment TagsOpenClosedTickets.png added.

(in reply to: ↑ 3 ) 09/27/11 09:56:43 changed by rjollos

  • cc set to hasienda.

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 the ListTagged macro, however the ListTagged 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.

09/27/11 10:04:13 changed by rjollos

  • attachment th3610-r10679-0.11.8dev-1.patch added.

(in reply to: ↑ 3 ; follow-up: ↓ 7 ) 09/27/11 22:36:05 changed by hasienda

  • status changed from new to assigned.
  • owner changed from otaku42 to hasienda.
  • keywords changed from ListTagged to ListTagged formatting.
  • summary changed from ListTagged macro should have an option to display closed tickets to 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 the ListTagged macro, however the ListTagged 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 a ListTagged macro option to show closed tickets. Currently, closed tickets are only shown if ignore_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.

09/27/11 22:39:36 changed by hasienda

  • cc changed from hasienda to otaku42.

Better let's keep Michael informed on Tags issues too.

@otaku42 Please take a look at last comment:5 for this ticket too, thanks.

(in reply to: ↑ 5 ) 09/28/11 09:08:40 changed by rjollos

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:

Of related interest, see th:#9981 discussion on alternative styles for indicating closed tickets.

09/28/11 22:03:08 changed by hasienda

  • summary changed from ListTagged macro should have configurable formatting of closed tickets to 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.

09/30/11 08:00:26 changed by rjollos

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.

(follow-up: ↓ 11 ) 09/30/11 08:52:59 changed by rjollos

Here is a better patch.

09/30/11 08:53:18 changed by rjollos

  • attachment th3610-r10708-0.11.7.patch added.

(in reply to: ↑ 10 ) 09/30/11 23:24:32 changed by hasienda

Replying to rjollos:

Here is a better patch.

KISS, just works. I'll drop more complicated ideas for now - as you already suggested before.

09/30/11 23:33:41 changed by hasienda

(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.

10/01/11 00:19:11 changed by rjollos

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.


Add/Change #3610 (ListTagged macro should have distinct, optionally configurable formatting of closed tickets)




Change Properties
Action