Modify

Opened 6 years ago

Closed 4 months ago

#3610 closed enhancement (fixed)

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

Reported by: anonymous Owned by: hasienda
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 (3)

TagsOpenClosedTickets.png (18.2 KB) - added by rjollos 4 years ago.
th3610-r10679-0.11.8dev-1.patch (1.9 KB) - added by rjollos 3 years ago.
th3610-r10708-0.11.7.patch (1.7 KB) - added by rjollos 3 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 4 years ago 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.

comment:2 Changed 4 years ago 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.

comment:3 follow-ups: Changed 4 years ago 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.

Changed 4 years ago by rjollos

comment:4 in reply to: ↑ 3 Changed 3 years ago by rjollos

  • Cc hasienda added

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.

Changed 3 years ago by rjollos

comment:5 in reply to: ↑ 3 ; follow-up: Changed 3 years ago by hasienda

  • Keywords formatting added
  • Owner changed from otaku42 to hasienda
  • Status changed from new to assigned
  • 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.

comment:6 Changed 3 years ago by hasienda

  • Cc otaku42 added; hasienda removed

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

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

comment:7 in reply to: ↑ 5 Changed 3 years ago 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.

comment:8 Changed 3 years ago 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.

comment:9 Changed 3 years ago 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.

comment:10 follow-up: Changed 3 years ago by rjollos

Here is a better patch.

Changed 3 years ago by rjollos

comment:11 in reply to: ↑ 10 Changed 3 years ago 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.

comment:12 Changed 3 years ago 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.

comment:13 Changed 3 years ago 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.

comment:14 Changed 4 months ago by hasienda

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13815:

TagsPlugin: Completing preparation for v0.7 release.

Availability of that code as stable, tagged release
closes #2429, #3359, #3610, #3624, #3677, #3754, #3864, #3947, #3983, #4078, #4277, #4503, #4799, #5523, #7787, #7857, #8638, #9057, #9058, #9059, #9060, #9061, #9062, #9063, #9149, #9210, #9521, #9630, #9636, #10032, #10416, #10636, #11096, #11147, #11152, #11274, #11302, #11658 and #11659.

Additionally there are some issues and enhancement requests showing progress,
but known to require more work to resolve them satisfactorily, specifically
refs #2804, #4200, #8747 and #9064.

Thanks to all contributors and followers, that enabled and encouraged a good
portion of this development work.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hasienda. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.