<?xml version="1.0"?>
<rss version="2.0" xmlns:py="http://genshi.edgewall.org/"
                   xmlns:dc="http://purl.org/dc/elements/1.1/"
                   xmlns:xi="http://www.w3.org/2001/XInclude">
  <channel>
    <title>${project.name}: Ticket #${ticket.id}: ${ticket.summary}</title>
    <link>${abs_href.ticket(ticket.id)}</link>
    <description>${unicode(wiki_to_html(context, ticket.description))}</description>
    <language>en-us</language>
    <image py:if="chrome.logo.src_abs">
      <title>$project.name</title>
      <url>$chrome.logo.src_abs</url>
      <link>${abs_href.ticket(ticket.id)}</link>
    </image>
    <generator>Trac $trac.version</generator>

    <item py:for="change in changes">
      <xi:include href="author_or_creator.rss" py:with="author = change.author"/>
      <pubDate>${http_date(change.date)}</pubDate>
      <title>$change.title</title>
      <link>${abs_href.ticket(ticket.id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></link>
      <guid isPermaLink="false">${abs_href.ticket(ticket.id)}<py:if test="change.cnum">#comment:$change.cnum</py:if></guid>
      <description>
        <py:if test="change.fields">
          &lt;ul&gt;
          <py:for each="field, value in change.fields.items()">
            &lt;li&gt;&lt;strong&gt;$field&lt;/strong&gt;
            <py:choose>
              <py:when test="value.rendered">${unicode(value.rendered)}</py:when>
              <py:when test="not value.old">
                set to &lt;em&gt;$value.new&lt;/em&gt;
              </py:when>
              <py:when test="value.new">
                changed from &lt;em&gt;$value.old&lt;/em&gt; to &lt;em&gt;$value.new&lt;/em&gt;
              </py:when>
              <py:otherwise>
                &lt;em&gt;$value.old&lt;/em&gt; deleted
              </py:otherwise>
            </py:choose>
            &lt;/li&gt;
          </py:for>
          &lt;/ul&gt;
        </py:if>
        ${unicode(wiki_to_html(context, change.comment))}
      </description>
      <category>Ticket</category>
    </item>

 </channel>
</rss>
