Include author details in iCal event description

This commit is contained in:
James Polley 2017-01-12 15:56:56 +11:00
parent 6458f4d436
commit 710d377016

View file

@ -267,34 +267,36 @@ class EventFeed(ICalFeed):
product_id = '-//linux.conf.au/schedule//EN' product_id = '-//linux.conf.au/schedule//EN'
timezone = settings.TIME_ZONE timezone = settings.TIME_ZONE
filename = 'conference.ics' filename = 'conference.ics'
def items(self): def items(self):
return Slot.objects.filter( return Slot.objects.filter(
day__schedule__published=True, day__schedule__published=True,
day__schedule__hidden=False day__schedule__hidden=False
).order_by("start") ).order_by("start")
def item_title(self, item): def item_title(self, item):
if hasattr(item.content, 'proposal'): if hasattr(item.content, 'proposal'):
return item.content.title return item.content.title
else: else:
item.content_override if item.content_override else "Slot" item.content_override if item.content_override else "Slot"
def item_description(self, item): def item_description(self, item):
if hasattr(item.content, 'proposal'): if hasattr(item.content, 'proposal'):
return item.content.abstract description = "Speaker: %s\n%s" % (
item.content.speaker, item.content.abstract)
return description
else: else:
return None return None
def item_start_datetime(self, item): def item_start_datetime(self, item):
return pytz.timezone(settings.TIME_ZONE).localize(item.start_datetime) return pytz.timezone(settings.TIME_ZONE).localize(item.start_datetime)
def item_end_datetime(self, item): def item_end_datetime(self, item):
return pytz.timezone(settings.TIME_ZONE).localize(item.end_datetime) return pytz.timezone(settings.TIME_ZONE).localize(item.end_datetime)
def item_location(self, item): def item_location(self, item):
return ", ".join(room["name"] for room in item.rooms.values()) return ", ".join(room["name"] for room in item.rooms.values())
def item_link(self, item): def item_link(self, item):
if hasattr(item.content, 'proposal'): if hasattr(item.content, 'proposal'):
return 'http://%s%s' % ( return 'http://%s%s' % (