notebook.mako 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ## Licensed to Cloudera, Inc. under one
  2. ## or more contributor license agreements. See the NOTICE file
  3. ## distributed with this work for additional information
  4. ## regarding copyright ownership. Cloudera, Inc. licenses this file
  5. ## to you under the Apache License, Version 2.0 (the
  6. ## "License"); you may not use this file except in compliance
  7. ## with the License. You may obtain a copy of the License at
  8. ##
  9. ## http://www.apache.org/licenses/LICENSE-2.0
  10. ##
  11. ## Unless required by applicable law or agreed to in writing, software
  12. ## distributed under the License is distributed on an "AS IS" BASIS,
  13. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ## See the License for the specific language governing permissions and
  15. ## limitations under the License.
  16. <%!
  17. from desktop.views import commonheader, commonfooter
  18. from desktop import conf
  19. from django.utils.translation import ugettext as _
  20. %>
  21. <%namespace name="tableStats" file="/table_stats.mako" />
  22. <%namespace name="assist" file="/assist.mako" />
  23. <%namespace name="koComponents" file="/ko_components.mako" />
  24. <%namespace name="editorComponents" file="editor_components.mako" />
  25. ${ commonheader(_('Notebook'), app_name, user, "68px") | n,unicode }
  26. ${ editorComponents.includes() }
  27. ${ editorComponents.topBar('notebook') }
  28. <%editorComponents:commonHTML>
  29. <%def name="addSnippetHTML()">
  30. <h1 class="empty" data-bind="visible: $root.availableSnippets().length == 0">${ _('There are no snippets configured.') }</h1>
  31. <!-- ko if: $root.availableSnippets().length > 0 -->
  32. <h1 class="empty" data-bind="visible: snippets().length == 0">${ _('Add a snippet to start your new notebook') }</h1>
  33. <div class="add-snippet" data-bind="component: {
  34. name: 'add-snippet-menu',
  35. params: {
  36. notebook: $data,
  37. availableSnippets: $root.availableSnippets
  38. }
  39. }">
  40. </div>
  41. <!-- /ko -->
  42. </%def>
  43. </%editorComponents:commonHTML>
  44. ${ tableStats.tableStats() }
  45. ${ assist.assistPanel() }
  46. ${ koComponents.csvListInput() }
  47. ${ koComponents.keyValueListInput() }
  48. ${ koComponents.hdfsFileListInput() }
  49. ${ koComponents.jvmMemoryInput() }
  50. ${ koComponents.addSnippetMenu() }
  51. ${ koComponents.downloadSnippetResults() }
  52. ${ editorComponents.commonJS() }
  53. ${ commonfooter(request, messages) | n,unicode }