Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change ticket display in Trac

Tags:

templates

trac

With default template, trac ticket is available for viewing only, I must click modify to expand properties tab to modify, change state of a ticket. Now I want to expand that tab automatically? How can I change it quickly without changing the template itself? Is it possible to change it with trac.ini file? I cannot find where's location of default template to change, so I cannot change myself. Thanks!

like image 248
hungnv Avatar asked Jul 27 '10 04:07

hungnv


1 Answers

I think the best way to enable the behavior you're looking for is to add a custom JS file (which can be injected much like a custom CSS, read TracInterfaceCustomization).

In that file do this:

$(document).ready(function() {
 window.setTimeout(function() {
    $("#modify").parent().removeClass('collapsed')
 }, 0);
});

This code is untested but it should give you the idea. Basically we need to wait until the DOM is ready ($(document).ready) but as there are multiple JS functions called during that event, the setTimeOut sets a slight delay to make sure that the collapse command went through before.

HTH from a professional Trac developer :-)

like image 113
Felix Schwarz Avatar answered Oct 30 '22 13:10

Felix Schwarz