def render_commonhead(self, ctx, data): # we do not want to blindly append these things to the tag since user- # provided items in the header should have access to this environment, # in particular to jquery; thus, this stuff must be as early as possible. originalChildren = ctx.tag.children[:] ctx.tag.clear() res = ctx.tag[ T.meta(**{"charset": "utf-8"}), T.link(rel="icon", type="image/png", href=base.makeSitePath("/static/img/favicon.png")), T.link(rel="stylesheet", href=base.makeSitePath("/static/css/style.css"), type="text/css"), T.link(rel="stylesheet", href=base.makeSitePath("/formal.css"), type="text/css"), T.link(rel="stylesheet", href=base.makeSitePath("/static/css/gavo_dc.css"), type="text/css"), T.script(src=base.makeSitePath("/static/js/jquery-gavo.js"), type="text/javascript"), T.script(type='text/javascript', src=base.makeSitePath('static/js/formal' + JSEXT)), T.script(type="text/javascript", src=base.makeSitePath("/static/js/gavo" + JSEXT)), T.script(type="text/javascript", src=base.makeSitePath("/static/js/script.js")), originalChildren, ] if base.getConfig("web", "operatorCSS"): res[T.link(rel="stylesheet", type="text/css", href=base.getConfig("web", "operatorCSS"))] return res
def _addVanityRedirect(cls, src, dest, options): """a helper for parseVanityMap. """ if '!redirect' in options: cls.addRedirect(src, base.makeSitePath(dest)) else: cls.addMapping(src, dest.split("/"))
def __init__(self, dest, hint=None): self.rawDest = dest dest = str(dest) if not dest.startswith("http"): dest = base.getConfig("web", "serverURL")+base.makeSitePath(dest) self.dest = dest Error.__init__(self, "This is supposed to redirect to %s"%dest, hint=hint)
def makeProductLink(key, withHost=True): """returns the URL at which a product can be retrieved. key can be an accref string or an RAccref """ url = base.makeSitePath("/getproduct/%s" % RAccref.fromString(key)) if withHost: url = urlparse.urljoin(base.getConfig("web", "serverURL"), url) return url
def _getFormLinks(self): """returns stan for widgets building GET-type strings for the current form content. """ return T.div( class_="formLinks" )[T.a(href="", class_="resultlink", onmouseover="this.href=makeResultLink(getEnclosingForm(this))", render=T.directive("iflinkable"))["[Result link]"], " ", T.a(href="", class_="resultlink", onmouseover="this.href=makeBookmarkLink(getEnclosingForm(this))" )[T.img(src=base.makeSitePath("/static/img/bookmark.png"), class_="silentlink", title="Link to this form", alt="[bookmark]")], ]
def data_serviceURL(self, type): # for RD's that's simply the rdinfo. return lambda ctx, data: base.makeSitePath("/browse/%s" % self.rd. sourceId)
class StringExpressionField(StringFieldWithBlurb): additionalMaterial = T.a(href=base.makeSitePath( "/static/help_vizier.shtml#string"))[ "[?char expr.]"]
class DateExpressionField(StringFieldWithBlurb): additionalMaterial = T.a(href=base.makeSitePath( "/static/help_vizier.shtml#dates"))[ "[?date expr.]"]
class NumericExpressionField(StringFieldWithBlurb): additionalMaterial = T.a(href=base.makeSitePath( "/static/help_vizier.shtml#floats"))[ "[?num. expr.]"]
def munge(key): if tag.attributes.has_key(key): tag.attributes[key] = base.makeSitePath(tag.attributes[key])