Changes between Version 2 and Version 3 of CookBook/Notification/Templates
- Timestamp:
- Nov 19, 2019, 9:00:45 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/Notification/Templates
v2 v3 8 8 }}} 9 9 10 with this (requires Python 2.6 or later): 10 === For Trac 1.4 and later, Jinja2 template: #jinja2 11 {{{ 12 -------------------------------------------------------------------------- 13 # set sel = ('Reporter', 'Owner', 'Type', 'Status', 'Priority', 'Milestone', 14 'Component', 'Severity', 'Resolution', 'Keywords') 15 # for a in ticket_props.replace('|', '\n').splitlines()[1:-1]|map('trim'): 16 # set a = a.split(':', 1)|map('trim')|list 17 # if len(a) > 1 and a[0] in sel: 18 ${'%-*s %s'|format(12, a[0] + ':', a[1])} 19 # endif 20 # endfor 21 -------------------------------------------------------------------------- 22 }}} 23 24 === For Trac 1.2 and early, Genshi template: #genshi 11 25 {{{ 12 26 -------------------------------------------------------------------------- … … 17 31 sel = ['Reporter', 'Owner', 'Type', 'Status', 'Priority', 'Milestone', 18 32 'Component', 'Severity', 'Resolution', 'Keywords'] %}\ 19 ${'\n'.join('% s\t%s' % (format(p[0]+':', ' <12'), p[1]) for p in pv if p[0] in sel)}33 ${'\n'.join('%-*s %s' % (12, p[0]+':', p[1]) for p in pv if p[0] in sel)} 20 34 {% end %}\ 21 35 --------------------------------------------------------------------------