Edgewall Software
Modify

Opened 6 years ago

Closed 5 years ago

#7430 closed enhancement (duplicate)

Option to exclude Trac documentation from Timeline

Reported by: anonymous Owned by: osimons
Priority: normal Milestone:
Component: timeline Version:
Severity: normal Keywords: newhelp
Cc:
Release Notes:
API Changes:

Description

An option to exclude everything authored by 'Trac' from the Timeline so that the Timeline can be exclusively 'project work in progress' and not 'Trac work in progress' would be very handy.

In the meantime, if a Python guru could post a hack to achieve this goal, it would be appreciated (as in hardwire Trac to not display author 'Trac' in Timeline).

thanks

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by osimons

  • Keywords newhelp added
  • Milestone set to 0.12
  • Owner set to osimons

The 'clutter' from help default pages as part of the wiki (that also affects timeline) is a major motivation for the TracDev/Proposals/NewHelp that is currently scheduled for milestone:0.12.

comment:2 Changed 6 years ago by ebray <hyugaricdeau@…>

I should add, it wouldn't be a great idea to hard-code such a thing in Trac. For example, I have scripts to automate certain actions in a Trac environment that aren't necessarily connected to an actual user, so by displaying the user as "trac" I know it was an automated change.

Furthermore, filtering specific users out of the timeline would make for a fairly simple plugin (untested):

import re
from trac.core import *
from trac.web.api import IRequestFilter
from trac.config import Option

class TimelineUserFilter(Component):
    implements(IRequestFilter)

    filter_users = Option('timeline', 'filter_users', '',
                          'Comma-separated list of users whose changes should '
                          'not be displayed in the timeline.')

    def pre_process_request(self, req, handler):
        return handler

    def post_process_request(self, req, template, data, content_type):
        events = data.get('events')
        if re.match(r'/timeline/?', req.path_info) is not None and events:
            filter_users = [u.strip() for u in self.filter_users.split(',')]
            data['events'] = [e for e in events if e['author'] not in filter_users]
        return template, data, content_type

Not tested but this should be mostly correct, and could be expanded on as needed.

comment:3 Changed 6 years ago by anonymous

"The 'clutter' from help default pages as part of the wiki (that also affects timeline) is a major motivation for the TracDev/Proposals/NewHelp that is currently scheduled for milestone:0.12."

Sorry I missed this: my searches failed to turn up anything. Of course, I am still on 0.10 as a trial upgrade revealed that some of the Trac-Hacks plugins I use do not work properly with 0.11 (even though they are supposed to) and 0.11 still has some ugly formatting issues where things do not wrap properly unless the browser window is maximised (which is not convenient as no application is ever used in isolation from another).

"I should add, it wouldn't be a great idea to hard-code such a thing in Trac."

Certainly - I am just doing this for me while I am still on 0.10. A proper solution would either be an optional filter or a new display format that grouped Trac changes away from other changes, etc.

"Not tested but this should be mostly correct, and could be expanded on as needed."

Even so, it points me in the right direction and cuts down on time spent having to analyse the source in a language I am unfamiliar with. I'll give this a try and post back results/corrections. Much appreciated.

comment:4 Changed 5 years ago by rblank

  • Milestone 0.12 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

No news for 16 months, so I'll close this as a duplicate of #2656.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons to the specified user.
Author


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

 
Note: See TracTickets for help on using tickets.