def getVars(self): wvars = WConfDisplayBodyBase.getVars(self) csbm = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId()) pluginNames = csbm.getEventDisplayPlugins() bookings = csbm.getBookingList(filterByType=pluginNames, notify=True, onlyPublic=True) bookings.sort(key=lambda b: b.getStartDate() or minDatetime()) timeless_bookings = [] ongoingBookings = [] scheduledBookings = {} #date, list of bookings for b in bookings: if b.canBeDisplayed(): if not b.hasStartDate(): timeless_bookings.append(b) else: if b.isHappeningNow(): ongoingBookings.append(b) elif b.getStartDate() and b.getAdjustedStartDate('UTC') > nowutc(): scheduledBookings.setdefault(b.getAdjustedStartDate(self._tz).date(), []).append(b) keys = scheduledBookings.keys() keys.sort() scheduledBookings = [(date, scheduledBookings[date]) for date in keys] wvars["body_title"] = self._getTitle() wvars["OngoingBookings"] = ongoingBookings wvars["ScheduledBookings"] = scheduledBookings wvars["timeless_bookings"] = timeless_bookings wvars["all_bookings"] = fossilize(bookings) wvars["Timezone"] = self._tz wvars["conf"] = self._conf return wvars
def __init__(self, aw, conference): WConfDisplayBodyBase.__init__(self) self._conf = conference self._tz = DisplayTZ(aw, conference).getDisplayTZ()
def _getTitle(self): title = WConfDisplayBodyBase._getTitle(self) return _('{}: Modify'.format(title))