Changeset c5be05


Ignore:
Timestamp:
07/22/2008 06:11:49 PM (16 years ago)
Author:
Martijn Voncken <mvoncken@gmail.com>
Branches:
2.0.x, develop, extjs4-port, master
Children:
498fba
Parents:
f42f93
Message:

/template/render/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/webui/pages.py

    rf42f93 rc5be05  
    391391route("/template/static/(.*)", template_static)
    392392
     393class render_static:
     394    "render anything in template_dir"
     395    @deco.deluge_page
     396    def GET(self, name):
     397        filename =  os.path.join(os.path.dirname(__file__),
     398                'templates/%s/static/%s' % (config.get('template'), name))
     399        log.debug("render-static:%s" % filename)
     400        return web.template.Template(open(filename).read(), filename=filename)()
     401route("/template/render/(.*)", render_static)
     402
     403class template_style:
     404    def GET(self):
     405        web.header("Content-Type", "text/css")
     406        style = Storage()
     407        print render.template_style(style)
     408route("/template_style.css", template_style)
     409
    393410class robots:
    394411    def GET(self):
     
    397414        print "User-agent: *\nDisallow:/\n"
    398415route("/robots.txt", robots)
    399 
    400 class template_style:
    401     def GET(self):
    402         web.header("Content-Type", "text/css")
    403         style = Storage()
    404         print render.template_style(style)
    405 route("/template_style.css", template_style)
    406416
    407417class pixmaps:
Note: See TracChangeset for help on using the changeset viewer.