content type ics

This commit is contained in:
2020-12-11 23:29:10 +00:00
parent 5367bec4a3
commit 657e7d0b1b
2 changed files with 10 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ def index(request):
def calendar(request): def calendar(request):
events=deque(Post.objects.get_visible_articles().order_by('-public_date')) events=deque(Post.objects.get_visible_articles().order_by('-public_date'))
return render(request, 'posts/fet_calendar.ics', {"events": events},content_type='text/plain') return render(request, 'posts/fet_calendar.ics', {"events": events},content_type='text/calendar')
def tags(request, tag=""): def tags(request, tag=""):
posts = deque(Post.objects.get_visible_articles().filter(tags__name=tag)) posts = deque(Post.objects.get_visible_articles().filter(tags__name=tag))
featured_post = Post.objects.get_visible_articles().filter(slug=tag).first() featured_post = Post.objects.get_visible_articles().filter(slug=tag).first()

View File

@@ -7,28 +7,28 @@ BEGIN:VTIMEZONE
TZID:Europe/Vienna TZID:Europe/Vienna
BEGIN:DAYLIGHT BEGIN:DAYLIGHT
TZOFFSETFROM:+0100 TZOFFSETFROM:+0100
TZOFFSETTO:+0100
DTSTART:19810329T020000 DTSTART:19810329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:MESZ TZNAME:MESZ
END:DAYLIGHT END:DAYLIGHT
BEGIN:STANDARD BEGIN:STANDARD
TZOFFSETFROM:+0200 TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T030000 DTSTART:19961027T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:MEZ TZNAME:MEZ
END:STANDARD END:STANDARD
END:VTIMEZONE END:VTIMEZONE {% for event in events %}
{% for event in events %}
BEGIN:VEVENT BEGIN:VEVENT
UID:4610745 UID:{{event.id}}
ORGANIZER;CN="Fachschaft Elektrotechnik, Example Inc.":MAILTO:service@fet.at ORGANIZER;CN="Fachschaft Elektrotechnik, Example Inc.":MAILTO:service@fet.at
LOCATION:Vienna LOCATION:Vienna
SUMMARY:{{ event.title }} SUMMARY:{{ event.title }}
DESCRIPTION: {{event.url}} https://alpha.2020.fet.at/{{event.url}} <a href="https://alpha.2020.fet.at/{{event.url}}">{{even.title}}</a> DESCRIPTION: <a href="https://alpha.2020.fet.at/{{event.url}}">{{even.title}}</a>
CLASS:PUBLIC CLASS:PUBLIC
DTSTART;TZID=Europe/Vienna:20200306T120000 DTSTART;TZID=Europe/Vienna:20201216T120000
DTEND;TZID=Europe/Vienna:20200306T140000 DTEND;TZID=Europe/Vienna:20201216T140000
DTSTAMP;TZID=Europe/Vienna:20200306T120000 DTSTAMP;TZID=Europe/Vienna:20201216T120000
END:VEVENT END:VEVENT{% endfor %}
{% endfor %}
END:VCALENDAR END:VCALENDAR