begin adding support for a base config parameter

This commit is contained in:
Damien Churchill 2010-02-25 19:43:01 +00:00
parent e5c734fb05
commit a69ed83e25
2 changed files with 7 additions and 7 deletions

View File

@ -3,23 +3,23 @@
<head>
<title>Deluge: Web UI ${version}</title>
<link rel="shortcut icon" href="/icons/deluge.png" type="image/png" />
<link rel="icon" href="/icons/deluge.png" type="image/png" />
<link rel="shortcut icon" href="${base}icons/deluge.png" type="image/png" />
<link rel="icon" href="${base}icons/deluge.png" type="image/png" />
<!-- Stylesheets -->
% for stylesheet in stylesheets:
<link rel="stylesheet" type="text/css" href="${stylesheet}" />
<link rel="stylesheet" type="text/css" href="${base}${stylesheet}" />
% endfor
<!-- Javascript -->
% for script in scripts:
<script type="text/javascript" src="${script}"></script>
<script type="text/javascript" src="${base}${script}"></script>
% endfor
<script type="text/javascript">
Deluge.debug = ${str(debug).lower()};
</script>
</head>
<body>
<div style="background-image: url('/themes/default/tree/loading.gif');"></div>
<div style="background-image: url('${base}themes/default/tree/loading.gif');"></div>
</body>
</html>

View File

@ -450,7 +450,6 @@ class TopLevel(resource.Resource):
return resource.Resource.getChild(self, path, request)
def render(self, request):
debug = False
if 'debug' in request.args:
debug_arg = request.args.get('debug')[-1]
@ -474,9 +473,10 @@ class TopLevel(resource.Resource):
else:
scripts = self.scripts[:]
base = request.args.get('base', [''])[-1]
template = Template(filename=rpath("index.html"))
request.setHeader("content-type", "text/html; charset=utf-8")
return template.render(scripts=scripts, stylesheets=self.stylesheets, debug=debug)
return template.render(scripts=scripts, stylesheets=self.stylesheets, debug=debug, base=base)
class ServerContextFactory: