##// END OF EJS Templates
add disabling, align badges and improve look...
add disabling, align badges and improve look - Disable checkboxes when there is nothing to select - right-alignment of badges in the menu - HTML and CSS improvements for better look (not final) Internal changes: - Avoid use of `stopPropagation()`! Instead, replace bootstap's dropdown hide/show logic with suitable sticky-dropdown behaviour. - Avoid selecting the `..` parent folder

File last commit:

r19074:a613289c
r20345:f41f7f1d
Show More
handlers.py
28 lines | 878 B | text/x-python | PythonLexer
#encoding: utf-8
"""Tornado handlers for the terminal emulator."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import web
from ..base.handlers import IPythonHandler, path_regex
from ..utils import url_escape
class EditorHandler(IPythonHandler):
"""Render the text editor interface."""
@web.authenticated
def get(self, path):
path = path.strip('/')
if not self.contents_manager.file_exists(path):
raise web.HTTPError(404, u'File does not exist: %s' % path)
basename = path.rsplit('/', 1)[-1]
self.write(self.render_template('edit.html',
file_path=url_escape(path),
basename=basename,
page_title=basename + " (editing)",
)
)
default_handlers = [
(r"/edit%s" % path_regex, EditorHandler),
]