Merge pull request #2234 from takluyver/i2204

Show server root directory in move dialog
Min RK 9 years ago committed by GitHub
commit 420715e3e5

@ -203,6 +203,12 @@ class NotebookWebApplication(web.Application):
warnings.warn("The `ignore_minified_js` flag is deprecated and will be removed in Notebook 6.0", DeprecationWarning)
now = utcnow()
root_dir = contents_manager.root_dir
home = os.path.expanduser('~')
if root_dir.startswith(home + os.path.sep):
# collapse $HOME to ~
root_dir = '~' + root_dir[len(home):]
settings = dict(
# basics
@ -256,6 +262,7 @@ class NotebookWebApplication(web.Application):
mathjax_config=jupyter_app.mathjax_config,
config=jupyter_app.config,
config_dir=jupyter_app.config_dir,
server_root_dir=root_dir,
jinja2_env=env,
terminals_available=False, # Set later if terminals are available
)

@ -50,6 +50,8 @@ class ContentsManager(LoggingConfigurable):
indicating the root path.
"""
root_dir = Unicode('/', config=True)
notary = Instance(sign.NotebookNotary)
def _notary_default(self):

@ -900,7 +900,14 @@ define([
.text('Enter new destination directory path for '+ num_items + ' items:')
).append(
$("<br/>")
).append(input);
).append(
$("<div/>").append(
// $("<i/>").addClass("fa fa-folder").addClass("server-root")
$("<span/>").text(utils.get_body_data("serverRoot")).addClass("server-root")
).append(
input.addClass("path-input")
).addClass("move-path")
);
var d = dialog.modal({
title : "Move "+ num_items + " Items",
body : dialog_body,

@ -8,6 +8,7 @@
data-base-url="{{base_url | urlencode}}"
data-notebook-path="{{notebook_path | urlencode}}"
data-terminals-available="{{terminals_available}}"
data-server-root="{{server_root}}"
{% endblock %}

@ -4,6 +4,7 @@
# Distributed under the terms of the Modified BSD License.
from tornado import web
import os
from ..base.handlers import IPythonHandler, path_regex
from ..utils import url_path_join, url_escape
@ -49,6 +50,7 @@ class TreeHandler(IPythonHandler):
notebook_path=path,
breadcrumbs=breadcrumbs,
terminals_available=self.settings['terminals_available'],
server_root=self.settings['server_root_dir'],
))
elif cm.file_exists(path):
# it's not a directory, we have redirecting to do

Loading…
Cancel
Save