Wednesday, November 7, 2012

Trac 1.0

To modify the order of fields in Trac :
 
--- a/trunk/trac/usr-share-pyshared-trac-ticket-templates-ticket.html
+++ b/trunk/trac/usr-share-pyshared-trac-ticket-templates-ticket.html
@@ -266,5 +266,7 @@
                   </tr>
                 </py:if>
-                <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')"
+
+                <!--! Do not show Remaining or Owner field when creating a ticket. -->
+                <tr py:for="row in group(filter(lambda f: ticket.exists or f.name != 'owner' and f.name != 'estimatedhours',fields), 2, lambda f: f.type != 'textarea')"
                     py:if="can_modify or can_create"
                     py:with="fullrow = len(row) == 1">
 
This code works fine in ticket create. but has problem when editing.