Skip to content
Snippets Groups Projects
Commit c99d8831 authored by Julian Rother's avatar Julian Rother
Browse files

Extended rss feed template

parent 357fdbad
No related branches found
No related tags found
No related merge requests found
{% macro title(fmt) %} {% macro title(fmt) %}
{{ course.title }} ({{ fmt.description }}) — Video AG, FSMPI {{ course.title|e }} ({{ course.semester|semester }}, {{ fmt.description }}) — Video AG, FSMPI
{%- endmacro %}
{% macro course_description() %}
{{ course.semester|semester(long=True) }}, Veranstalter: {{ course.organizer }}
<p>{{ course.description|fixnl }}</p>
{%- endmacro %}
{% macro item_description(item) %}
{{ item.time|fulldate }}{% if item.speaker %} mit {{ item.speaker }}{% endif %}
<p>{{ item.comment|fixnl }}</p>
{%- if chapters|selectattr('lecture_id','equalto',item.id)|list %}
<ul>
{% for chapter in chapters|selectattr('lecture_id','equalto',item.id) %}
<li>{{ '%02d:%02d:%02d'|format( chapter.time//3600, (chapter.time//60)%60, chapter.time%60) }}: {{ chapter.text }}</li>
{% endfor %}
</ul>
{% endif %}
{%- endmacro %} {%- endmacro %}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:psc="http://podlove.org/simple-chapters" version="2.0"> <rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:psc="http://podlove.org/simple-chapters" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel> <channel>
<title>{{ title(format) }}</title> <title>{{ title(format) }}</title>
<link>{{ url_for('course', handle=course.handle, _external=True) }}</link> <link>{{ url_for('course', handle=course.handle, _external=True) }}</link>
<description><![CDATA[{{ course.description }}]]></description> <description>{{ course_description()|e }}</description>
<generator>Website der Video AG (+https://git.fsmpi.rwth-aachen.de/videoaginfra/website)</generator> <generator>Video AG-Website (+https://git.fsmpi.rwth-aachen.de/videoaginfra/website)</generator>
<category>{{ course.subject|e }}</category>
<image> <image>
<url>{{ url_for('static', filename='logo.png', _external=True) }}</url> <url>{{ url_for('static', filename='logo.png', _external=True) }}</url>
<title>{{ title(format) }}</title> <title>{{ title(format) }}</title>
<link>{{ url_for('course', handle=course.handle, _external=True) }}</link> <link>{{ url_for('course', handle=course.handle, _external=True) }}</link>
</image> </image>
<webMaster>video@fsmpi.rwth-aachen.de (Video AG)</webMaster>
<atom:link rel="self" type="application/rss+xml" title="{{ title(format) }}" href="{{ url_for('rss_feed', handle=course.handle, format_id=format.id, _external=True) }}"/> <atom:link rel="self" type="application/rss+xml" title="{{ title(format) }}" href="{{ url_for('rss_feed', handle=course.handle, format_id=format.id, _external=True) }}"/>
{% for fmt in formats %} {% for fmt in formats %}
{% if fmt.id != format.id %} {% if fmt.id != format.id %}
...@@ -21,11 +39,15 @@ ...@@ -21,11 +39,15 @@
{% endfor %} {% endfor %}
{% for item in items %} {% for item in items %}
<item> <item>
<title>{{ item.title }}</title> <title>{{ item.title|e }}</title>
<link>{{ url_for('lecture', id=item.id, course=course.handle, _external=True) }}</link> <link>{{ url_for('lecture', id=item.id, course=course.handle, _external=True) }}</link>
<pubDate>{{ item.updated|rfc822 }}</pubDate> <pubDate>{{ item.updated|rfc822 }}</pubDate>
<guid>video.fsmpi.rwth-aachen.de:{{ item.video.id }}</guid> <guid isPermaLink="false">video.fsmpi.rwth-aachen.de:{{ item.video.id }}</guid>
<description><![CDATA[{{ item.comment|e }}]]></description> <description>{{ item_description(item)|e }}</description>
<dc:creator>{{ course.organizer|e }}</dc:creator>
{% if item.speaker and item.speaker != course.organizer %}
<dc:creator>{{ item.speaker|e }}</dc:creator>
{% endif %}
<psc:chapters xmlns:psc="http://podlove.org/simple-chapters" version="1.2"> <psc:chapters xmlns:psc="http://podlove.org/simple-chapters" version="1.2">
{% for chapter in chapters|selectattr('lecture_id','equalto',item.id) %} {% for chapter in chapters|selectattr('lecture_id','equalto',item.id) %}
<psc:chapter start="{{ chapter.time }}" title="{{ chapter.text }}"/> <psc:chapter start="{{ chapter.time }}" title="{{ chapter.text }}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment