Permalink
Browse files

Adding data-project to the body data attribs.

  • Loading branch information...
1 parent e64adb9 commit a676e3d267260cb431d95b210ef409b8652ea5c8 @ellisonbg ellisonbg committed with Sep 6, 2011
View
25 IPython/frontend/html/notebook/handlers.py
@@ -61,8 +61,10 @@ class NBBrowserHandler(AuthenticatedHandler):
def get(self):
nbm = self.application.notebook_manager
project = nbm.notebook_dir
- self.render('nbbrowser.html', project=project,
- base_project_url=u'/', base_kernel_url=u'/')
+ self.render(
+ 'nbbrowser.html', project=project,
+ base_project_url=u'/', base_kernel_url=u'/'
+ )
class LoginHandler(AuthenticatedHandler):
@@ -82,20 +84,29 @@ class NewHandler(AuthenticatedHandler):
@web.authenticated
def get(self):
- notebook_id = self.application.notebook_manager.new_notebook()
- self.render('notebook.html', notebook_id=notebook_id,
- base_project_url=u'/', base_kernel_url=u'/')
+ nbm = self.application.notebook_manager
+ project = nbm.notebook_dir
+ notebook_id = nbm.new_notebook()
+ self.render(
+ 'notebook.html', project=project,
+ notebook_id=notebook_id,
+ base_project_url=u'/', base_kernel_url=u'/'
+ )
class NamedNotebookHandler(AuthenticatedHandler):
@web.authenticated
def get(self, notebook_id):
nbm = self.application.notebook_manager
+ project = nbm.notebook_dir
if not nbm.notebook_exists(notebook_id):
raise web.HTTPError(404, u'Notebook does not exist: %s' % notebook_id)
- self.render('notebook.html', notebook_id=notebook_id,
- base_project_url=u'/', base_kernel_url=u'/')
+ self.render(
+ 'notebook.html', project=project,
+ notebook_id=notebook_id,
+ base_project_url=u'/', base_kernel_url=u'/'
+ )
#-----------------------------------------------------------------------------
View
3 IPython/frontend/html/notebook/templates/nbbrowser.html
@@ -14,7 +14,8 @@
</head>
-<body data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}}>
+<body data-project={{project}} data-base-project-url={{base_project_url}}
+ data-base-kernel-url={{base_kernel_url}}>
<div id="header">
<span id="ipython_notebook"><h1>IPython Notebook</h1></span>
View
6 IPython/frontend/html/notebook/templates/notebook.html
@@ -44,8 +44,10 @@
</head>
-<body data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}}
- data-notebook-id={{notebook_id}} onload='CheckMathJax();'>
+<body onload='CheckMathJax();'
+ data-project={{project}} data-notebook-id={{notebook_id}}
+ data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}}
+>
<div id="header">
<span id="ipython_notebook"><h1>IPython Notebook</h1></span>

0 comments on commit a676e3d

Please sign in to comment.