浏览代码

[spark] Rename editor to notebook

Romain Rigaux 10 年之前
父节点
当前提交
47117c8

+ 0 - 0
apps/spark/src/spark/templates/editor.mako → apps/spark/src/spark/templates/notebook.mako


+ 1 - 1
apps/spark/src/spark/templates/notebooks.mako

@@ -78,7 +78,7 @@ ${ commonheader(_("Notebooks"), "spark", user, "60px") | n,unicode }
       <tr>
         <td data-bind="click: $root.handleSelect" class="center" style="cursor: default" data-row-selector-exclude="true">
           <div data-bind="css: { 'hueCheckbox': true, 'fa': true, 'fa-check': isSelected }" data-row-selector-exclude="true"></div>
-          <a data-bind="attr: { 'href': '${ url('spark:editor') }?notebook=' + id() }" data-row-selector="true"></a>
+          <a data-bind="attr: { 'href': '${ url('spark:notebook') }?notebook=' + id() }" data-row-selector="true"></a>
         </td>
         <td data-bind="text: name"></td>
         <td data-bind="text: description"></td>

+ 2 - 2
apps/spark/src/spark/urls.py

@@ -29,8 +29,8 @@ import spark.monkey_patches
 
 # Views
 urlpatterns = patterns('spark.views',
-  url(r'^$', 'editor', name='index'),
-  url(r'^editor$', 'editor', name='editor'),
+  url(r'^$', 'notebook', name='index'),
+  url(r'^notebook$', 'notebook', name='notebook'),
   url(r'^notebooks$', 'notebooks', name='notebooks'),
   url(r'^new$', 'new', name='new'),
   url(r'^download$', 'download', name='download'),

+ 3 - 4
apps/spark/src/spark/views.py

@@ -17,7 +17,6 @@
 
 import json
 import logging
-import uuid
 
 from django.core.urlresolvers import reverse
 from django.utils.translation import ugettext as _
@@ -37,7 +36,7 @@ LOG = logging.getLogger(__name__)
 
 
 @check_document_access_permission()
-def editor(request):
+def notebook(request):
   notebook_id = request.GET.get('notebook')
 
   if notebook_id:
@@ -51,7 +50,7 @@ def editor(request):
   except:
     LOG.exception('failed to get autocomplete base url')
 
-  return render('editor.mako', request, {
+  return render('notebook.mako', request, {
       'notebooks_json': json.dumps([notebook.get_data()]),
       'options_json': json.dumps({
           'languages': LANGUAGES.get(),
@@ -68,7 +67,7 @@ def editor(request):
 
 
 def new(request):
-  return editor(request)
+  return notebook(request)
 
 
 def notebooks(request):

+ 1 - 1
desktop/core/src/desktop/models.py

@@ -783,7 +783,7 @@ class Document2(models.Model):
     elif self.type == 'oozie-bundle2':
       return reverse('oozie:edit_bundle') + '?bundle=' + str(self.id)
     elif self.type == 'notebook':
-      return reverse('spark:editor') + '?notebook=' + str(self.id)
+      return reverse('spark:notebook') + '?notebook=' + str(self.id)
     elif self.type == 'search-dashboard':
       return reverse('search:index') + '?collection=' + str(self.id)
     else: