Edgewall Software
Modify

Opened 17 years ago

Last modified 10 years ago

#7199 new enhancement

Colour/style individual cells in ticket report

Reported by: Matt Young Owned by:
Priority: normal Milestone: unscheduled
Component: report system Version: 0.10.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac reports allow you to apply a colour or style to each row of the results, but not to individual cells in the row. It would be very helpful to allow different cells in the same row to be coloured differently. Then we could have, eg, one set of background colours for the "Priority" field and another for the "Status" field.

Attachments (0)

Change History (7)

comment:1 by sid, 17 years ago

This is easy to do with CSS. Each table cell has a defined class, so you just set colors for the classes you want to change.

Here's an example HTML row from a report:

<tr class="color3-odd">
    <td class="type">defect</td>
    <td class="ticket">
      <a title="View ticket" href="/ticket/3868">#3868</a>
    </td>
    <td class="summary">
      <a title="View ticket" href="/ticket/3868">Post action and fastcgi 'Broken pipe' problem.</a>
    </td>
    <td class="component">general</td>
    <td class="version">0.10.2</td>
    <td class="severity">normal</td>
    <td class="owner">jonas</td>
    <td class="status">new</td>
    <td class="lastmodified">40 days</td>
    <td class="chgs_auths">15 by 9</td>
</tr>

I don't think this type of color styling is widely useful or desired. And it is quite easy to change for your site. Propose closing as worksforme.

comment:2 by Christian Boos, 17 years ago

Resolution: worksforme
Status: newclosed

See also #6158.

comment:3 by Matt Young, 17 years ago

Resolution: worksforme
Status: closedreopened

The solution proposed above doesn't actually work. The point is that, because of the way the __style__ attribute of a query is applied, you can't use CSS to make a colour apply to a single cell. The style gets inserted directly in the TR tag. Eg if your query contains something like the following:

SELECT ...
  (CASE priority 
    WHEN 'major'  THEN 'background: #FF6666' 
    WHEN 'normal' THEN 'background: #FFFFCC' 
    WHEN 'minor'  THEN 'background: #FFFFFF' 
    ELSE 'background: #33FFFF' 
   END)
  AS __style__
FROM ...

then you end up with HTML like this:

<tr class="even" style="background: #FF6666;">
...
  <td class="version">0.10.2</td>
  <td class="severity">major</td>
  <td class="owner">jonas</td>
...
</tr>
<tr class="even" style="background: #FFFFFF;">
...
  <td class="version">0.10.2</td>
  <td class="severity">minor</td>
  <td class="owner">jonas</td>
...
</tr>

What we need is for some way in the query to be able to change the class name (rather than the inline style) of each table row. Then, as you say, we would be able to do per-cell colouring with CSS.

This is important to allow different cells in the same row to have different colours — eg you might very well want one colour for severity and another for priority.

comment:4 by Remy Blank, 16 years ago

Milestone: 2.0
Owner: Matthew Good removed
Status: reopenednew

comment:5 by Christian Boos, 15 years ago

Milestone: 2.0unscheduled

Milestone 2.0 deleted

comment:6 by robert.galliers@…, 10 years ago

I have run up against this problem too. Any likelihood of this being fixed?

My query contains:

status,(CASE status
WHEN 'testing (lab)' THEN 'background: orange; color: white'
WHEN 'testing (integration)' THEN 'background: !#4EA24E; color: white'
WHEN 'closed' THEN 'background: darkgreen; :white; color: white'
WHEN 'reopened' THEN 'background: #FF3030; color: white'
ELSE '' END) AS __style__,

And returns:

<tr class="even" style="background: !#4EA24E; color: white;">
 <td class="ticket">...</td>
 <td class="summary">...</td>
 <td class="status">...</td>

When what I really need is:

<tr class="even">
 <td class="ticket">...</td>
 <td class="summary">...</td>
 <td class="status" style="background: !#4EA24E; color: white;">...</td>
Last edited 10 years ago by Jun Omae (previous) (diff)

in reply to:  6 comment:7 by Ryan J Ollos, 10 years ago

Replying to robert.galliers@…:

I have run up against this problem too. Any likelihood of this being fixed?

PatchWelcome. There are currently 1000+ tickets open, so you can imagine that we have our hands full and unless one of the core developers is personally motivated to fix it, we will probably spend our time on one of the infinite number of other features that could be worked on. That is, unless a quality patch is provided.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.