Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12896 closed enhancement (fixed)

Show ticket Summary instead of ticket number

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: BreadCrumbsNavPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

I am looking to change the ticket number in the breadcrumbs to display the ticket summary instead. Does anyone know the easiest way to do this, please?

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Ryan J Ollos

Owner: changed from Steffen Hoffmann to Ryan J Ollos
Status: newaccepted

It looks like you could modify breadcrumbsnavplugin/trunk/breadcrumbsnav/breadcrumbs.py@10902:183#L157. I'll post a patch to point you in the right direction.

comment:2 Changed 8 years ago by Ryan J Ollos

In 15912:

0.3dev: Show resource summary if realm is ticket or wiki

Refs #12896.

comment:3 Changed 8 years ago by Ryan J Ollos

In 15913:

0.3dev: Show resource summary in title if realm is milestone

Refs #12896.

comment:4 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

After updating to the latest, you can apply this patch to show the resource summary for tickets:

  • breadcrumbsnav/breadcrumbs.py

     
    183183            name = get_resource_shortname(self.env, resource)
    184184            title = get_resource_summary(self.env, resource)
    185185            link = req.href(realm, resource_id)
     186            if realm == 'ticket':
     187                name = title
    186188
    187189            first = ul == []
    188190            li = tag.li(tag.a(title=title, href=link)(name))

An example of the resource summary for this tickets is enhancement: Show ticket Summary instead of ticket number (accepted).

To show just the ticket summary:

  • breadcrumbsnav/breadcrumbs.py

     
    183183            name = get_resource_shortname(self.env, resource)
    184184            title = get_resource_summary(self.env, resource)
    185185            link = req.href(realm, resource_id)
     186            if realm == 'ticket':
     187                from trac.ticket.model import Ticket
     188                name = Ticket(self.env, resource_id)['summary']
    186189
    187190            first = ul == []
    188191            li = tag.li(tag.a(title=title, href=link)(name))

comment:5 Changed 8 years ago by Ryan J Ollos

#9539 closed as a duplicate.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.