コード例 #1
0
ファイル: pages.py プロジェクト: marksteward/indico
    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
コード例 #2
0
    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
コード例 #3
0
ファイル: pages.py プロジェクト: marksteward/indico
 def __init__(self, aw, conference):
     WConfDisplayBodyBase.__init__(self)
     self._conf = conference
     self._tz = DisplayTZ(aw, conference).getDisplayTZ()
コード例 #4
0
ファイル: registrationForm.py プロジェクト: NIIF/indico
 def _getTitle(self):
     title = WConfDisplayBodyBase._getTitle(self)
     return _('{}: Modify'.format(title))
コード例 #5
0
 def _getTitle(self):
     title = WConfDisplayBodyBase._getTitle(self)
     return _('{}: Modify'.format(title))
コード例 #6
0
 def __init__(self, aw, conference):
     WConfDisplayBodyBase.__init__(self)
     self._conf = conference
     self._tz = DisplayTZ(aw, conference).getDisplayTZ()