244:62252030324f
Anton Shestakov <av6@dwimlabs.net>, Wed, 26 Oct 2016 07:33:36 +0800
viewer: add Atom feeds to projects

templates/atom.xml

Permissions: -rw-r--r--

Other formats: Feeds:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<icon>{{ request.protocol }}://{{ request.host }}/static/favicon-cat.png</icon>
<title>{{ project.name }} feed</title>
<id>{{ project.get_url(request) }}/atom</id>
<link href="{{ project.get_url(request) }}/atom" rel="self"/>
<link href="{{ project.get_url(request) }}"/>
{% set last = checks.first() %}
{% if last %}
<updated>{{ last.finished.isoformat() }}Z</updated>
{% else %}
<updated>1970-01-01T08:00:00</updated>
{% end %}
{% for check in checks.limit(20) %}
<entry>
<title>Check #{{ check.ordinal }}: {{ status(check) }}</title>
<id>{{ project.get_url(request) }}/{{ check.ordinal }}</id>
<link href="{{ project.get_url(request) }}/{{ check.ordinal }}"/>
<updated>{{ check.finished.isoformat() }}Z</updated>
</entry>
{% end %}
</feed>