Ticket Utilities and Practice

Artifact [97f87284ac]
Login

Artifact 97f87284acafc3bed57cbe02765a392d7119ee17:

Wiki page [Sortable Report Table] by Ross 2010-04-21 23:49:20.
D 2010-04-21T23:49:20
L Sortable\sReport\sTable
P 0ae3d9dcdab7d2ca8aed83d50bfceb8ec6b53d37
U Ross
W 1623
Here is a recipe for making the ticket report have sort links in its column header. This is based on the MIT-licensed Sortable Table JavaScript from Yoast.com.


  1  Create the folder <tt>sortable</tt> within the repository, and put the files <tt>sortable_us_fossil.js</tt>, <tt>arrow-up.gif</tt>, <tt>arrow-down.gif</tt>, and <tt>arrow-none.gif</tt> in it. Add and commit these files so that <tt>doc/tip/sortable/...</tt> URLs will refer to them.

  2  In the repository, Admin, Header, put the following in the HTML for the HEAD section:
<pre>
<script type="text/javascript" src="doc/tip/sortable/sortable_us_fossil.js"></script>
</pre>

  3  In Admin, CSS, put the following in the style sheet:
<pre>
table.report a { color: black; }
table.report a:link { color: black; }
table.report a:visited { color: black; }
table.report a:hover { color: green; }
table.report a img { border: 0; }
table.report th {  background-color: #ffe; }
</pre>


  4  Verify with <tt>fossil ui</tt> that the ticket reports are now sortable.

  5  Push the header change to the central copy with <tt>fossil config push skin</tt>.

There are defects with this solution. The primary defect is that fossil writes two tables to the report page. Both tables have the same CSS class ("report") and lack any ID attribute.

The first table contains the color key, which it puts in a header row. This interacts badly with the script which looks for all tables of class "report" to modify their header rows. It is possible that some cleverness could cause it to modify only the second table, which would mitigate this issue.

Z 0c9393850b1fb35e14c8b30f7d9030d3