#8513 closed enhancement (fixed)
Genshi template syntax in ticket_subject_template
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | notification | Version: | 0.11.4 |
Severity: | normal | Keywords: | genshi text template needmajor |
Cc: | ryano@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
This may be related to 8224
I tried to get some better email subjects along the lines of
- new Defect #744 in Project Code: subject text….
- working Enhancement #858 in Documentation: subject text….
- Fixed Defect #191 in CAT Test Env: subject text….
- WontFix Enhancement #4401 in Project Code: subject text…
The link in the description of ticket_subject_template
describes the genshi template format, but when I tried
#{% choose $ticket.status %} {% when 'closed' %}$ticket.resolution{% end %} {% otherwise %}$ticket.status{% end %} {% end %} $ticket.type #$ticket.id in $prefix: $summary
line breaks / indentation added for clarity
that's pretty much what I get in the email subject. I guess it's not a true genshi template? Would it be possible to either support the full genshi syntax, or update the relevent wiki pages to better explain what can and cannot be done with this config?
Attachments (0)
Change History (11)
follow-up: 4 comment:1 by , 15 years ago
Keywords: | genshi text template added |
---|---|
Milestone: | → 0.12 |
comment:2 by , 15 years ago
Owner: | changed from | to
---|
comment:3 by , 15 years ago
Cc: | added |
---|
comment:4 by , 15 years ago
Note: needmajor keyword means that we can't release the change in a minor 0.X.Y bugfix version.
comment:5 by , 15 years ago
Keywords: | needmajor added |
---|
comment:6 by , 15 years ago
Owner: | changed from | to
---|
I'll make the switch for the default, and try to auto-detect cases where the old syntax is used.
comment:7 by , 15 years ago
The switch to the new text template syntax was done in [8999]. I could have kept the possibility to load templates with the old syntax by using mode='oldtext'
in Chrome.load_template()
. However, Chrome.render_template()
selects the mode based on the MIME type, so it cannot be used to select the mode.
Should we keep the possibility to render using the old syntax? We could add an optional old_text_syntax=False
argument to Chrome.render_template()
for that.
Thoughts?
comment:8 by , 15 years ago
Mmh, avoiding to break all plugins that use the old syntax is actually more difficult than I thought. An optional argument to render_template()
is not enough: we would need to return a hint from process_request()
when returning a text template that allows differentiating between old and new syntax. And by default use the new syntax for Trac core and the old one for plugins. I'm not sure we want to add that complexity to the code, considering there must be relatively few plugins rendering plain text.
comment:9 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Let's close this, as the change has been made.
comment:10 by , 15 years ago
+ documentation in TracDev/ReleaseNotes/0.12, as this can be a backward incompatible change…
I think we're still using the Legacy Text Template Syntax: see load_template.
Maybe we can do the switch at the occasion of 0.12.