{% from 'feed_description.html' import item_desc %}

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>{{ project_url }}</id>
  <title>{{ title|e }}</title>
  {% if project_url -%}
  <link rel="self" href="{{ project_url }}/atom"/>
  <link rel="alternate" href="{{ project_url }}"/>
  {% endif %}
  {%- if description -%}
  <subtitle>{{ description }}</subtitle>
  {% endif %}
  {%- if rfc3339_pubdate -%}
  <updated>{{ rfc3339_pubdate }}</updated>
  {% endif -%}
  <author>
    <name>BuildBot</name>
  </author>

  {% for b in builds -%}
  <entry>
    <title>{{ b.title }}</title>
    <link href="{{ b.link }}"/>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        {{ item_desc(b, project_url, project_name)|indent(6) }}
        <pre xml:space="preserve">{{ b.log_lines|join('\n')|e }}</pre>
      </div>
    </content>
    {% if b.rfc3339_pubdate -%}
    <updated>{{ b.rfc3339_pubdate }}</updated>
    <id>{{ b.guid }}</id>
    {% endif -%}
    <author>Buildbot</author>
  </entry>

  {% endfor -%}

</feed>
