shared_components.mako 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 django.template.defaultfilters import urlencode, escape
  18. from django.utils.translation import ugettext as _
  19. %>
  20. <%def name="header(breadcrumbs, clusters, withBody=True)">
  21. <div class="container-fluid">
  22. <div class="row-fluid">
  23. <div class="card card-small">
  24. <h1 class="card-heading simple">
  25. <div class="btn-group pull-right">
  26. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  27. ${ _('Go to cluster') }
  28. <span class="caret"></span>
  29. </a>
  30. <ul class="dropdown-menu">
  31. % for c in clusters:
  32. <li>
  33. <a href="${ url('zookeeper:view', id=c) }">
  34. ${ c }
  35. </a>
  36. </li>
  37. % endfor
  38. </ul>
  39. </div>
  40. % for idx, crumb in enumerate(breadcrumbs):
  41. %if crumb[1] != "":
  42. <a href="${crumb[1]}">${crumb[0]}</a>
  43. %else:
  44. ${crumb[0]}
  45. %endif
  46. %if idx < len(breadcrumbs) - 1:
  47. &gt;
  48. %endif
  49. % endfor
  50. </h1>
  51. %if withBody:
  52. <div class="card-body">
  53. <p>
  54. %endif
  55. </%def>
  56. <%def name="footer(withBody=True)">
  57. %if withBody:
  58. </p>
  59. </div>
  60. %endif
  61. </div>
  62. </div>
  63. </div>
  64. <link rel="stylesheet" href="/zookeeper/static/css/zookeeper.css">
  65. <script src="/zookeeper/static/js/base64.js" type="text/javascript" charset="utf-8"></script>
  66. </%def>
  67. <%def name="menubar()">
  68. <div class="navbar navbar-inverse navbar-fixed-top nokids">
  69. <div class="navbar-inner">
  70. <div class="container-fluid">
  71. <div class="nav-collapse">
  72. <ul class="nav">
  73. <li class="currentApp">
  74. <a href="/${app_name}">
  75. <img src="/zookeeper/static/art/icon_24.png" />
  76. ${ _('ZooKeeper Browser') }
  77. </a>
  78. </li>
  79. </ul>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </%def>