Beispiel #1
0
 def _getCommentsHTML(self, commentEditURLGen, commentRemURLGen):
     res = []
     commentList = self._abstract.getIntCommentList()
     for c in commentList:
         mailtoSubject = "[Indico] Abstract %s: %s" % (
             self._abstract.getId(), self._abstract.getTitle())
         mailtoURL = URL("mailto:%s" % c.getResponsible().getEmail())
         mailtoURL.addParam("subject", mailtoSubject)
         responsible = """<a href=%s>%s</a>""" % (quoteattr(
             str(mailtoURL)), self.htmlText(
                 c.getResponsible().getFullName()))
         date = self.htmlText(
             c.getCreationDate().strftime("%Y-%m-%d %H:%M"))
         buttonMod, buttonRem = "", ""
         if self._aw.getUser() == c.getResponsible():
             buttonMod = i18nformat("""
                 <form action=%s method="POST">
                 <td valign="bottom">
                     <input type="submit" class="btn" value="_("modify")">
                 </td>
                 </form>
                     """) % quoteattr(str(commentEditURLGen(c)))
             buttonRem = i18nformat("""
                 <form action=%s method="POST">
                 <td valign="bottom">
                     <input type="submit" class="btn" value="_("remove")">
                 </td>
                 </form>
                     """) % quoteattr(str(commentRemURLGen(c)))
         res.append(
             """
             <tr>
                 <td bgcolor="white" style="border-top:1px solid #777777;border-bottom:1px solid #777777;">
                     <table>
                         <tr>
                             <td width="100%%">%s on %s</td>
                         </tr>
                         <tr>
                             <td>%s</td>
                             %s
                             %s
                         </tr>
                     </table>
                 </td>
             </tr>""" %
             (responsible, date, c.getContent(), buttonMod, buttonRem))
     if res == []:
         res.append(
             i18nformat(
                 """<tr><td align=\"center\" style=\"color:black\"><br>--_("no internal comments")--<br><br></td></tr>"""
             ))
     return "".join(res)
Beispiel #2
0
def getRequestURL(action, arguments = {}):

    actionURL = getActionURL(action)

    indicoID = getEVOOptionValueByName("indicoUserID")
    indicoPassword = getEVOOptionValueByName("indicoPassword")
    expirationTime = int(datetimeToUnixTime(nowutc() + timedelta(minutes = getEVOOptionValueByName('expirationTime'))) * 1000)

    arguments["from"] = createLoginKey(indicoID, indicoPassword, expirationTime)

    url = URL(actionURL)
    url.setParams(arguments)

    return url
Beispiel #3
0
def getRequestURL(action, arguments={}):

    actionURL = getActionURL(action)

    indicoID = getEVOOptionValueByName("indicoUserID")
    indicoPassword = getEVOOptionValueByName("indicoPassword")
    expirationTime = int(
        datetimeToUnixTime(nowutc() + timedelta(
            minutes=getEVOOptionValueByName('expirationTime'))) * 1000)

    arguments["from"] = createLoginKey(indicoID, indicoPassword,
                                       expirationTime)

    url = URL(actionURL)
    url.setParams(arguments)

    return url
Beispiel #4
0
 def _getCommentsHTML(self,commentEditURLGen,commentRemURLGen):
     res=[]
     commentList = self._abstract.getIntCommentList()
     for c in commentList:
         mailtoSubject="[Indico] Abstract %s: %s"%(self._abstract.getId(), self._abstract.getTitle())
         mailtoURL=URL("mailto:%s"%c.getResponsible().getEmail())
         mailtoURL.addParam("subject", mailtoSubject)
         responsible="""<a href=%s>%s</a>"""%(quoteattr(str(mailtoURL)),self.htmlText(c.getResponsible().getFullName()))
         date=self.htmlText(c.getCreationDate().strftime("%Y-%m-%d %H:%M"))
         buttonMod,buttonRem="",""
         if self._aw.getUser()==c.getResponsible():
             buttonMod= i18nformat("""
                 <form action=%s method="POST">
                 <td valign="bottom">
                     <input type="submit" class="btn" value="_("modify")">
                 </td>
                 </form>
                     """)%quoteattr(str(commentEditURLGen(c)))
             buttonRem= i18nformat("""
                 <form action=%s method="POST">
                 <td valign="bottom">
                     <input type="submit" class="btn" value="_("remove")">
                 </td>
                 </form>
                     """)%quoteattr(str(commentRemURLGen(c)))
         res.append("""
             <tr>
                 <td bgcolor="white" style="border-top:1px solid #777777;border-bottom:1px solid #777777;">
                     <table>
                         <tr>
                             <td width="100%%">%s on %s</td>
                         </tr>
                         <tr>
                             <td>%s</td>
                             %s
                             %s
                         </tr>
                     </table>
                 </td>
             </tr>"""%(responsible,date,c.getContent(),buttonMod,buttonRem))
     if res == []:
         res.append( i18nformat("""<tr><td align=\"center\" style=\"color:black\"><br>--_("no internal comments")--<br><br></td></tr>"""))
     return "".join(res)
Beispiel #5
0
    def _getURL(cls, _force_secure=None, **params):
        """ Gives the full URL for the corresponding request handler.

            Parameters:
                _force_secure - (bool) create a secure url if possible
                params - (dict) parameters to be added to the URL.
        """

        secure = cls._want_secure_url(_force_secure)
        if not cls._endpoint:
            # Legacy UH containing a relativeURL
            cfg = Config.getInstance()
            baseURL = cfg.getBaseSecureURL() if secure else cfg.getBaseURL()
            url = URL("%s/%s" % (baseURL, cls.getRelativeURL()), **params)
        else:
            assert not cls.getRelativeURL()
            url = EndpointURL(cls._endpoint, secure, params)

        if cls._fragment:
            url.fragment = cls._fragment

        return url
Beispiel #6
0
    def _getURL(cls, _force_secure=None, **params):
        """ Gives the full URL for the corresponding request handler.

            Parameters:
                _force_secure - (bool) create a secure url if possible
                params - (dict) parameters to be added to the URL.
        """

        secure = cls._want_secure_url(_force_secure)
        if not cls._endpoint:
            # Legacy UH containing a relativeURL
            cfg = Config.getInstance()
            baseURL = cfg.getBaseSecureURL() if secure else cfg.getBaseURL()
            url = URL('%s/%s' % (baseURL, cls.getRelativeURL()), **params)
        else:
            assert not cls.getRelativeURL()
            url = EndpointURL(cls._endpoint, secure, params)

        if cls._fragment:
            url.fragment = cls._fragment

        return url
Beispiel #7
0
    def getURL(cls, target=None, _ignore_static=False, **params):
        """Gives the full URL for the corresponding request handler. In case
            the target parameter is specified it will append to the URL the
            the necessary parameters to make the target be specified in the url.

            Parameters:
                target - (Locable) Target object which must be uniquely
                    specified in the URL so the destination request handler
                    is able to retrieve it.
                params - (Dict) parameters to be added to the URL.
        """
        if not _ignore_static and g.get('static_site'):
            return URL(cls.getStaticURL(target, **params))
        return cls._getURL(**cls._getParams(target, params))
Beispiel #8
0
 def getURL(cls, target):
     if g.get('static_site'):
         return URL(UHConferenceDisplay.getStaticURL(target))
     return super(UHConferenceOverview, cls).getURL(target)