Change Trac summary field

58 views
Skip to first unread message

Ar Trac

unread,
Feb 14, 2014, 10:04:17 AM2/14/14
to trac-...@googlegroups.com
Hi, 

Is it possible to change the summary field to Task ?

Thanks

RjOllos

unread,
Feb 17, 2014, 3:28:16 PM2/17/14
to trac-...@googlegroups.com

 1. Copy $env/templates/site.html.sample -> $env/templates/site.html
 2. Add the following snippet to site.html

  <py:match path="//div[@id='content' and @class='ticket']//label[@for='field-summary']">
    <label for="field-summary">Task:</label>
  </py:match>

There may be a way to change the selector to directly select the text node, which would avoid having to recreate label node. For example,
  <py:match path="//div[@id='content' and @class='ticket']//label[@for='field-summary']/???">
    Task:
  </py:match> 

where the ??? is replaced with the appropriate selector. I'm not very fluent with XPath. If someone knows how to do this, I'd be interested to learn.

The interface customization is very powerful, you basically just need a quick intro to Genshi directives and a good grasp of XPath.

Eguess74

unread,
Sep 1, 2015, 7:26:25 PM9/1/15
to Trac Users
I have tried the solution provided by RjOllos and it was not fully working as it was failing to properly render from the template giving me Index out of range error. The error was not very helpful

Here is a version of RjOllos' solution that worked and I successfully applied it to Summary and Description fields:

<div py:match="//div[@id='content' and @class='ticket']//label[@for='field-summary']" py:attrs="select('@*')">
    <label for="field-summary">Task:</label>
    ${select('*')}
  </div>

Also I have to note that these templates don't seem to like to be inside the <body> tags of the site.html file.

HPH!

 
Reply all
Reply to author
Forward
0 new messages