|
|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
|
|
|
|
|
from tornado import web
|
|
|
|
|
from ..base.handlers import IPythonHandler, path_regex
|
|
|
|
|
from ..utils import url_escape
|
|
|
|
|
from ..utils import url_escape, url_path_join
|
|
|
|
|
|
|
|
|
|
class ViewHandler(IPythonHandler):
|
|
|
|
|
"""Render HTML files within an iframe."""
|
|
|
|
|
@ -17,8 +17,9 @@ class ViewHandler(IPythonHandler):
|
|
|
|
|
raise web.HTTPError(404, u'File does not exist: %s' % path)
|
|
|
|
|
|
|
|
|
|
basename = path.rsplit('/', 1)[-1]
|
|
|
|
|
file_url = url_path_join(self.base_url, 'files', path)
|
|
|
|
|
self.write(
|
|
|
|
|
self.render_template('view.html', file_path=url_escape(path), page_title=basename)
|
|
|
|
|
self.render_template('view.html', file_url=file_url, page_title=basename)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
default_handlers = [
|
|
|
|
|
|