Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13290 closed enhancement (fixed)

Enable styling of ticket comments links — at Version 6

Reported by: ntmlod Owned by: Ryan J Ollos
Priority: normal Component: ContextChromePlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description (last modified by Ryan J Ollos)

I'm not sure if it's an defect or an enhancement but it would useful if the ticket comment links can be highlighted in the same way as ticket links.

Change History (8)

comment:1 Changed 7 years ago by Ryan J Ollos

Owner: changed from matobaa to Ryan J Ollos
Status: newaccepted

comment:2 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16867:

ContextChrome 0.4: Decorate ticket comment links

Fixes #13290.

comment:3 Changed 7 years ago by ntmlod

Thanks for the work but I didn't see the changes with the previous revision, perhaps I misunderstood what I wanted.

Previously on our timeline view, the ticket links were already recognized and highlighted in <dd> tags (from commit messages) but my proposal was to have the same in the <dt> tags of tickets.

And at this time the ticket links are still not selected from <dt>.

Changed 7 years ago by Ryan J Ollos

Changed 7 years ago by Ryan J Ollos

comment:4 Changed 7 years ago by Ryan J Ollos

I added highlighting of 10 through 12, the comment:1:ticket:1 form:

How about a set of rules like the following?:

.timeline dt.newticket a em[title~="defect:"],
.timeline dt.editedticket a em[title~="defect:"] {
    background-color: #f5deb3; /* wheat */
}
.timeline dt.newticket a em[title~="enhancement:"],
.timeline dt.editedticket a em[title~="enhancement:"] {
    background-color: #87ceeb; /* sky blue */
}
.timeline dt.newticket a em[title~="task:"],
.timeline dt.editedticket a em[title~="task:"] {
    background-color: #ffd700; /* gold */
}

The rules yield:

comment:5 Changed 7 years ago by ntmlod

I forgot to add that I used it to highlight the priority of the tickets. I can't enable it with CSS as there is no clue in the HTML code.

I lack the understanding of Trac system in general, I can't figure out why the plugin can detect the ticket link in <dd> and not <dt>. It is related to isinstance detection method ?

comment:6 Changed 7 years ago by Ryan J Ollos

Description: modified (diff)

The <dd> content is handled by the wiki formatter. The formatting happens in the IWikiSyntaxProvider implementation, which ContextChromePlugin monkey-patches.

The timeline event is rendered by ITimelineEventProvider. render_timeline_event. I think that method would also needed to be monkey-patched. I'm not sure if/when I will have time to do that, but created #13299 to cover the request.

Note: See TracTickets for help on using tickets.