linebreaks
This commit is contained in:
parent
6f907aff7a
commit
61e0ed226c
|
@ -13,7 +13,7 @@ DTEND:{{ talk.dtend }}
|
||||||
SUMMARY:{{ talk.title }}
|
SUMMARY:{{ talk.title }}
|
||||||
LOCATION:{{ talk.room }}
|
LOCATION:{{ talk.room }}
|
||||||
STATUS:{% if talk.accepted %}CONFIRMED{% else %}TENTATIVE{% endif %}
|
STATUS:{% if talk.accepted %}CONFIRMED{% else %}TENTATIVE{% endif %}
|
||||||
DESCRIPTION:{{ talk.description }}
|
DESCRIPTION:{{ talk.description|linebreaksbr }}
|
||||||
UID:{{ site.domain }}/{{ talk.id }}
|
UID:{{ site.domain }}/{{ talk.id }}
|
||||||
END:VEVENT{% endfor %}
|
END:VEVENT{% endfor %}
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
|
|
@ -485,13 +485,13 @@ def schedule(request, program_format, pending, cache, template):
|
||||||
response['Content-Disposition'] = 'attachment; filename="planning.ics"'
|
response['Content-Disposition'] = 'attachment; filename="planning.ics"'
|
||||||
ics = []
|
ics = []
|
||||||
for line in program.render('ics').split('\n'):
|
for line in program.render('ics').split('\n'):
|
||||||
line = line.strip()
|
line = line.strip().replace('<br />', '')
|
||||||
if len(line) < 50:
|
if len(line) < 50:
|
||||||
ics.append(line)
|
ics.append(line)
|
||||||
else: # https://icalendar.org/iCalendar-RFC-5545/3-1-content-lines.html
|
else: # https://icalendar.org/iCalendar-RFC-5545/3-1-content-lines.html
|
||||||
for i in range(ceil(len(line) / 50)):
|
for i in range(ceil(len(line) / 50)):
|
||||||
ics.append((' ' if i > 0 else '') + line[i * 50:(i + 1) * 50])
|
ics.append((' ' if i > 0 else '') + line[i * 50:(i + 1) * 50])
|
||||||
response.write('\r\n'.join([line for line in ics if line]))
|
response.write('\r\n'.join([line for line in ics if line]).strip() + '\r\n')
|
||||||
return response
|
return response
|
||||||
else:
|
else:
|
||||||
raise Http404(_("Format '%s' not available" % program_format))
|
raise Http404(_("Format '%s' not available" % program_format))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user