Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#8513 closed enhancement (fixed)

Genshi template syntax in ticket_subject_template

Reported by: trevor.l.torrez@… 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)

comment:1 by Christian Boos, 15 years ago

Keywords: genshi text template added
Milestone: 0.12

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.

comment:2 by Christian Boos, 15 years ago

Owner: changed from Emmanuel Blot to Christian Boos

comment:3 by Ryan Ollos <ryano@…>, 15 years ago

Cc: ryano@… added

in reply to:  1 comment:4 by Christian Boos, 14 years ago

Note: needmajor keyword means that we can't release the change in a minor 0.X.Y bugfix version.

comment:5 by Christian Boos, 14 years ago

Keywords: needmajor added

comment:6 by Remy Blank, 14 years ago

Owner: changed from Christian Boos to Remy Blank

I'll make the switch for the default, and try to auto-detect cases where the old syntax is used.

comment:7 by Remy Blank, 14 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 Remy Blank, 14 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 Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Let's close this, as the change has been made.

comment:10 by Christian Boos, 14 years ago

+ documentation in TracDev/ReleaseNotes/0.12, as this can be a backward incompatible change…

comment:11 by Remy Blank, 14 years ago

Oh, right, I missed that one. Coming shortly.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.