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


  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 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"
</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.