示例#1
0
 def _getStatusCommentsHTML( self, status ):
     comment = ""
     if status.getId() in ["accepted", "accepted_other", "rejected",
                       "withdrawn", "duplicated"]:
         comment = self.htmlText( status.getComment() )
     elif status.getId() == 'pa':
         conflicts = status.getConflicts()
         if conflicts:
             if comment != "":
                 comment = "%s<br><br>"%comment
             l = []
             for jud in conflicts:
                 if jud.getTrack() != self._track:
                     l.append( "%s ( %s )"%( jud.getTrack().getTitle(), \
                             self._getAuthorHTML( jud.getResponsible() ) ) )
             comment = i18nformat("""%s<font color="red">_("In conflict with"): <br> %s</font>""")%(comment, "<br>".join(l) )
     rl = self._abstract.getReallocationTargetedList( self._track )
     if rl:
         comment = i18nformat("""%s<br><br><font color="green">_("Proposed by") <i>%s</i>(%s): <br>%s</font>""") % (
             comment,
             self.htmlText(rl[0].getTrack().getTitle()),
             self._getAuthorHTML(rl[0].getResponsible()) if rl[0].getResponsible() else '',
             self.htmlText(rl[0].getComment())
         )
     return comment
示例#2
0
    def _getHTMLHeader( self ):
        from MaKaC.webinterface.rh.base import RHModificationBaseProtected
        from MaKaC.webinterface.rh.admins import RHAdminBase

        area=""
        if isinstance(self._rh, RHModificationBaseProtected):
            area=i18nformat(""" - _("Management area")""")
        elif isinstance(self._rh, RHAdminBase):
            area=i18nformat(""" - _("Administrator area")""")

        info = HelperMaKaCInfo().getMaKaCInfoInstance()

        plugin_css = values_from_signal(signals.plugin.inject_css.send(self.__class__), as_list=True,
                                        multi_value_types=list)
        plugin_js = values_from_signal(signals.plugin.inject_js.send(self.__class__), as_list=True,
                                       multi_value_types=list)

        return wcomponents.WHTMLHeader().getHTML({
            "area": area,
            "baseurl": self._getBaseURL(),
            "conf": Config.getInstance(),
            "page": self,
            "printCSS": map(self._fix_path, self.getPrintCSSFiles()),
            "extraCSS": map(self._fix_path, self.getCSSFiles() + plugin_css + self.get_extra_css_files()),
            "extraJSFiles": map(self._fix_path, self.getJSFiles() + plugin_js),
            "language": session.lang or info.getLang(),
            "social": info.getSocialAppConfig(),
            "assets": self._asset_env
        })
示例#3
0
文件: admins.py 项目: k3njiy/indico
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     dh = domain.DomainHolder()
     letters = dh.getBrowseIndex()
     vars["browseIndex"] = i18nformat("""
     <span class="nav_border"><a href='' class="nav_link" onClick="document.browseForm.letter.disable=1;document.browseForm.submit();return false;">_("clear")</a></span>""")
     if self._letter == "all":
         vars["browseIndex"] += """
     [all] """
     else:
         vars["browseIndex"] += i18nformat("""
     <span class="nav_border"><a href='' class="nav_link" onClick="document.browseForm.letter.value='all';document.browseForm.submit();return false;">_("all")</a></span> """)
     for letter in letters:
         if self._letter == letter:
             vars["browseIndex"] += """\n[%s] """ % letter
         else:
             vars["browseIndex"] += """\n<span class="nav_border"><a href='' class="nav_link" onClick="document.browseForm.letter.value='%s';document.browseForm.submit();return false;">%s</a></span> """ % (escape(letter,True),letter)
     vars["browseResult"] = ""
     res = []
     if self._letter not in [ None, "" ]:
         if self._letter != "all":
             res = dh.matchFirstLetter(self._letter)
         else:
             res = dh.getValuesToList()
         res.sort(utils.sortDomainsByName)
         vars["browseResult"] = WHTMLDomainList(vars,res).getHTML()
     return vars
示例#4
0
 def _getAbstractHTML(self):
     if not self._contrib.getConference().getAbstractMgr().isActive() or not self._contrib.getConference().hasEnabledSection("cfa"):
         return ""
     abs = self._contrib.getAbstract()
     if abs is not None:
         html = i18nformat("""
          <tr>
             <td class="dataCaptionTD"><span class="dataCaptionFormat"> _("Abstract")</span></td>
             <td bgcolor="white" class="blacktext"><a href=%s>%s - %s</a></td>
         </tr>
         <tr>
             <td colspan="3" class="horizontalLine">&nbsp;</td>
         </tr>
             """) % (quoteattr(str(urlHandlers.UHAbstractManagment.getURL(abs))),
                     self.htmlText(abs.getId()), abs.getTitle())
     else:
         html = i18nformat("""
          <tr>
             <td class="dataCaptionTD"><span class="dataCaptionFormat"> _("Abstract")</span></td>
             <td bgcolor="white" class="blacktext">&nbsp;&nbsp;&nbsp;<font color="red"> _("The abstract associated with this contribution has been removed")</font></td>
         </tr>
         <tr>
             <td colspan="3" class="horizontalLine">&nbsp;</td>
         </tr>
             """)
     return html
示例#5
0
    def getVars(self):
        wvars = wcomponents.WTemplated.getVars(self)
        regForm = self._conf.getRegistrationForm()

        wvars["confId"] = self._conf.getId()
        wvars["body_title"] = self._getTitle()
        wvars["startDate"] = regForm.getStartRegistrationDate().strftime("%d %B %Y")
        wvars["endDate"] = regForm.getEndRegistrationDate().strftime("%d %B %Y")
        wvars["actions"] = self._getActionsHTML()
        wvars["announcement"] = regForm.getAnnouncement()
        wvars["title"] = regForm.getTitle()
        wvars["usersLimit"] = ""
        if regForm.getUsersLimit() > 0:
            wvars["usersLimit"] = i18nformat("""
                                <tr>
                                    <td nowrap class="displayField"><b> _("Max No. of registrants"):</b></td>
                                    <td width="100%%" align="left">%s</td>
                                </tr>
                                """) % regForm.getUsersLimit()
        wvars["contactInfo"] = ""
        if regForm.getContactInfo().strip() != "":
            wvars["contactInfo"] = i18nformat("""
                                <tr>
                                    <td nowrap class="displayField"><b> _("Contact info"):</b></td>
                                    <td width="100%%" align="left">%s</td>
                                </tr>
                                """) % regForm.getContactInfo()
        return wvars
示例#6
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars( self )
        vars["logo"] = ""
        if self._conf.getLogo():
            vars["logo"] = "<img src=\"%s\" alt=\"%s\" border=\"0\">"%(vars["logoURL"], self._conf.getTitle())
        vars["confTitle"] = self._conf.getTitle()
        vars["displayURL"] = urlHandlers.UHConferenceDisplay.getURL(self._conf)
        vars["imgConferenceRoom"] = Config.getInstance().getSystemIconURL( "conferenceRoom" )
        tzUtil = timezoneUtils.DisplayTZ(self._aw,self._conf)
        tz = tzUtil.getDisplayTZ()
        adjusted_sDate = self._conf.getStartDate().astimezone(timezone(tz))
        adjusted_eDate = self._conf.getEndDate().astimezone(timezone(tz))

        vars["confDateInterval"] = i18nformat("""_("from") %s _("to") %s (%s)""")%(format_date(adjusted_sDate, format='long'), format_date(adjusted_eDate, format='long'), tz)

        if self._conf.getStartDate().strftime("%d%B%Y") == \
                self._conf.getEndDate().strftime("%d%B%Y"):
            vars["confDateInterval"] = format_date(adjusted_sDate, format='long') + " (" + tz + ")"
        elif self._conf.getStartDate().month == self._conf.getEndDate().month:
            vars["confDateInterval"] = "%s-%s %s %s"%(adjusted_sDate.day, adjusted_eDate.day, format_date(adjusted_sDate, format='MMMM yyyy'), tz)
        vars["body"] = self._body
        vars["confLocation"] = ""
        if self._conf.getLocationList():
            vars["confLocation"] =  self._conf.getLocationList()[0].getName()
            vars["supportEmail"] = ""
        if self._conf.getSupportInfo().hasEmail():
            mailto = quoteattr("""mailto:%s?subject=%s"""%(self._conf.getSupportInfo().getEmail(), urllib.quote( self._conf.getTitle() ) ))
            vars["supportEmail"] =  i18nformat("""<a href=%s class="confSupportEmail"><img src="%s" border="0" alt="email">  _("support")</a>""")%(mailto, Config.getInstance().getSystemIconURL("mail") )
        format = displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(self._conf).getFormat()
        vars["bgColorCode"] = format.getFormatOption("titleBgColor")["code"]
        vars["textColorCode"] = format.getFormatOption("titleTextColor")["code"]
        return vars
示例#7
0
 def _getWarningsHTML(self):
     wl=[]
     for id in self._contribIdList:
         contrib=self._conf.getContributionById(id)
         if contrib is None:
             continue
         spkList=[]
         for spk in contrib.getSpeakerList():
             spkList.append(self.htmlText(spk.getFullName()))
         spkCaption=""
         if len(spkList)>0:
             spkCaption=" by %s"%"; ".join(spkList)
         if (contrib.getSession() is not None and \
                         contrib.getSession()!=self._targetSession):
             scheduled=""
             if contrib.isScheduled():
                 scheduled= i18nformat("""  _("and scheduled") (%s)""")%self.htmlText(contrib.getStartDate().strftime("%Y-%b-%d %H:%M"))
             wl.append( i18nformat("""
                     <li>%s-<i>%s</i>%s: is <font color="red"> _("already in session") <b>%s</b>%s</font></li>
             """)%(self.htmlText(contrib.getId()),
                     self.htmlText(contrib.getTitle()),
                     spkCaption,
                     self.htmlText(contrib.getSession().getTitle()),
                     scheduled))
         if (contrib.getSession() is None and \
                         self._targetSession is not None and \
                         contrib.isScheduled()):
             wl.append( i18nformat("""
                     <li>%s-<i>%s</i>%s: is <font color="red"> _("scheduled") (%s)</font></li>
             """)%(self.htmlText(contrib.getId()),
                     self.htmlText(contrib.getTitle()),
                     spkCaption,
                     self.htmlText(contrib.getStartDate().strftime("%Y-%b-%d %H:%M"))))
     return "<ul>%s</ul>"%"".join(wl)
示例#8
0
文件: base.py 项目: vstitches/indico
    def _getHTMLHeader( self ):
        from MaKaC.webinterface.pages.conferences import WPConfSignIn
        from MaKaC.webinterface.pages.signIn import WPSignIn
        from MaKaC.webinterface.pages.registrationForm import WPRegistrationFormSignIn
        from MaKaC.webinterface.rh.base import RHModificationBaseProtected
        from MaKaC.webinterface.rh.admins import RHAdminBase

        area=""
        if isinstance(self._rh, RHModificationBaseProtected):
            area=i18nformat(""" - _("Management area")""")
        elif isinstance(self._rh, RHAdminBase):
            area=i18nformat(""" - _("Administrator area")""")

        info = HelperMaKaCInfo().getMaKaCInfoInstance()
        websession = self._getAW().getSession()
        if websession:
            language = websession.getLang()
        else:
            language = info.getLang()

        return wcomponents.WHTMLHeader().getHTML({
            "area": area,
            "baseurl": self._getBaseURL(),
            "conf": Config.getInstance(),
            "page": self,
            "extraCSS": self.getCSSFiles(),
            "extraJSFiles": self.getJSFiles(),
            "extraJS": self._extraJS,
            "language": language,
            "social": info.getSocialAppConfig()
            })
示例#9
0
文件: tasks.py 项目: bubbas/indico
 def _getBody( self, params ):
     p = wcomponents.WNewPerson()
     
     if params.get("formTitle",None) is None :
         params["formTitle"] = _("Define new responsible")
     if params.get("titleValue",None) is None :
         params["titleValue"] = ""
     if params.get("surNameValue",None) is None :
         params["surNameValue"] = ""
     if params.get("nameValue",None) is None :
         params["nameValue"] = ""
     if params.get("emailValue",None) is None :
         params["emailValue"] = ""
     if params.get("addressValue",None) is None :
         params["addressValue"] = ""
     if params.get("affiliationValue",None) is None :
         params["affiliationValue"] = ""
     if params.get("phoneValue",None) is None :
         params["phoneValue"] = ""
     if params.get("faxValue",None) is None :
         params["faxValue"] = ""
     
     params["disabledSubmission"] = False
     params["submissionValue"] = i18nformat(""" <input type="checkbox" name="submissionControl"> _("Give submission rights to the presenter").""")
     params["disabledNotice"] = False
     params["noticeValue"] = i18nformat("""<i><font color="black"><b>_("Note"): </b></font>_("If this person does not already have
      an Indico account, he or she will be sent an email asking to create an account. After the account creation the 
      user will automatically be given submission rights.")</i>""")
     
     formAction = urlHandlers.UHTaskNewPersonAdd.getURL(self._target)
     formAction.addParam("orgin","new")
     formAction.addParam("typeName","responsible")
     params["formAction"] = formAction
     
     return p.getHTML(params)
示例#10
0
 def _getOthersFilterItemList( self ):
     checkedMulTracks, checkedOnlyComment = "", ""
     if self._filterCrit.getField("multiple_tracks"):
         checkedMulTracks = " checked"
     if self._filterCrit.getField("comment"):
         checkedOnlyComment = " checked"
     l = [ i18nformat("""<input type="checkbox" name="selMultipleTracks"%s> _("only multiple tracks")""")%checkedMulTracks, \
              i18nformat("""<input type="checkbox" name="selOnlyComment"%s> _("only with comments")""")%checkedOnlyComment]
     return l
示例#11
0
 def _getParticipations(self):
     participations="\n\n"
     for conf in self._participationsByConf.keys():
         participations+=i18nformat("""\t\t\t- _("Event") \"%s\":\n""")%conf.getTitle()
         for ps in self._participationsByConf[conf]:
             session=ps.getSession()
             participations+=i18nformat("""\t\t\t\t - _("Session") \"%s\"\n""")%(session.getTitle())
             accessURL = urlHandlers.UHSessionDisplay.getURL(session)
             participations+="\t\t\t\t - Access: %s\n" % accessURL
     return participations
示例#12
0
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     sesList = ""
     if self._contrib.getOwner() != self._conf:
         sesList = i18nformat("""<option value=\"CONF\" > _("Conference") : %s</option>\n""")%self._conf.getTitle()
     for ses in self._conf.getSessionListSorted():
         if self._contrib.getOwner() != ses:
             sesList = sesList + i18nformat("""<option value=\"%s\" > _("Session") : %s</option>\n""")%(ses.getId(), ses.getTitle())
     vars["sessionList"] = sesList
     vars["confId"] = self._conf.getId()
     vars["contribId"] = self._contrib.getId()
     return vars
示例#13
0
 def _getBody(self,params):
     wc=wcomponents.WDisplayConfirmation()
     msg= i18nformat(""" _("Are you sure you want to delete the following material")?<br>
     <b><i>%s</i></b>
     <br>""")%self._mat.getTitle()
     url=urlHandlers.UHContributionDisplayRemoveMaterial.getURL(self._mat.getOwner())
     return wc.getHTML(msg,url,{"deleteMaterial":self._mat.getId()})
示例#14
0
文件: tasks.py 项目: bubbas/indico
 def _getTaskList(self):
     html = []
     
     taskList = self._target.getTaskList()[:]
     if self._listOrder == "1" :
         taskList.sort(task.Task.cmpTaskId)
     if self._listOrder == "2" :
         taskList.sort(task.Task.cmpTaskTitle)            
     if self._listOrder == "3" :
         taskList.sort(task.Task.cmpTaskCurrentStatus)            
     if self._listOrder == "4" :
         taskList.sort(task.Task.cmpTaskCreationDate)                    
         
     for t in taskList :
         if self._taskFilter == "" or self._taskFilter == t.getCurrentStatus().getStatusName() :
             urlDetails = urlHandlers.UHTaskDetails.getURL(self._target)
             urlDetails.addParam("taskId",t.getId())
             urlComment = urlHandlers.UHTaskCommentNew.getURL(self._target)
             urlComment.addParam("taskId",t.getId())
             tz = DisplayTZ(self._aw,None,useServerTZ=1).getDisplayTZ()
             creationDate = "%s"%t.getCreationDate().astimezone(timezone(tz))
             text = i18nformat("""
             <tr>
                 <td>&nbsp;&nbsp;%s</td>
                 <td>&nbsp;&nbsp;<a href="%s">%s</a></td>
                 <td>&nbsp;&nbsp;%s</td>
                 <td>&nbsp;&nbsp;%s</td>
                 <td align="center">&nbsp;&nbsp;%s</td>
                 <td align="center"><a href="%s"> _("comment")</a></td>
             </tr>
             """)%(t.getId(),urlDetails,t.getTitle(), _(t.getCurrentStatus().getStatusName()), creationDate[0:16], t.getCommentHistorySize(),urlComment)
             html.append(text)
         
     return """
     """.join(html)
示例#15
0
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     vars["abstractTitle"] = self._abstract.getTitle()
     vars["trackTitle"] = self._track.getTitle()
     vars["postURL"] = urlHandlers.UHTrackAbstractPropToAcc.getURL( self._track, self._abstract )
     l = []
     conf = self._abstract.getConference()
     vars["abstractReview"] = conf.getConfAbstractReview()
     for ctype in conf.getContribTypeList():
         selected = ""
         if vars.has_key("contribType"):
             if ctype == vars["contribType"]:
                 selected = " selected"
         elif self._abstract.getContribType() == ctype:
             selected = " selected"
         l.append('<option value="%s"%s>%s</option>' % (ctype.id, selected, ctype.name))
     vars["contribTypes"] = ""
     if len(l) > 0:
         vars["contribTypes"] =  i18nformat("""
                                 <tr>
                       <td nowrap class="titleCellTD"><span class="titleCellFormat">
                                      _("Proposed contribution type"):
                       </td>
                       <td>&nbsp;
                      <select name="contribType">%s</select>
                       </td>
                         </tr>
                                 """)%("".join(l))
     return vars
示例#16
0
文件: material.py 项目: bubbas/indico
 def _getResources(self):
     mr = self._material.getMainResource()
     checked = ""
     if mr == None:
         checked = """ checked="checked" """
     l = [
         i18nformat(
             """<li><input type="radio" %s name="mainResource" value="none"><b> --_("no main resource")--</b></li>"""
         )
         % checked
     ]
     for res in self._material.getResourceList():
         checked = ""
         if mr != None and res.getId() == mr.getId():
             checked = """ checked="checked" """
         if res.__class__ is conference.LocalFile:
             l.append(
                 """<li><input type="radio" %s name="mainResource" value="%s"><small>[%s]</small> <b>%s</b> (%s) - <small>%s</small></li>"""
                 % (
                     checked,
                     res.getId(),
                     res.getFileType(),
                     res.getName(),
                     res.getFileName(),
                     strfFileSize(res.getSize()),
                 )
             )
         elif res.__class__ is conference.Link:
             l.append(
                 """<li><input type="radio" %s name="mainResource" value="%s"><b>%s</b> (%s)</li>"""
                 % (checked, res.getId(), res.getName(), res.getURL())
             )
     return "<ol>%s</ol>" % "".join(l)
示例#17
0
 def _getWithdrawnInfoHTML(self):
     status = self._contrib.getCurrentStatus()
     if not isinstance(status, conference.ContribStatusWithdrawn):
         return ""
     comment = ""
     if status.getComment() != "":
         comment = """<br><i>%s""" % self.htmlText(status.getComment())
     d = self.htmlText(status.getDate().strftime("%Y-%b-%D %H:%M"))
     resp = ""
     if status.getResponsible() is not None:
         resp = "by %s" % self.htmlText(status.getResponsible().getFullName())
     html = (
         i18nformat(
             """
  <tr>
     <td class="dataCaptionTD"><span class="dataCaptionFormat"> _("Withdrawal information")</span></td>
     <td bgcolor="white" class="blacktext"><b> _("WITHDRAWN")</b> _("on") %s %s%s</td>
 </tr>
 <tr>
     <td colspan="3" class="horizontalLine">&nbsp;</td>
 </tr>
         """
         )
         % (d, resp, comment)
     )
     return html
示例#18
0
 def getValue(cls, abstract):
     status = abstract.getCurrentStatus()
     if isinstance(status, review.AbstractStatusAccepted):
         session = abstract.getContribution().getSession()
         if session is not None:
             return session.getTitle()
     return i18nformat("""--_("not specified")--""")
示例#19
0
文件: admins.py 项目: k3njiy/indico
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
     vars["title"] = minfo.getTitle()
     vars["organisation"] = minfo.getOrganisation()
     vars['supportEmail'] = Config.getInstance().getSupportEmail()
     vars['publicSupportEmail'] = Config.getInstance().getPublicSupportEmail()
     vars['noReplyEmail'] = Config.getInstance().getNoReplyEmail()
     vars["lang"] = minfo.getLang()
     vars["address"] = ""
     if minfo.getCity() != "":
         vars["address"] = minfo.getCity()
     if minfo.getCountry() != "":
         if vars["address"] != "":
             vars["address"] = "%s (%s)"%(vars["address"], minfo.getCountry())
         else:
             vars["address"] = "%s"%minfo.getCountry()
     vars["timezone"] = Config.getInstance().getDefaultTimezone()
     vars["systemIconAdmins"] = Config.getInstance().getSystemIconURL( "admin" )
     iconDisabled = str(Config.getInstance().getSystemIconURL( "disabledSection" ))
     iconEnabled = str(Config.getInstance().getSystemIconURL( "enabledSection" ))
     url = urlHandlers.UHAdminSwitchNewsActive.getURL()
     icon = iconEnabled if minfo.isNewsActive() else iconDisabled
     vars["features"] = i18nformat("""<a href="%s"><img src="%s" border="0" style="float:left; padding-right: 5px">_("News Pages")</a>""") % (url, icon)
     vars["administrators"] = fossilize(sorted([u.as_avatar for u in User.find(is_admin=True, is_deleted=False)],
                                               key=methodcaller('getStraightFullName')))
     return vars
示例#20
0
文件: meeting.py 项目: NIIF/indico
    def _applyConfDisplayDecoration( self, body ):
        frame = WMConfDisplayFrame( self._getAW(), self._conf )
        frameParams = {\
              "logoURL": urlHandlers.UHConferenceLogo.getURL( self._conf) }
        if self._conf.getLogo():
            frameParams["logoURL"] = urlHandlers.UHConferenceLogo.getURL( self._conf)

        confTitle = self._conf.getTitle()
        colspan=""
        imgOpen=""
        padding=""
        padding=""" style="padding:0px" """

        body =  i18nformat("""
                <td class="confBodyBox" %s %s>
                    %s
                    <table border="0" cellpadding="0" cellspacing="0" valign="top" width="720px">
                        <tr>
                            <td><div class="groupTitle">_("Added Material") - %s</div></td>
                        </tr>
                        <tr>
                            <td align="left" valign="middle" width="100%%">
                                <b><br>%s</b>
                            </td>
                       </tr>
                    </table>
                     <!--Main body-->
                    %s
                </td>""")%(colspan,padding,imgOpen, confTitle,
                        self._getNavigationBarHTML(),
                        body)
        return frame.getHTML( body, frameParams)
示例#21
0
    def _applyConfDisplayDecoration( self, body ):
        frame = WMConfDisplayFrame( self._getAW(), self._conf )
        frameParams = {\
              "logoURL": self.logo_url, \
                      }
        if self.event.has_logo:
            frameParams["logoURL"] = self.logo_url

        confTitle = self._conf.getTitle()
        colspan=""
        imgOpen=""
        padding=""
        padding=""" style="padding:0px" """

        body =  i18nformat("""
                <td class="confBodyBox" %s %s>
                    %s
                    <table border="0" cellpadding="0" cellspacing="0"
                                align="center" valign="top" width="95%%">
                        <tr>
                            <td class="formTitle" width="100%%"> _("Session View") - %s</td>
                        </tr>
                        <tr>
                            <td align="left" valign="middle" width="100%%">
                                <b><br>%s</b>
                            </td>
                       </tr>
                    </table>
                     <!--Main body-->
                    %s
                </td>""")%(colspan,padding,imgOpen,confTitle,
                        self._getNavigationBarHTML(),
                        body)
        return frame.getHTML( body, frameParams)
示例#22
0
文件: meeting.py 项目: NIIF/indico
 def getVars(self):
     vars = wcomponents.WTemplated.getVars( self )
     vars["logo"] = ""
     if self._conf.getLogo():
         vars["logo"] = "<img src=\"%s\" alt=\"%s\" border=\"0\">"%(vars["logoURL"], self._conf.getTitle())
     vars["confTitle"] = self._conf.getTitle()
     vars["displayURL"] = urlHandlers.UHConferenceDisplay.getURL(self._conf)
     vars["imgConferenceRoom"] = Config.getInstance().getSystemIconURL( "conferenceRoom" )
     #################################
     # Fermi timezone awareness      #
     #################################
     vars["confDateInterval"] = i18nformat("""_("from") %s _("to") %s""")%(format_date(self._conf.getStartDate(), format='long'), format_date(self._conf.getEndDate(), format='long'))
     if self._conf.getStartDate().strftime("%d%B%Y") == \
             self._conf.getEndDate().strftime("%d%B%Y"):
         vars["confDateInterval"] = format_date(self._conf.getStartDate(), format='long')
     elif self._conf.getStartDate().month == self._conf.getEndDate().month:
         vars["confDateInterval"] = "%s-%s %s"%(self._conf.getStartDate().day, self._conf.getEndDate().day, format_date(self._conf.getStartDate(), format='MMMM yyyy'))
     #################################
     # Fermi timezone awareness(end) #
     #################################
     vars["body"] = self._body
     vars["confLocation"] = ""
     if self._conf.getLocationList():
         vars["confLocation"] =  self._conf.getLocationList()[0].getName()
         vars["supportEmail"] = ""
     if self._conf.getSupportInfo().hasEmail():
         mailto = quoteattr("""mailto:%s?subject=%s"""%(self._conf.getSupportInfo().getEmail(), urllib.quote( self._conf.getTitle() ) ))
         vars["supportEmail"] =  _("""<a href=%s class="confSupportEmail"><img src="%s" border="0" alt="email"> %s</a>""")%(mailto,
                                                     Config.getInstance().getSystemIconURL("mail"),
                                                     self._conf.getSupportInfo().getCaption())
     format = displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(self._conf).getFormat()
     vars["bgColorCode"] = format.getFormatOption("titleBgColor")["code"]
     vars["textColorCode"] = format.getFormatOption("titleTextColor")["code"]
     return vars
示例#23
0
文件: admins.py 项目: florv/indico
 def getVars(self):
     wvars = wcomponents.WTemplated.getVars(self)
     minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
     wvars['title'] = minfo.getTitle()
     wvars['organisation'] = minfo.getOrganisation()
     wvars['supportEmail'] = Config.getInstance().getSupportEmail()
     wvars['publicSupportEmail'] = Config.getInstance().getPublicSupportEmail()
     wvars['noReplyEmail'] = Config.getInstance().getNoReplyEmail()
     wvars['lang'] = minfo.getLang()
     wvars['address'] = ''
     if minfo.getCity() != '':
         wvars['address'] = minfo.getCity()
     if minfo.getCountry() != '':
         if wvars['address'] != '':
             wvars['address'] = '{0} ({1})'.format(wvars['address'], minfo.getCountry())
         else:
             wvars['address'] = minfo.getCountry()
     wvars['timezone'] = Config.getInstance().getDefaultTimezone()
     wvars['systemIconAdmins'] = Config.getInstance().getSystemIconURL('admin')
     iconDisabled = str(Config.getInstance().getSystemIconURL('disabledSection'))
     iconEnabled = str(Config.getInstance().getSystemIconURL('enabledSection'))
     url = urlHandlers.UHAdminSwitchNewsActive.getURL()
     icon = iconEnabled if minfo.isNewsActive() else iconDisabled
     wvars['features'] = i18nformat('<a href="{}"><img src="{}" border="0"'
                                    'style="float:left; padding-right: 5px">_("News Pages")</a>').format(url, icon)
     wvars['administrators'] = fossilize(sorted([u.as_avatar for u in User.find(is_admin=True, is_deleted=False)],
                                                key=methodcaller('getStraightFullName')))
     wvars['tracker_url'] = urljoin(Config.getInstance().getTrackerURL(),
                                    'api/instance/{}'.format(cephalopod_settings.get('uuid')))
     wvars['cephalopod_data'] = {'enabled': cephalopod_settings.get('joined'),
                                 'contact': cephalopod_settings.get('contact_name'),
                                 'email': cephalopod_settings.get('contact_email'),
                                 'url': Config.getInstance().getBaseURL(),
                                 'organisation': minfo.getOrganisation()}
     return wvars
示例#24
0
文件: tasks.py 项目: bubbas/indico
 def _getCommentsList(self, task):
     keys = task.getCommentHistory().keys()
     keys.sort()
     #raise "%s"%keys
     out = i18nformat("""
     <table width="100%">
         <tr>
             <td width="22%"><span class="titleCellFormat">&nbsp; _("Date")</span></td>
             <td width="50%"><span class="titleCellFormat">&nbsp; _("Text")</span></td>
             <td width="28%"><span class="titleCellFormat">&nbsp; _("Author")</span></td>
         </tr>""")
     html = []
     
     for k in keys :
         c = task.getCommentHistory()[k]
         tz = DisplayTZ(self._aw,None,useServerTZ=1).getDisplayTZ()
         date = "%s"%c.getCreationDate().astimezone(timezone(tz))
         text = """
         <tr>
             <td width="2%%">%s</td>
             <td width="50%%">%s</td>
             <td width="28%%">&nbsp;%s</td>
         </tr>"""%(date[0:16],c.getCommentText(),c.getCommentAuthor())
         html.append(text)
     
     return out + """
     """.join(html) + """
示例#25
0
 def _getParticipations(self):
     participations="\n\n"
     for conf in self._participationsByConf.keys():
         participations+=i18nformat("""\t\t\t- _("Event") \"%s\":\n""")%conf.getTitle()
         accessURL = urlHandlers.UHConferenceDisplay.getURL(conf)
         participations+="\t\t\t- Access: %s\n" % accessURL
     return participations
示例#26
0
 def getVars(self):
     vars=wcomponents.WTemplated.getVars(self)
     url=vars["postURL"]
     if vars.get("sortBy","").strip()!="":
         url.addParam("sortBy",vars["sortBy"])
     vars["postURL"]=quoteattr(str(url))
     vars["title"]=self.htmlText(self._contrib.getTitle())
     defaultDefinePlace=defaultDefineRoom=""
     defaultInheritPlace=defaultInheritRoom="checked"
     locationName,locationAddress,roomName="","",""
     if self._contrib.getOwnLocation():
         defaultDefinePlace,defaultInheritPlace="checked",""
         locationName=self._contrib.getLocation().getName()
         locationAddress=self._contrib.getLocation().getAddress()
     if self._contrib.getOwnRoom():
         defaultDefineRoom,defaultInheritRoom="checked",""
         roomName=self._contrib.getRoom().getName()
     vars["defaultInheritPlace"]=defaultInheritPlace
     vars["defaultDefinePlace"]=defaultDefinePlace
     vars["confPlace"]=""
     confLocation=self._contrib.getOwner().getLocation()
     if self._contrib.isScheduled():
         confLocation=self._contrib.getSchEntry().getSchedule().getOwner().getLocation()
         sDate=self._contrib.getAdjustedStartDate()
         vars["sYear"]=quoteattr(str(sDate.year))
         vars["sMonth"]=quoteattr(str(sDate.month))
         vars["sDay"]=quoteattr(str(sDate.day))
         vars["sHour"]=quoteattr(str(sDate.hour))
         vars["sMinute"]=quoteattr(str(sDate.minute))
         vars["startDate"]=self._contrib.getAdjustedStartDate().strftime("%Y-%b-%d %H:%M")
     else:
         vars["sYear"]=quoteattr(str(""))
         vars["sMonth"]=quoteattr(str(""))
         vars["sDay"]=quoteattr(str(""))
         vars["sHour"]=quoteattr(str(""))
         vars["sMinute"]=quoteattr(str(""))
         vars["startDate"]= i18nformat("""--_("not scheduled")--""")
     vars["durHours"]=quoteattr(str((datetime(1900,1,1)+self._contrib.getDuration()).hour))
     vars["durMins"]=quoteattr(str((datetime(1900,1,1)+self._contrib.getDuration()).minute))
     if confLocation:
         vars["confPlace"]=confLocation.getName()
     vars["locationName"]=locationName
     vars["locationAddress"]=locationAddress
     vars["defaultInheritRoom"]=defaultInheritRoom
     vars["defaultDefineRoom"]=defaultDefineRoom
     vars["confRoom"]=""
     confRoom=self._contrib.getOwner().getRoom()
     if self._contrib.isScheduled():
         confRoom=self._contrib.getSchEntry().getSchedule().getOwner().getRoom()
     if confRoom:
         vars["confRoom"]=confRoom.getName()
     vars["roomName"]=roomName
     vars["parentType"]="conference"
     if self._contrib.getSession() is not None:
         vars["parentType"]="session"
         if self._contrib.isScheduled():
             vars["parentType"]="session slot"
     vars["boardNumber"]=quoteattr(str(self._contrib.getBoardNumber()))
     return vars
示例#27
0
 def _getTrackItems(self):
     res = [i18nformat("""<option value="--none--">--_("none")--</option>""")]
     for track in self._session.getConference().getTrackList():
         res.append(
             """<option value=%s>(%s) %s</option>"""
             % (quoteattr(str(track.getId())), self.htmlText(track.getCode()), self.htmlText(track.getTitle()))
         )
     return "".join(res)
示例#28
0
    def _getAccommodationHTML(self):
        regForm = self._conf.getRegistrationForm()
        if regForm.getAccommodationForm().isEnabled():
            accommodation = self._registrant.getAccommodation()
            accoType = i18nformat("""<span class="not-selected">_("Not selected")</span>""")
            cancelled = ""
            if accommodation is not None and accommodation.getAccommodationType() is not None:
                accoType = accommodation.getAccommodationType().getCaption()
                if accommodation.getAccommodationType().isCancelled():
                    cancelled = """<span class="not-selected">( """ + _("disabled") + """)</span>"""
            arrivalDate = """<span class="not-selected">""" + _("Not selected") + """</span>"""
            if accommodation is not None and accommodation.getArrivalDate() is not None:
                arrivalDate = accommodation.getArrivalDate().strftime("%d-%B-%Y")
            departureDate = """<span class="not-selected">""" + _("Not selected") + """</span>"""
            if accommodation is not None and accommodation.getDepartureDate() is not None:
                departureDate = accommodation.getDepartureDate().strftime("%d-%B-%Y")
            accoTypeHTML = ""
            if regForm.getAccommodationForm().getAccommodationTypesList() != []:
                accoTypeHTML = i18nformat("""
                          <tr>
                            <td align="left" class="regform-done-caption">_("Type")</td>
                            <td align="left" class="regform-done-data">%s %s</td>
                          </tr>""" % (accoType, cancelled))

            text = i18nformat("""
                        <table>
                          <tr>
                            <td align="left" class="regform-done-caption">_("Arrival")</td>
                            <td align="left" class="regform-done-data">%s</td>
                          </tr>
                          <tr>
                            <td align="left" class="regform-done-caption">_("Departure")</td>
                            <td align="left" class="regform-done-data">%s</td>
                          </tr>
                          %s
                        </table>
                        """) % (arrivalDate, departureDate, accoTypeHTML)
            return i18nformat("""
                    <tr>
                      <td class="regform-done-title">_("Accommodation")</td>
                    </tr>
                    <tr>
                      <td>%s</td>
                    </tr>
                    """) % (text)
        return ""
示例#29
0
    def getBody(self):
        msg = self.getMsg()
        return i18nformat("""
_("The following email has been sent to %s"):

===

%s""") % (self.getDestination().getFullName(), msg)
示例#30
0
 def _getParticipations(self):
     participations="\n\n"
     for conf in self._participationsByConf.keys():
         participations+=i18nformat("""\t\t\t- _("Event") \"%s\":\n""")%conf.getTitle()
         for ps in self._participationsByConf[conf]:
             contrib=ps.getContribution()
             typeAuthor=""
             if contrib.isPrimaryAuthor(ps):
                 typeAuthor=_("Primary Author")
             elif contrib.isCoAuthor(ps):
                 typeAuthor=_("Co-author")
             elif contrib.isSpeaker(ps):
                 typeAuthor=_("Speaker")
             participations+=i18nformat("""\t\t\t\t - _("Contribution") \"%s\" (%s)\n""")%(contrib.getTitle(), typeAuthor)
             accessURL = urlHandlers.UHContributionDisplay.getURL(contrib)
             participations+="\t\t\t\t - Access: %s\n" % accessURL
     return participations
示例#31
0
 def _getChangeSessionsHTML(self):
     res = []
     if not self._contrib.getSession() is None:
         res = [i18nformat("""<option value="">--_("none")--</option>""")]
     for session in self._contrib.getConference().getSessionListSorted():
         if self._contrib.getSession() == session or session.isClosed():
             continue
         from MaKaC.common.TemplateExec import truncateTitle
         res.append("""<option value=%s>%s</option>""" %
                    (quoteattr(str(session.getId())),
                     self.htmlText(truncateTitle(session.getTitle(), 60))))
     return "".join(res)
示例#32
0
    def _getHTMLHeader(self):
        from MaKaC.webinterface.pages.conferences import WPConfSignIn
        from MaKaC.webinterface.pages.signIn import WPSignIn
        from MaKaC.webinterface.pages.registrationForm import WPRegistrationFormSignIn
        from MaKaC.webinterface.rh.base import RHModificationBaseProtected
        from MaKaC.webinterface.rh.admins import RHAdminBase

        area = ""
        if isinstance(self._rh, RHModificationBaseProtected):
            area = i18nformat(""" - _("Management area")""")
        elif isinstance(self._rh, RHAdminBase):
            area = i18nformat(""" - _("Administrator area")""")

        info = HelperMaKaCInfo().getMaKaCInfoInstance()
        websession = self._getAW().getSession()
        if websession:
            language = websession.getLang()
        else:
            language = info.getLang()

        return wcomponents.WHTMLHeader().getHTML({
            "area":
            area,
            "baseurl":
            self._getBaseURL(),
            "conf":
            Config.getInstance(),
            "page":
            self,
            "extraCSS":
            self.getCSSFiles(),
            "extraJSFiles":
            self.getJSFiles(),
            "extraJS":
            self._extraJS,
            "language":
            language,
            "social":
            info.getSocialAppConfig()
        })
示例#33
0
 def _getBody(self, params):
     if hasattr(self._rh._target, "getModifKey") and \
         self._rh._target.getModifKey() != "":
         keys = session.get("modifKeys", {})
         if keys.get(self._rh._target.getId()):
             msg = i18nformat(
                 """<font color=red> _("Wrong modification key!")</font>""")
         else:
             msg = ""
         wc = WModificationKeyError(self._rh, msg)
     else:
         wc = WModificationError(self._rh)
     return wc.getHTML()
示例#34
0
文件: errors.py 项目: arturodr/indico
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["area"]= i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _("The access to this page has been restricted by its owner and you are not authorised to view it")
     if isinstance(self._rh._target, list):
         #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         contactInfo = [item.getAccessController().getAnyContactInfo() for item in self._rh._target if hasattr(item, 'getAccessController') ]
         vars["contactInfo"] = ";".join(contactInfo)
     elif self._rh._target is not None and hasattr(self._rh._target, 'getAccessController'): #only objects with Access Controler (e.g. we do not want to check this for RB reservertion target): Conferences, Contribs...
         vars["contactInfo"] = self._rh._target.getAccessController().getAnyContactInfo()
     else:
         vars["contactInfo"] = ""
     return vars
示例#35
0
 def _getWarningsHTML(self):
     wl = []
     for id in self._contribIdList:
         contrib = self._conf.getContributionById(id)
         if contrib is None:
             continue
         spkList = []
         for spk in contrib.getSpeakerList():
             spkList.append(self.htmlText(spk.getFullName()))
         spkCaption = ""
         if len(spkList) > 0:
             spkCaption = " by %s" % "; ".join(spkList)
         if (contrib.getSession() is not None and \
                         contrib.getSession()!=self._targetSession):
             scheduled = ""
             if contrib.isScheduled():
                 scheduled = i18nformat(
                     """  _("and scheduled") (%s)""") % self.htmlText(
                         contrib.getStartDate().strftime("%Y-%b-%d %H:%M"))
             wl.append(
                 i18nformat("""
                     <li>%s-<i>%s</i>%s: is <font color="red"> _("already in session") <b>%s</b>%s</font></li>
             """) % (self.htmlText(contrib.getId()),
                     self.htmlText(contrib.getTitle()), spkCaption,
                     self.htmlText(
                         contrib.getSession().getTitle()), scheduled))
         if (contrib.getSession() is None and \
                         self._targetSession is not None and \
                         contrib.isScheduled()):
             wl.append(
                 i18nformat("""
                     <li>%s-<i>%s</i>%s: is <font color="red"> _("scheduled") (%s)</font></li>
             """) %
                 (self.htmlText(contrib.getId()),
                  self.htmlText(contrib.getTitle()), spkCaption,
                  self.htmlText(
                      contrib.getStartDate().strftime("%Y-%b-%d %H:%M"))))
     return "<ul>%s</ul>" % "".join(wl)
示例#36
0
 def _getTabContent( self, params ):
     p = conferences.WConferenceClone( self._conf )
     pars = {
         "cancelURL": urlHandlers.UHConfModifTools.getURL(self._conf),
         "cloning": urlHandlers.UHConfPerformCloning.getURL(self._conf),
         "cloneOptions": i18nformat("""<li><input type="checkbox" name="cloneTimetable" id="cloneTimetable" value="1" checked="checked" />_("Full timetable")</li>
                  <li><ul style="list-style-type: none;"><li><input type="checkbox" name="cloneSessions" id="cloneSessions" value="1" />_("Sessions")</li></ul></li>
                  <li><input type="checkbox" name="cloneParticipants" id="cloneParticipants" value="1" checked="checked" />_("Participants")</li>
                  <li><input type="checkbox" name="cloneEvaluation" id="cloneEvaluation" value="1" />_("Evaluation")</li>
            """)
     }
     #let the plugins add their own elements
     self._notify('addCheckBox2CloneConf', pars)
     return p.getHTML( pars )
示例#37
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
示例#38
0
 def _getTabContent( self, params ):
     p = conferences.WConferenceClone( self._conf )
     pars = {
         "cancelURL": urlHandlers.UHConfModifTools.getURL(self._conf),
         "cloning": urlHandlers.UHConfPerformCloning.getURL(self._conf),
         "cloneOptions": i18nformat("""
 <li><input type="checkbox" name="cloneParticipants" id="cloneParticipants" value="1" >
     _("Participants")</li>
 <li><input type="checkbox" name="cloneEvaluation" id="cloneEvaluation" value="1" >
     _("Evaluation")</li>
        """)
     }
     pars['cloneOptions'] += EventCloner.get_plugin_items(self._conf)
     return p.getHTML(pars)
示例#39
0
文件: errors.py 项目: arturodr/indico
 def _getBody( self, params ):
     if hasattr(self._rh._target, "getModifKey") and \
         self._rh._target.getModifKey() != "":
         sess = self._rh._getSession()
         keys = sess.getVar("modifKeys")
         id = self._rh._target.getId()
         if keys != None and keys.has_key(id) and keys[id].strip()!="":
             msg = i18nformat("""<font color=red> _("Wrong modification key!")</font>""")
         else:
             msg = ""
         wc = WModificationKeyError( self._rh, msg )
     else:
         wc = WModificationError( self._rh )
     return wc.getHTML()
示例#40
0
 def addCheckBox2CloneConf(cls, obj, list):
     """ we show the clone checkbox if:
         * The XMPP Plugin is active.
         * There are rooms in the event created by the user who wants to clone
     """
     #list of creators of the chat rooms
     ownersList = [
         cr.getOwner() for cr in DBHelpers().getChatroomList(obj._conf)
     ]
     if PluginsWrapper(
             'InstantMessaging',
             'XMPP').isActive() and obj._rh._aw._currentUser in ownersList:
         list['cloneOptions'] += i18nformat(
             """<li><input type="checkbox" name="cloneChatrooms" id="cloneChatrooms" value="1" />_("Chat Rooms")</li>"""
         )
示例#41
0
 def _getPageContent(self, params):
     p = conferences.WConferenceClone(self._conf)
     pars = {
         "cancelURL":
         urlHandlers.UHConfModifTools.getURL(self._conf),
         "cloning":
         urlHandlers.UHConfPerformCloning.getURL(self._conf),
         "cloneOptions":
         i18nformat(
             """<li><input type="checkbox" name="cloneTimetable" id="cloneTimetable" value="1" checked="checked" />_("Full timetable")</li>
                  <li><ul style="list-style-type: none;"><li><input type="checkbox" name="cloneSessions" id="cloneSessions" value="1" />_("Sessions")</li></ul></li>
            """)
     }
     pars['cloneOptions'] += EventCloner.get_plugin_items(self._conf)
     return p.getHTML(pars)
示例#42
0
文件: admins.py 项目: belokop/indico
 def getVars(self):
     wvars = wcomponents.WTemplated.getVars(self)
     minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
     wvars['title'] = minfo.getTitle()
     wvars['organisation'] = minfo.getOrganisation()
     wvars['supportEmail'] = Config.getInstance().getSupportEmail()
     wvars['publicSupportEmail'] = Config.getInstance(
     ).getPublicSupportEmail()
     wvars['noReplyEmail'] = Config.getInstance().getNoReplyEmail()
     wvars['lang'] = minfo.getLang()
     wvars['address'] = ''
     if minfo.getCity() != '':
         wvars['address'] = minfo.getCity()
     if minfo.getCountry() != '':
         if wvars['address'] != '':
             wvars['address'] = '{0} ({1})'.format(wvars['address'],
                                                   minfo.getCountry())
         else:
             wvars['address'] = minfo.getCountry()
     wvars['timezone'] = Config.getInstance().getDefaultTimezone()
     wvars['systemIconAdmins'] = Config.getInstance().getSystemIconURL(
         'admin')
     iconDisabled = str(
         Config.getInstance().getSystemIconURL('disabledSection'))
     iconEnabled = str(
         Config.getInstance().getSystemIconURL('enabledSection'))
     url = urlHandlers.UHAdminSwitchNewsActive.getURL()
     icon = iconEnabled if minfo.isNewsActive() else iconDisabled
     wvars['features'] = i18nformat(
         '<a href="{}"><img src="{}" border="0"'
         'style="float:left; padding-right: 5px">_("News Pages")</a>'
     ).format(url, icon)
     wvars['administrators'] = fossilize(
         sorted([
             u.as_avatar for u in User.find(is_admin=True, is_deleted=False)
         ],
                key=methodcaller('getStraightFullName')))
     wvars['tracker_url'] = urljoin(
         Config.getInstance().getTrackerURL(),
         'api/instance/{}'.format(cephalopod_settings.get('uuid')))
     wvars['cephalopod_data'] = {
         'enabled': cephalopod_settings.get('joined'),
         'contact': cephalopod_settings.get('contact_name'),
         'email': cephalopod_settings.get('contact_email'),
         'url': Config.getInstance().getBaseURL(),
         'organisation': minfo.getOrganisation()
     }
     return wvars
示例#43
0
    def getHTML( self ):
        res = []
        divs = []

        for day in self._month.getDayList():
            fulldate = "%s%02d%02d" % (self._month.getYear(),self._month.getMonthNumber(),day.getDayNumber())
            if day.getDayNumber() == 1:
                for i in range(day.getWeekDay()):
                    res.append("<td></td>")
            categs = day.getCategories()
            if len(categs)>1:
                colors = ["""
                <table cellspacing="0" cellpadding="0" border="0" align="left">
                <tr>"""]
                for categ in categs:
                    colors.append("""<td bgcolor="%s">&nbsp;</td>"""%self._categColors.getColor( categ ))
                colors.append("""
                </tr>
                </table>""")
                res.append( """<td align="right" bgcolor="%s"  onMouseOver="setOnAnchor('d%s')" onMouseOut="clearOnAnchor('d%s')">%s<span style="cursor: default;" id="a%s">%s</span></td>"""%( self._multipleColor, fulldate, fulldate, "\n".join(colors), fulldate, day.getDayNumber() ) )
                divs.append(self._getDiv(day))
            elif len(categs) == 1:
                res.append( """<td align="right" bgcolor="%s" onMouseOver="setOnAnchor('d%s')" onMouseOut="clearOnAnchor('d%s')"><span style="cursor: default;" id="a%s">%s</span></td>"""%( self._categColors.getColor( categs[0] ), fulldate, fulldate, fulldate, day.getDayNumber() ) )
                divs.append(self._getDiv(day))
            else:
                res.append( """<td align="right">%s</td>"""%day.getDayNumber() )
            if day.getWeekDay() == 6:
                res.append("""
                    </tr>
                    <tr>\n""")
        str = i18nformat("""
                <table cellspacing="1" cellpadding="5">
                    <tr>
                        <td colspan="7" align="center" style="font-size: 1.2em;">%s %s</b></td>
                    </tr>
                    <tr>
                      %s
                    </tr>
                    <tr>
                        %s
                    </tr>
                </table>
                %s
                """) % (self._month.getName(), self._month.getYear(),
                        ''.join(list('<td align="right" bgcolor="#CCCCCC">%s</td>' % currentLocale().weekday(wd)[:2] for wd in xrange(0, 7))),
                        "\n".join(res),"\n".join(divs))

        return str
示例#44
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["logo"] = ""
     if self._conf.getLogo():
         vars["logo"] = "<img src=\"%s\" alt=\"%s\" border=\"0\">" % (
             vars["logoURL"], self._conf.getTitle())
     vars["confTitle"] = self._conf.getTitle()
     vars["displayURL"] = urlHandlers.UHConferenceDisplay.getURL(self._conf)
     vars["imgConferenceRoom"] = Config.getInstance().getSystemIconURL(
         "conferenceRoom")
     #################################
     # Fermi timezone awareness      #
     #################################
     vars["confDateInterval"] = i18nformat(
         """_("from") %s _("to") %s""") % (
             format_date(self._conf.getStartDate(), format='long'),
             format_date(self._conf.getEndDate(), format='long'))
     if self._conf.getStartDate().strftime("%d%B%Y") == \
             self._conf.getEndDate().strftime("%d%B%Y"):
         vars["confDateInterval"] = format_date(self._conf.getStartDate(),
                                                format='long')
     elif self._conf.getStartDate().month == self._conf.getEndDate().month:
         vars["confDateInterval"] = "%s-%s %s" % (
             self._conf.getStartDate().day, self._conf.getEndDate().day,
             format_date(self._conf.getStartDate(), format='MMMM yyyy'))
     #################################
     # Fermi timezone awareness(end) #
     #################################
     vars["body"] = self._body
     vars["confLocation"] = ""
     if self._conf.getLocationList():
         vars["confLocation"] = self._conf.getLocationList()[0].getName()
         vars["supportEmail"] = ""
     if self._conf.getSupportInfo().hasEmail():
         mailto = quoteattr("""mailto:%s?subject=%s""" %
                            (self._conf.getSupportInfo().getEmail(),
                             urllib.quote(self._conf.getTitle())))
         vars["supportEmail"] = _(
             """<a href=%s class="confSupportEmail"><img src="%s" border="0" alt="email"> %s</a>"""
         ) % (mailto, Config.getInstance().getSystemIconURL("mail"),
              self._conf.getSupportInfo().getCaption())
     format = displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(
         self._conf).getFormat()
     vars["bgColorCode"] = format.getFormatOption("titleBgColor")["code"]
     vars["textColorCode"] = format.getFormatOption(
         "titleTextColor")["code"]
     return vars
示例#45
0
    def prerun(self):
        # Date checkings...
        from MaKaC.conference import ConferenceHolder
        if not ConferenceHolder().hasKey(self.conf.getId()) or \
                self.conf.getStartDate() <= nowutc():
            self.conf.removeAlarm(self)
            return True
        # Email
        self.setSubject("Event reminder: %s" % self.conf.getTitle())
        try:
            locationText = self.conf.getLocation().getName()
            if self.conf.getLocation().getAddress() != "":
                locationText += ", %s" % self.conf.getLocation().getAddress()
            if self.conf.getRoom().getName() != "":
                locationText += " (%s)" % self.conf.getRoom().getName()
        except:
            locationText = ""
        if locationText != "":
            locationText = i18nformat(""" _("Location"): %s""") % locationText

        if self.getToAllParticipants():
            for p in self.conf.getParticipation().getParticipantList():
                self.addToUser(p)

        from MaKaC.webinterface import urlHandlers
        if Config.getInstance().getShortEventURL() != "":
            url = "%s%s" % (Config.getInstance().getShortEventURL(),
                            self.conf.getId())
        else:
            url = urlHandlers.UHConferenceDisplay.getURL(self.conf)
        self.setText("""Hello,
    Please note that the event "%s" will start on %s (%s).
    %s

    You can access the full event here:
    %s

Best Regards

    """%(self.conf.getTitle(),\
                self.conf.getAdjustedStartDate().strftime("%A %d %b %Y at %H:%M"),\
                self.conf.getTimezone(),\
                locationText,\
                url,\
                ))
        self._setMailText()
        return False
示例#46
0
文件: tracks.py 项目: wtakase/indico
 def _getAccTypeFilterItemList(self):
     checked = ""
     if self._filterCrit.getField("acc_type").getShowNoValue():
         checked = " checked"
     l = [
         i18nformat(
             """<input type="checkbox" name="accTypeShowNoValue"%s> --_("not specified")--"""
         ) % checked
     ]
     for type in self._conf.getContribTypeList():
         checked = ""
         if type in self._filterCrit.getField("acc_type").getValues():
             checked = " checked"
         l.append(
             """<input type="checkbox" name="selAccTypes" value=%s%s> %s"""
             % (type.id, checked, self.htmlText(type.name)))
     return l
示例#47
0
 def _getTrackItemsHTML(self):
     checked = ""
     if self._filterCrit.getField("track").getShowNoValue():
         checked = " checked"
     res = [
         i18nformat(
             """<input type="checkbox" name="trackShowNoValue" value="--none--"%s>--_("not specified")--"""
         ) % checked
     ]
     for t in self._conf.getTrackList():
         checked = ""
         if t.getId() in self._filterCrit.getField("track").getValues():
             checked = " checked"
         res.append(
             """<input type="checkbox" name="tracks" value=%s%s> (%s) %s"""
             % (quoteattr(str(t.getId())), checked,
                self.htmlText(t.getCode()), self.htmlText(t.getTitle())))
     return "<br>".join(res)
示例#48
0
 def _getReasonParticipationHTML(self):
     regForm = self._conf.getRegistrationForm()
     if regForm.getReasonParticipationForm().isEnabled():
         if self.htmlText(
                 self._registrant.getReasonParticipation()) is not "":
             text = self.htmlText(self._registrant.getReasonParticipation())
         else:
             text = """<span class="not-selected">""" + _(
                 "No reason given") + """</span>"""
         return i18nformat("""
                 <tr>
                   <td class="regform-done-title">_("Reason for participation")</td>
                 </tr>
                 <tr>
                   <td>%s</td>
                 </tr>
                 """) % (text)
     return ""
示例#49
0
    def _getTabContent(self, params):
        p = conferences.WConferenceClone(self._conf)
        pars = { \
"cancelURL": urlHandlers.UHConfModifTools.getURL( self._conf ), \
"cloneOnce": urlHandlers.UHConfPerformCloneOnce.getURL( self._conf ), \
"cloneInterval": urlHandlers.UHConfPerformCloneInterval.getURL( self._conf ), \
"cloneday": urlHandlers.UHConfPerformCloneDays.getURL( self._conf ), \
"cloning" : urlHandlers.UHConfPerformCloning.getURL( self._conf ),
        "cloneOptions": i18nformat("""
    <li><input type="checkbox" name="cloneParticipants" id="cloneParticipants" value="1" >
        _("Participants")</li>
    <li><input type="checkbox" name="cloneAddedInfo" id="cloneAddedInfo" value="1" >
                          _("send email to the participants of the created event")</li>
    <li><input type="checkbox" name="cloneEvaluation" id="cloneEvaluation" value="1" >
        _("Evaluation")</li>
           """) }
        #let the plugins add their own elements
        self._notify('addCheckBox2CloneConf', pars)
        return p.getHTML(pars)
示例#50
0
 def _getWithdrawnInfoHTML(self):
     status = self._contrib.getCurrentStatus()
     if not isinstance(status, conference.ContribStatusWithdrawn):
         return ""
     comment = ""
     if status.getComment() != "":
         comment = """<br><i>%s""" % self.htmlText(status.getComment())
     d = self.htmlText(status.getDate().strftime("%Y-%b-%D %H:%M"))
     resp = ""
     if status.getResponsible() is not None:
         resp = "by %s" % self.htmlText(
             status.getResponsible().getFullName())
     html = i18nformat("""
  <tr>
     <td class="dataCaptionTD"><span class="dataCaptionFormat"> _("Withdrawal information")</span></td>
     <td bgcolor="white" class="blacktext"><b> _("WITHDRAWN")</b> _("on") %s %s%s</td>
 </tr>
 <tr>
     <td colspan="3" class="horizontalLine">&nbsp;</td>
 </tr>
         """) % (d, resp, comment)
     return html
示例#51
0
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars(self)
     conf = self._question.getEvaluation().getConference()
     #required
     if self._question.isRequired():
         vars["required"] = "* "
     else:
         vars["required"] = ""
     #questionValue, keyword, description, help
     vars["questionValue"]= self._question.getQuestionValue()
     vars["keyword"]      = self._question.getKeyword()
     vars["description"]  = self._question.getDescription()
     vars["help"]         = self._question.getHelp()
     #question input
     vars["input"] = self._question.displayHtml(disabled="disabled")
     #actionUrl for change position + edit question
     url = urlHandlers.UHConfModifEvaluationEditPerformChanges.getURL(conf)
     url.addParam("mode", Question._EDIT)
     vars["actionUrl"] = url
     #change question position select
     posName     = "posChange_%s"%(self._question.getPosition())
     nbQuestions = self._question.getEvaluation().getNbOfQuestions()
     questionPos = self._question.getPosition()
     vars["posChange"] = WUtils.createSelect(False, range(1,nbQuestions+1), questionPos, name=posName, onchange="this.form.submit()")
     #actual position
     vars["actualPosition"] = self._question.getPosition()
     #modifiy question
     url = urlHandlers.UHConfModifEvaluationEdit.getURL(conf, mode=Question._EDIT, questionPos=questionPos)
     vars["editQuestion"] = WUtils.createImgButton(url, "edit", "edit")
     #remove question
     url = urlHandlers.UHConfModifEvaluationEditPerformChanges.getURL(conf, mode=Question._REMOVE, questionPos=questionPos)
     vars["removeQuestionUrl"] = url
     vars["removeQuestionConfirm"] = i18nformat("""javascript:return confirm( _("Are you sure you want to remove this question?"));""")
     vars["removeQuestionInput"] = WUtils.createInput(type="image",
                                                      name="remove",
                                                      alt="remove",
                                                      src=Config.getInstance().getSystemIconURL("remove"))
     #return
     return vars
示例#52
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
     vars["title"] = minfo.getTitle()
     vars["organisation"] = minfo.getOrganisation()
     vars['supportEmail'] = Config.getInstance().getSupportEmail()
     vars['publicSupportEmail'] = Config.getInstance(
     ).getPublicSupportEmail()
     vars['noReplyEmail'] = Config.getInstance().getNoReplyEmail()
     vars["lang"] = minfo.getLang()
     vars["address"] = ""
     if minfo.getCity() != "":
         vars["address"] = minfo.getCity()
     if minfo.getCountry() != "":
         if vars["address"] != "":
             vars["address"] = "%s (%s)" % (vars["address"],
                                            minfo.getCountry())
         else:
             vars["address"] = "%s" % minfo.getCountry()
     try:
         vars["timezone"] = minfo.getTimezone()
     except:
         vars["timezone"] = 'UTC'
     vars["systemIconAdmins"] = Config.getInstance().getSystemIconURL(
         "admin")
     iconDisabled = str(
         Config.getInstance().getSystemIconURL("disabledSection"))
     iconEnabled = str(
         Config.getInstance().getSystemIconURL("enabledSection"))
     url = urlHandlers.UHAdminSwitchNewsActive.getURL()
     icon = iconEnabled if minfo.isNewsActive() else iconDisabled
     vars["features"] = i18nformat(
         """<a href="%s"><img src="%s" border="0" style="float:left; padding-right: 5px">_("News Pages")</a>"""
     ) % (url, icon)
     vars["administrators"] = fossilize(
         [u.as_avatar for u in User.find(is_admin=True)])
     return vars
示例#53
0
    def getVars(self):
        vars = WConferenceHeader.getVars(self)

        vars["categurl"] = self._conf.as_event.category.url
        view_options = [{
            'id': tid,
            'name': data['title']
        } for tid, data in sorted(theme_settings.get_themes_for(
            vars["type"]).viewitems(),
                                  key=lambda x: x[1]['title'])]

        vars["viewoptions"] = view_options
        vars["SelectedStyle"] = theme_settings.themes[
            vars['currentView']]['title']
        vars["displayURL"] = urlHandlers.UHConferenceDisplay.getURL(
            self._rh._conf)

        # Setting the buttons that will be displayed in the header menu
        vars["showFilterButton"] = True
        vars["showExportToPDF"] = True
        vars["showDLMaterial"] = True
        vars["showLayout"] = True

        # Dates Menu
        tz = DisplayTZ(self._aw, self._conf, useServerTZ=1).getDisplayTZ()
        sdate = self._conf.getStartDate().astimezone(timezone(tz))
        edate = self._conf.getEndDate().astimezone(timezone(tz))
        selected = ""
        if vars.has_key("selectedDate"):
            selectedDate = vars["selectedDate"]
            if selectedDate == "all" or selectedDate == "":
                selected = "selected"
        else:
            selectedDate = "all"
        dates = [
            i18nformat(
                """ <option value="all" %s>- -  _("all days") - -</option> """)
            % selected
        ]
        while sdate.date() <= edate.date():
            iso_date = sdate.date().isoformat()
            selected = 'selected' if selectedDate == iso_date else ''
            dates.append('<option value="{}" {}>{}</option>'.format(
                iso_date, selected, format_date(sdate)))
            sdate = sdate + timedelta(days=1)
        vars["datesMenu"] = "".join(dates)

        # Sessions Menu
        selected = ""
        if vars.has_key("selectedSession"):
            selectedSession = vars["selectedSession"]
            if selectedSession == "all" or selectedSession == "":
                selected = "selected"
        else:
            selectedSession = "all"
        sessions = [
            i18nformat(
                """ <option value="all" %s>- -  _("all sessions") - -</option> """
            ) % selected
        ]
        for session_ in self._conf.as_event.sessions:
            selected = "selected" if unicode(
                session_.friendly_id) == selectedSession else ''
            title = session_.title
            if len(title) > 60:
                title = title[0:40] + u"..."
            sessions.append(
                """ <option value="%s" %s>%s</option> """ %
                (session_.friendly_id, selected, title.encode('utf-8')))
        vars["sessionsMenu"] = "".join(sessions)

        # Handle hide/show contributions option
        hideContributions = None
        if len(self._conf.getSessionList()) != 0:
            if vars.has_key("detailLevel"):
                if vars["detailLevel"] == "session":
                    hideContributions = "checked"
                else:
                    hideContributions = ""
        vars["hideContributions"] = hideContributions

        urlCustPrint = urlHandlers.UHConferenceOtherViews.getURL(self._conf)
        urlCustPrint.addParam("showDate", vars.get("selectedDate") or "all")
        urlCustPrint.addParam("showSession",
                              vars.get("selectedSession") or "all")
        urlCustPrint.addParam("detailLevel", vars.get("detailLevel") or "all")
        urlCustPrint.addParam("fr", "no")
        urlCustPrint.addParam("view", vars["currentView"])
        vars["printURL"] = str(urlCustPrint)
        vars["pdfURL"] = url_for('timetable.export_pdf', self._conf)
        return vars
示例#54
0
    def getVars(self):
        vars = WConferenceHeader.getVars(self)
        vars["categurl"] = self._conf.as_event.category.url

        # Dates Menu
        tz = DisplayTZ(self._aw, self._conf, useServerTZ=1).getDisplayTZ()
        sdate = self._conf.getStartDate().astimezone(timezone(tz))
        edate = self._conf.getEndDate().astimezone(timezone(tz))
        dates = []
        if sdate.strftime("%Y-%m-%d") != edate.strftime("%Y-%m-%d"):
            selected = ""
            if vars.has_key("selectedDate"):
                selectedDate = vars["selectedDate"]
                if selectedDate == "all" or selectedDate == "":
                    selected = "selected"
            else:
                selectedDate = "all"
            dates = [
                i18nformat(
                    """ <select name="showDate" onChange="document.forms[0].submit();" style="font-size:8pt;"><option value="all" %s>- -  _("all days") - -</option> """
                ) % selected
            ]
            while sdate.strftime("%Y-%m-%d") <= edate.strftime("%Y-%m-%d"):
                selected = ""
                if selectedDate == sdate.strftime("%d-%B-%Y"):
                    selected = "selected"
                d = sdate.strftime("%d-%B-%Y")
                dates.append(""" <option value="%s" %s>%s</option> """ %
                             (d, selected, d))
                sdate = sdate + timedelta(days=1)
            dates.append("</select>")
        else:
            dates.append(
                """<input type="hidden" name="showDate" value="all">""")
        # Sessions Menu
        sessions = []
        if len(self._conf.getSessionList()) != 0:
            selected = ""
            if vars.has_key("selectedSession"):
                selectedSession = vars["selectedSession"]
                if selectedSession == "all" or selectedSession == "":
                    selected = "selected"
            else:
                selectedSession = "all"
            sessions = [
                i18nformat(
                    """ <select name="showSession" onChange="document.forms[0].submit();" style="font-size:8pt;"><option value="all" %s>- -  _("all sessions") - -</option> """
                ) % selected
            ]
            for session in self._conf.getSessionList():
                selected = ""
                sid = session.friendly_id
                if sid == selectedSession:
                    selected = "selected"
                sessions.append(""" <option value="%s" %s>%s</option> """ %
                                (sid, selected, session.title))
            sessions.append("</select>")
        else:
            sessions.append(
                """<input type="hidden" name="showSession" value="all">""")
        # Handle hide/show contributions option
        hideContributions = None
        if len(self._conf.getSessionList()) != 0:
            if vars.has_key("detailLevel"):
                if vars["detailLevel"] == "session":
                    hideContributions = "checked"
                else:
                    hideContributions = ""
        # Save to session
        vars["hideContributions"] = hideContributions

        urlCustPrint = urlHandlers.UHConferenceOtherViews.getURL(self._conf)
        urlCustPrint.addParam("showDate", vars.get("selectedDate") or "all")
        urlCustPrint.addParam("showSession",
                              vars.get("selectedSession") or "all")
        urlCustPrint.addParam("fr", "no")
        urlCustPrint.addParam("view", vars["currentView"])
        vars["printURL"] = str(urlCustPrint)

        vars["printIMG"] = quoteattr(
            str(Config.getInstance().getSystemIconURL("printer")))
        vars["pdfURL"] = quoteattr(url_for('timetable.export_pdf', self._conf))
        vars["pdfIMG"] = quoteattr(
            str(Config.getInstance().getSystemIconURL("pdf")))
        vars["zipIMG"] = quoteattr(
            str(Config.getInstance().getSystemIconURL("smallzip")))

        return vars
示例#55
0
 def getMsg(self):
     primary_authors = []
     for auth in self._abstract.getPrimaryAuthorList():
         primary_authors.append(
             """%s (%s) <%s>""" %
             (auth.getFullName(), auth.getAffiliation(), auth.getEmail()))
     co_authors = []
     for auth in self._abstract.getCoAuthorList():
         email = ""
         if auth.getEmail() != "":
             email = " <%s>" % auth.getEmail()
         co_authors.append(
             """%s (%s)%s""" %
             (auth.getFullName(), auth.getAffiliation(), email))
     speakers = []
     for spk in self._abstract.getSpeakerList():
         speakers.append(spk.getFullName())
     tracks = []
     for track in self._abstract.getTrackListSorted():
         tracks.append("""%s""" % track.getTitle())
     msg = [
         i18nformat("""_("Dear") %s,""") %
         self._abstract.getSubmitter().getStraightFullName()
     ]
     msg.append("")
     msg.append(
         _("The submission of your abstract has been successfully processed."
           ))
     msg.append("")
     msg.append(
         i18nformat("""_("Abstract submitted"):\n<%s>.""") %
         urlHandlers.UHUserAbstracts.getURL(self._conf))
     msg.append("")
     msg.append(
         i18nformat("""_("Status of your abstract"):\n<%s>.""") %
         urlHandlers.UHAbstractDisplay.getURL(self._abstract))
     msg.append("")
     msg.append(
         i18nformat(
             """_("See below a detailed summary of your submitted abstract"):"""
         ))
     msg.append("")
     msg.append(
         i18nformat("""_("Conference"): %s""") % self._conf.getTitle())
     msg.append("")
     msg.append(
         i18nformat("""_("Submitted by"): %s""") %
         self._abstract.getSubmitter().getFullName())
     msg.append("")
     msg.append(
         i18nformat("""_("Submitted on"): %s""") %
         self._abstract.getSubmissionDate().strftime("%d %B %Y %H:%M"))
     msg.append("")
     msg.append(
         i18nformat("""_("Title"): %s""") % self._abstract.getTitle())
     msg.append("")
     for f in self._conf.getAbstractMgr().getAbstractFieldsMgr().getFields(
     ):
         msg.append(f.getCaption())
         msg.append(str(self._abstract.getField(f.getId())))
         msg.append("")
     msg.append(i18nformat("""_("Primary Authors"):"""))
     msg += primary_authors
     msg.append("")
     msg.append(i18nformat("""_("Co-authors"):"""))
     msg += co_authors
     msg.append("")
     msg.append(i18nformat("""_("Abstract presenters"):"""))
     msg += speakers
     msg.append("")
     msg.append(i18nformat("""_("Track classification"):"""))
     msg += tracks
     msg.append("")
     ctype = i18nformat("""--_("not specified")--""")
     if self._abstract.getContribType() is not None:
         ctype = self._abstract.getContribType().name
     msg.append(i18nformat("""_("Presentation type"): %s""") % ctype)
     msg.append("")
     msg.append(
         i18nformat("""_("Comments"): %s""") % self._abstract.getComments())
     msg.append("")
     return "\n".join(map(to_unicode, msg))
示例#56
0
 def getValue(cls, abstract):
     status = abstract.getCurrentStatus()
     if isinstance(status, review.AbstractStatusAccepted):
         if status.getType() is not None:
             return status.getType().name.encode('utf-8')
     return i18nformat("""--_("not specified")--""")
示例#57
0
    def getVars( self ):
        vars = wcomponents.WTemplated.getVars(self)
        nbQuestions = self._evaluation.getNbOfQuestions()
        #actionUrl
        url = urlHandlers.UHConfModifEvaluationEditPerformChanges.getURL(self._conf, mode=self._mode)

        ###########
        #Edit mode#
        ###########
        if self._mode == Question._EDIT:
            url.addParam("questionPos", self._question.getPosition())
            if self._question.isRequired():
                vars["required"] = 'checked="checked"'
            else:
                vars["required"] = ""
            vars["questionValue"]= self._question.getQuestionValue()
            vars["keyword"]      = self._question.getKeyword()
            vars["description"]  = self._question.getDescription()
            vars["help"]         = self._question.getHelp()
            vars["position"]     = WUtils.createSelect(False,
                                                       range(1,nbQuestions+1),
                                                       self._question.getPosition(),
                                                       name="newPos")
            vars["saveButtonText"] = _("modify question")
            vars["choiceItems"]  = self._choiceItems(self._question);
            if self._questionType in Question._BOX_SUBTYPES:
                defaultAnswer    = self._question.getDefaultAnswer()
            else: #Unused, but : Better to prevent than to heal!
                defaultAnswer    = ""
            url.addParam("questionPos",self._question.getPosition())

        ##########
        #Add mode#
        ##########
        else:
            url.addParam("type", self._questionType)
            vars["required"]     = ""
            vars["questionValue"]= ""
            vars["keyword"]      = ""
            vars["description"]  = ""
            vars["help"]         = ""
            vars["position"]     = WUtils.createSelect(False,
                                                       range(1,nbQuestions+2),
                                                       nbQuestions+1,
                                                       name="newPos")
            vars["saveButtonText"]= _("add question")
            vars["choiceItems"]   = self._choiceItems();
            defaultAnswer         = ""

        #######
        #Other#
        #######
        #defaultAnswer
        if self._questionType in Question._BOX_SUBTYPES:
            vars["defaultAnswer"] = i18nformat("""<tr>
                    <td class="titleCellTD"><span class="titleCellFormat">  _("Default answer")</span></td>
                    <td class="inputCelTD"><input type="text" name="defaultAnswer" value="%s"/></td>
                </tr>""")%(defaultAnswer)
        else:
            vars["defaultAnswer"] = ""
        #javascript for choiceItems
        vars["choiceItemsNb"] = self._CHOICEITEMS_NB_MIN
        vars["javascriptChoiceItemsAddImg"] = WUtils.createImg("add", _("add one more choice item")).replace('"',"'")
        vars["javascriptChoiceItemsRemoveImg"] = WUtils.createImg("remove", _("remove one choice item")).replace('"',"'")
        if self._questionType == Question._CHECKBOX:
            vars["javascriptChoiceItemsType"] = "checkbox"
        elif self._questionType in [Question._SELECT, Question._RADIO]:
            vars["javascriptChoiceItemsType"] = "radio"
        else:
            vars["javascriptChoiceItemsType"] = ""
        #error
        if self._error!="":
            vars["error"] = "%s<br/><br/><br/>"%(self._error)
        else:
            vars["error"] = ""
        #actionUrl
        vars["actionUrl"] = url
        return vars
示例#58
0
 def getVars( self ):
     from MaKaC.registration import Notification
     vars = wcomponents.WTemplated.getVars(self)
     evaluation = self._conf.getEvaluation()
     evaluationStartNotification = evaluation.getNotification(Evaluation._EVALUATION_START)
     newSubmissionNotification   = evaluation.getNotification(Evaluation._NEW_SUBMISSION)
     vars["setStatusURL"]=urlHandlers.UHConfModifEvaluationSetupChangeStatus.getURL(self._conf)
     vars["dataModificationURL"]=urlHandlers.UHConfModifEvaluationDataModif.getURL(self._conf)
     vars["specialActionURL"] = urlHandlers.UHConfModifEvaluationSetupSpecialAction.getURL(self._conf)
     vars["evaluation"] = evaluation
     vars["submissionsLimit"] = i18nformat("""--_("No limit")--""")
     if evaluation.getSubmissionsLimit() > 0:
         vars["submissionsLimit"] = evaluation.getSubmissionsLimit()
     vars["title"] = evaluation.getTitle()
     if evaluation.isMandatoryParticipant():
         vars["mandatoryParticipant"] = _("Yes")
     else:
         vars["mandatoryParticipant"] = _("No")
     if evaluation.isMandatoryAccount():
         vars["mandatoryAccount"] = _("Yes")
     else:
         vars["mandatoryAccount"] = _("No")
     if evaluation.isAnonymous() :
         vars["anonymous"] = _("Yes")
     else:
         vars["anonymous"] = _("No")
     if evaluationStartNotification == None :
         vars["evaluationStartNotifyTo"] = ""
         vars["evaluationStartNotifyCc"] = ""
     else :
         vars["evaluationStartNotifyTo"] = ", ".join(evaluationStartNotification.getToList())
         vars["evaluationStartNotifyCc"] = ", ".join(evaluationStartNotification.getCCList())
     if newSubmissionNotification == None :
         vars["newSubmissionNotifyTo"] = ""
         vars["newSubmissionNotifyCc"] = ""
     else :
         vars["newSubmissionNotifyTo"]   = ", ".join(newSubmissionNotification.getToList())
         vars["newSubmissionNotifyCc"]   = ", ".join(newSubmissionNotification.getCCList())
     ##############
     #if activated#
     ##############
     if evaluation.isVisible():
         vars["changeTo"] = "False"
         vars["status"] = _("VISIBLE")
         if evaluation.getNbOfQuestions()<1 :
             vars["statusMoreInfo"] = i18nformat("""<span style="color: #E25300">(_("not ready"))</span>""")
         elif nowutc() < evaluation.getStartDate() :
             vars["statusMoreInfo"] = i18nformat("""<span style="color: #E25300">(_("not open yet"))</span>""")
         elif nowutc() > evaluation.getEndDate() :
             vars["statusMoreInfo"] = i18nformat("""<span style="color: #E25300">(_("closed"))</span>""")
         else:
             vars["statusMoreInfo"] = i18nformat("""<span style="color: green">(_("running"))</span>""")
         vars["changeStatus"] = _("HIDE")
         if evaluation.getStartDate() is None:
             vars["startDate"] = ""
         else:
             vars["startDate"] = evaluation.getStartDate().strftime("%A %d %B %Y")
         if evaluation.getEndDate() is None:
             vars["endDate"] = ""
         else:
             vars["endDate"] = evaluation.getEndDate().strftime("%A %d %B %Y")
     ################
     #if deactivated#
     ################
     else:
         vars["changeTo"] = "True"
         vars["status"] = _("HIDDEN")
         vars["statusMoreInfo"] = ""
         vars["changeStatus"] = _("SHOW")
         vars["startDate"] = ""
         vars["endDate"] = ""
     return vars
示例#59
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     url = vars["postURL"]
     if vars.get("sortBy", "").strip() != "":
         url.addParam("sortBy", vars["sortBy"])
     vars["postURL"] = quoteattr(str(url))
     vars["title"] = self.htmlText(self._contrib.getTitle())
     defaultDefinePlace = defaultDefineRoom = ""
     defaultInheritPlace = defaultInheritRoom = "checked"
     locationName, locationAddress, roomName = "", "", ""
     if self._contrib.getOwnLocation():
         defaultDefinePlace, defaultInheritPlace = "checked", ""
         locationName = self._contrib.getLocation().getName()
         locationAddress = self._contrib.getLocation().getAddress()
     if self._contrib.getOwnRoom():
         defaultDefineRoom, defaultInheritRoom = "checked", ""
         roomName = self._contrib.getRoom().getName()
     vars["defaultInheritPlace"] = defaultInheritPlace
     vars["defaultDefinePlace"] = defaultDefinePlace
     vars["confPlace"] = ""
     confLocation = self._contrib.getOwner().getLocation()
     if self._contrib.isScheduled():
         confLocation = self._contrib.getSchEntry().getSchedule().getOwner(
         ).getLocation()
         sDate = self._contrib.getAdjustedStartDate()
         vars["sYear"] = quoteattr(str(sDate.year))
         vars["sMonth"] = quoteattr(str(sDate.month))
         vars["sDay"] = quoteattr(str(sDate.day))
         vars["sHour"] = quoteattr(str(sDate.hour))
         vars["sMinute"] = quoteattr(str(sDate.minute))
         vars["startDate"] = self._contrib.getAdjustedStartDate().strftime(
             "%Y-%b-%d %H:%M")
     else:
         vars["sYear"] = quoteattr(str(""))
         vars["sMonth"] = quoteattr(str(""))
         vars["sDay"] = quoteattr(str(""))
         vars["sHour"] = quoteattr(str(""))
         vars["sMinute"] = quoteattr(str(""))
         vars["startDate"] = i18nformat("""--_("not scheduled")--""")
     vars["durHours"] = quoteattr(
         str((datetime(1900, 1, 1) + self._contrib.getDuration()).hour))
     vars["durMins"] = quoteattr(
         str((datetime(1900, 1, 1) + self._contrib.getDuration()).minute))
     if confLocation:
         vars["confPlace"] = confLocation.getName()
     vars["locationName"] = locationName
     vars["locationAddress"] = locationAddress
     vars["defaultInheritRoom"] = defaultInheritRoom
     vars["defaultDefineRoom"] = defaultDefineRoom
     vars["confRoom"] = ""
     confRoom = self._contrib.getOwner().getRoom()
     if self._contrib.isScheduled():
         confRoom = self._contrib.getSchEntry().getSchedule().getOwner(
         ).getRoom()
     if confRoom:
         vars["confRoom"] = confRoom.getName()
     vars["roomName"] = roomName
     vars["parentType"] = "conference"
     if self._contrib.getSession() is not None:
         vars["parentType"] = "session"
         if self._contrib.isScheduled():
             vars["parentType"] = "session slot"
     vars["boardNumber"] = quoteattr(str(self._contrib.getBoardNumber()))
     return vars
示例#60
0
 def getValue(cls, abstract):
     status = abstract.getCurrentStatus()
     if isinstance(status, review.AbstractStatusAccepted):
         if status.getTrack() is not None:
             return status.getTrack().getTitle()
     return i18nformat("""--_("not specified")--""")