Esempio n. 1
0
    def GET(self):
        uri = URIRef(web.input()['uri'])
        r = MediaResource(graph, uri)
        size = r.getSize(sizes["screen"])

        try:
            created = photoCreated(graph, uri)
            prettyDate = created.date().isoformat()
        except ValueError:
            prettyDate = "(unknown date)"
            
        tmpl = loader.load("sharesingle.html")
        stream = tmpl.generate(
            title="photo",
            prettyDate=prettyDate,
            bestJqueryLink=networking.jqueryLink(
                web.ctx.environ.get('HTTP_X_FORWARDED_FOR', '')),
            featuredImg=Markup('<img src="%s" width="%s" height="%s"/>' %
                               (localSite(uri)+"?size=screen",
                                size[0], size[1])),
            loginWidget=Markup(networking.getLoginBarSync(
                web.ctx.environ.get('HTTP_COOKIE', ''))),
            actionsAllowed=[],
            otherSizeLinks=[],
            link="l",
            allowedToWriteMeta=False,
            pageJson="",
            )
        return (''.join(serializer(stream))).encode('utf8')
Esempio n. 2
0
 def bestJqueryLink(self):
     return networking.jqueryLink(self.forwardedFor)
Esempio n. 3
0
 def bestJqueryLink(self):
     return networking.jqueryLink(self.forwardedFor)