Пример #1
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["title"] = self.__conf.getTitle()
     vars["meetingIcon"] = Configuration.Config.getInstance(
     ).getSystemIconURL("meetingIcon")
     vars["modifyIcon"] = ""
     if self.__conf.canModify(self.__aw):
         vars["modifyIcon"] = """<a href="%s"><img src="%s" border="0" alt="Jump to the modification interface"></a>
                              """ % (
             vars["modifyURL"],
             Configuration.Config.getInstance().getSystemIconURL("modify"))
     vars["description"] = self.__getHTMLRow(_("Description"),
                                             self.__conf.getDescription())
     vars["location"] = ""
     location = self.__conf.getLocation()
     if location:
         vars["location"] = self.__getHTMLRow(
             _("Location"),
             "%s<br>%s" % (location.getName(), location.getAddress()))
     vars["room"] = ""
     room = self.__conf.getRoom()
     if room:
         roomLink = linking.RoomLinker().getHTMLLink(room, location)
         vars["room"] = self.__getHTMLRow(_("Room"), roomLink)
     sdate, edate = self.__conf.getStartDate(), self.__conf.getEndDate()
     fsdate, fedate = format_date(sdate,
                                  format='long'), format_date(edate,
                                                              format='long')
     fstime, fetime = sdate.strftime("%H:%M"), edate.strftime("%H:%M")
     vars["dateInterval"] = i18nformat("""_("from") %s %s _("to") %s %s""")%(fsdate, fstime, \
                                                     fedate, fetime)
     if sdate.strftime("%d%B%Y") == edate.strftime("%d%B%Y"):
         timeInterval = fstime
         if sdate.strftime("%H%M") != edate.strftime("%H%M"):
             timeInterval = "%s-%s" % (fstime, fetime)
         vars["dateInterval"] = "%s (%s)" % (fsdate, timeInterval)
     vars["startDate"] = sdate
     vars["endDate"] = edate
     vars["moreInfo"] = self.__getHTMLRow(_("Additional Info"),
                                          self.__conf.getContactInfo())
     chairs = []
     if self.__conf.getChairmanText() != "":
         chairs.append(self.__conf.getChairmanText())
     for chair in self.__conf.getChairList():
         chairs.append("<a href=\"mailto: %s\">%s</a>" %
                       (chair.getEmail(), chair.getFullName()))
     vars["chairs"] = self.__getHTMLRow(_("Chairmen"), "; ".join(chairs))
     ml = []
     for mat in self.__conf.getAllMaterialList():
         str = wcomponents.WMaterialDisplayItem().getHTML(\
                         self.__aw, mat, vars["materialURL"]( mat ))
         if str == "":
             continue
         ml.append(str)
     vars["material"] = self.__getHTMLRow(_("Material"), "<br>".join(ml))
     vars["schedule"] = self.__getSchedule( vars["sessionModifyURLGen"], \
                                             vars["contribModifyURLGen"], \
                                             vars["materialURL"],\
                                             vars["subContribModifyURLGen"] )
     return vars
Пример #2
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["title"] = self.htmlText(self._subContrib.getTitle())
     vars["description"] = self._subContrib.getDescription()
     vars["id"] = self.htmlText(self._subContrib.getId())
     vars["duration"] = (datetime(1900, 1, 1) +
                         self._subContrib.getDuration()).strftime("%H:%M")
     vars["location"] = "blah"
     loc = self._subContrib.getLocation()
     if loc is not None:
         vars["location"] = "<i>%s</i>" % (self.htmlText(loc.getName()))
         if loc.getAddress() is not None and loc.getAddress() != "":
             vars["location"] = "%s <pre>%s</pre>" % (vars["location"],
                                                      loc.getAddress())
     room = self._subContrib.getRoom()
     if room is not None:
         roomLink = linking.RoomLinker().getHTMLLink(room, loc)
         vars["location"]= _("""%s<br><small> _("Room"):</small> %s""")%(\
             vars["location"],roomLink)
     vars["location"] = self._getHTMLRow(_("Place"), vars["location"])
     vars["material"] = self._getMaterialHTML()
     vars["inContrib"] = ""
     if self._subContrib.getParent() is not None:
         url = urlHandlers.UHContributionDisplay.getURL(
             self._subContrib.getParent())
         ContribCaption = "%s" % self._subContrib.getParent().getTitle()
         vars["inContrib"]="""<a href=%s>%s</a>"""%(\
             quoteattr(str(url)),self.htmlText(ContribCaption))
     vars["inContrib"] = self._getHTMLRow(_("Included in contribution"),
                                          vars["inContrib"])
     l = []
     for speaker in self._subContrib.getSpeakerList():
         l.append(self.htmlText(speaker.getFullName()))
     vars["speakers"] = self._getHTMLRow(_("Presenters"), "<br>".join(l))
     return vars
Пример #3
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["title"] = self.__session.getTitle()
     vars["description"] = self.__session.getDescription()
     conf = self.__session.getConference()
     vars["location"] = ""
     location = self.__session.getOwnLocation()
     if location:
         vars["location"] = self.__getHTMLRow(
             _("Location"),
             "%s<br>%s" % (location.getName(), location.getAddress()))
     vars["room"] = ""
     room = self.__session.getOwnRoom()
     if room:
         location = self.__session.getLocation()
         roomLink = linking.RoomLinker().getHTMLLink(room, location)
         vars["room"] = self.__getHTMLRow("Room", roomLink)
     vars["startDate"] = format_date(self.__session.getStartDate(),
                                     format='full')
     vars["startTime"] = self.__session.getStartDate().strftime("%H:%M")
     vars["endDate"] = format_date(self.__session.getEndDate(),
                                   format='full')
     vars["endTime"] = self.__session.getEndDate().strftime("%H:%M")
     if vars["startDate"] == vars["endDate"]:
         vars["dateInterval"] = "%s (%s -> %s)"%(vars["startDate"],\
                                                 vars["startTime"],\
                                                 vars["endTime"] )
         if conf.getStartDate().strftime("%d%B%Y") == \
                     self.__session.getStartDate().strftime("%d%B%Y") and \
                         conf.getEndDate().strftime("%d%B%Y") == \
                             self.__session.getEndDate().strftime("%d%B%Y"):
             vars["dateInterval"] = "%s -> %s"%( vars["startTime"],\
                                                 vars["endTime"] )
     else:
         vars["dateInterval"] = "%s %s -> %s %s"%(vars["startDate"],\
                                                 vars["startTime"],\
                                                 vars["endDate"],\
                                                 vars["endTime"] )
     vars["modifyURL"] = self.__modifyURLGen(self.__session)
     vars["conveners"] = self.__getConvenersHTML(
         self.__session.getConvenerList())
     vars["modifyItem"] = ""
     if self.__session.canModify(self.__aw):
         vars[
             "modifyItem"] = """<a href="%s"><img src="%s" border="0" alt="Jump to the modification interface"></a> """ % (
                 self.__modifyURLGen(self.__session),
                 Configuration.Config.getInstance().getSystemIconURL(
                     "modify"))
     vars["expandIcon"] = ""
     vars["schedule"] = self.__getSchedule(self.__contribModifyURLGen, \
                                           self.__materialURLGen,
                                           self.__subContribModifyURLGen )
     vars["material"] = self.__getMaterialHTML(
         self.__session.getAllMaterialList())
     return vars
Пример #4
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     tzUtil = timezoneUtils.DisplayTZ(self._aw, self._conf)
     tz = tzUtil.getDisplayTZ()
     sdate = self._conf.getStartDate().astimezone(timezone(tz))
     edate = self._conf.getEndDate().astimezone(timezone(tz))
     fsdate, fedate = format_date(sdate,
                                  format='full'), format_date(edate,
                                                              format='full')
     fstime, fetime = sdate.strftime("%H:%M"), edate.strftime("%H:%M")
     if sdate.strftime("%Y%B%d") == edate.strftime("%Y%B%d"):
         timeInterval = fstime
         if sdate.strftime("%H%M") != edate.strftime("%H%M"):
             timeInterval = "%s - %s" % (fstime, fetime)
         vars["dateInterval"] = "<b>%s (%s) (%s)</b>" % (fsdate,
                                                         timeInterval, tz)
     else:
         vars["dateInterval"] = "from <b>%s (%s)</b> to <b>%s (%s) (%s)</b>"%(\
                             fsdate, fstime, fedate, fetime, tz)
     vars["title"] = self._conf.getTitle()
     vars["description"] = self.__getHTMLRow(_("Description"),
                                             self._conf.getDescription(), 0)
     vars["location"] = ""
     location = self._conf.getLocation()
     if location:
         vars["location"] = self.__getHTMLRow(
             _("Location"), "%s<br><small>%s</small>" %
             (location.getName(), location.getAddress()))
     vars["room"] = ""
     room = self._conf.getRoom()
     if room:
         roomLink = linking.RoomLinker().getHTMLLink(room, location)
         vars["room"] = self.__getHTMLRow(_("Room"), roomLink)
     vars["moreInfo"] = self.__getHTMLRow(_("Additional Info"),
                                          self._conf.getContactInfo(), 0)
     ml = []
     for mat in self._conf.getAllMaterialList():
         ml.append( wcomponents.WMaterialDisplayItem().getHTML(\
                                             self._aw, mat, \
                                             vars["materialURLGen"](mat) ) )
     vars["material"] = self.__getHTMLRow(_("Material"), "<br>".join(ml), 0)
     al = []
     if self._conf.getChairmanText() != "":
         al.append(self._conf.getChairmanText())
     for organiser in self._conf.getChairList():
         al.append( """<a href="mailto:%s">%s</a>"""%(organiser.getEmail(),\
                                                  organiser.getFullName() ) )
     vars["contact"] = self.__getHTMLRow("Contact", "<br>".join(al), 0)
     vars["modifyItem"] = ""
     if self._conf.canModify(self._aw):
         vars[
             "modifyItem"] = """<a href="%s"><img src="%s" border="0" alt="Jump to the modification interface"></a> """ % (
                 vars["modifyURL"], Configuration.Config.getInstance(
                 ).getSystemIconURL("popupMenu"))
     return vars
Пример #5
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["title"] = self.htmlText(self._subContrib.getTitle())
     vars["description"] = self._subContrib.getDescription()
     vars["id"] = self.htmlText(self._subContrib.getId())
     vars["duration"] = self._subContrib.getDuration().strftime("%H:%M")
     vars["location"] = "blah"
     loc = self._subContrib.getLocation()
     if loc is not None:
         vars["location"] = "<i>%s</i>" % (self.htmlText(loc.getName()))
         if loc.getAddress() is not None and loc.getAddress() != "":
             vars["location"] = "%s <pre>%s</pre>" % (vars["location"],
                                                      loc.getAddress())
     room = self._subContrib.getRoom()
     if room is not None:
         roomLink = linking.RoomLinker().getHTMLLink(room, loc)
         vars["location"]= _("""%s<br><small> _("Room"):</small> %s""")%(\
             vars["location"],roomLink)
     vars["location"] = self._getHTMLRow(_("Place"), vars["location"])
     vars["material"] = self._getMaterialHTML()
     vars["inContrib"] = ""
     if self._subContrib.getParent() is not None:
         url = urlHandlers.UHContributionDisplay.getURL(
             self._subContrib.getParent())
         ContribCaption = "%s" % self._subContrib.getParent().getTitle()
         vars["inContrib"]="""<a href=%s>%s</a>"""%(\
             quoteattr(str(url)),self.htmlText(ContribCaption))
     vars["inContrib"] = self._getHTMLRow(_("Included in contribution"),
                                          vars["inContrib"])
     l = []
     for speaker in self._subContrib.getSpeakerList():
         l.append(self.htmlText(speaker.getFullName()))
     vars["speakers"] = self._getHTMLRow(_("Presenters"), "<br>".join(l))
     vars["modifyItem"] = ""
     if self._subContrib.canModify(self._aw):
         url = urlHandlers.UHSubContributionModification.getURL(
             self._subContrib)
         iconURL = Config.getInstance().getSystemIconURL("modify")
         vars[
             "modifyItem"] = """<a href=%s><img src=%s border="0" alt="Jump to the modification interface"></a> """ % (
                 quoteattr(str(url)), quoteattr(str(iconURL)))
     return vars
Пример #6
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        vars["title"] = self.__contrib.getTitle()
        sl = []
        if self.__contrib.getSpeakerText() != "":
            sl.append(self.__contrib.getSpeakerText())
        for speaker in self.__contrib.getSpeakerList():
            sl.append("%s (%s)" %
                      (speaker.getFullName(), speaker.getAffiliation()))
        vars["speakerList"] = ";<br>".join(sl)
        vars["description"] = self.__contrib.getDescription()
        owner = self.__contrib.getOwner()
        vars["place"] = ""
        location = self.__contrib.getOwnLocation()
        if location:
            vars["place"] = safe_upper(location.getName())
            if location.getAddress().strip() != "":
                vars["place"] += "(%s)" % location.getAddress()

        room = self.__contrib.getOwnRoom()
        if room:
            location = self.__contrib.getLocation()
            roomLink = linking.RoomLinker().getHTMLLink(room, location)
            if vars["place"].strip() != "":
                vars["place"] += ", "
            vars["place"] += "room: %s" % roomLink
        if vars["place"].strip() != "":
            vars["place"] = "<br>&nbsp;&nbsp;at %s" % vars["place"]
        vars["startDate"] = self.__contrib.getStartDate().strftime(
            "%d-%b-%Y %H:%M")
        if self.__contrib.getParent().getStartDate().strftime("%Y%B%d") ==\
           self.__contrib.getParent().getEndDate().strftime("%Y%B%d"):
            if self.__contrib.getParent().getStartDate().strftime("%Y%B%d") ==\
               self.__contrib.getStartDate().strftime("%Y%B%d"):
                vars["startDate"] = self.__contrib.getStartDate().strftime(
                    "%H:%M")
        vars["endDate"] = format_date(self.__contrib.getEndDate(),
                                      format='full')
        vars["endTime"] = self.__contrib.getEndDate().strftime("%H:%M")
        vars["duration"] = (datetime(1900, 1, 1) +
                            self.__contrib.getDuration()).strftime("%M'")
        if self.__contrib.getDuration() > timedelta(seconds=3600):
            vars["duration"] = (
                datetime(1900, 1, 1) +
                self.__contrib.getDuration()).strftime("%Hh%M'")
        vars["modifyURL"] = self.__modifyURLGen(self.__contrib)
        ml = []
        for mat in self.__contrib.getAllMaterialList():
            s = wcomponents.WMaterialDisplayItem().getHTML(
                self.__aw, mat, self.__materialsURLGen(mat))
            if not s:
                continue
            ml.append(s)
        if len(ml) == 0:
            vars["materials"] = ""
        else:
            vars["materials"] = "(%s)" % ", ".join(ml)

        vars["materialURLGen"] = self.__materialsURLGen
        scl = []
        for sc in self.__contrib.getSubContributionList():
            s = WSubContributionMeetingDisplay(self.__aw, sc).getHTML({
                "modifyURL":
                self.__subContribModifyURLGen(sc),
                "materialURLGen":
                self.__materialsURLGen
            })
            if not s:
                continue
            scl.append(s)
        if len(scl) == 0:
            vars["subConts"] = ""
        else:
            vars["subConts"] = "%s" % " ".join(scl)
        vars["modifyItem"] = ""
        if self.__contrib.canModify(self.__aw):
            vars[
                "modifyItem"] = """<a href="%s"><img src="%s" border="0" alt="Jump to the modification interface"></a> """ % (
                    self.__modifyURLGen(self.__contrib),
                    Configuration.Config.getInstance().getSystemIconURL(
                        "modify"))
        return vars
Пример #7
0
 def _getAnswer(self):
     return linking.RoomLinker().getURLByName(self._room, self._location)