navbar.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {#
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. #}
  17. {% set menu = appbuilder.menu %}
  18. {% set languages = appbuilder.languages %}
  19. {% set WARNING_MSG = appbuilder.app.config['WARNING_MSG'] %}
  20. {% set app_icon_width = appbuilder.app.config['APP_ICON_WIDTH'] %}
  21. {% set logo_target_path = appbuilder.app.config['LOGO_TARGET_PATH'] or '/profile/{}/'.format(current_user.username) %}
  22. {% set root_path = logo_target_path if not logo_target_path.startswith('/') else '/superset' + logo_target_path if current_user.username is defined else '#' %}
  23. <div class="navbar navbar-static-top {{menu.extra_classes}}" role="navigation">
  24. <div class="container-fluid">
  25. <div class="navbar-header">
  26. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  27. <span class="icon-bar"></span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. </button>
  31. <a class="navbar-brand" href="{{ root_path }}">
  32. <img
  33. width="{{ app_icon_width }}"
  34. src="{{ appbuilder.app_icon }}"
  35. alt="{{ appbuilder.app_name }}"
  36. />
  37. </a>
  38. </div>
  39. <div class="navbar-collapse collapse">
  40. <ul class="nav navbar-nav">
  41. {% if WARNING_MSG %}
  42. <li class="alert alert-danger">
  43. {{ WARNING_MSG | safe }}
  44. </li>
  45. {% endif %}
  46. {% include 'appbuilder/navbar_menu.html' %}
  47. </ul>
  48. <ul class="nav navbar-nav navbar-right">
  49. {% include 'appbuilder/navbar_right.html' %}
  50. </ul>
  51. </div>
  52. </div>
  53. </div>