layout.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <!DOCTYPE html>
  2. <html>
  3. {% block html_head %}
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>{% block html_title %}{{ customizeService.generateCustomTitle(page || path) }}{% endblock %}</title>
  8. <meta name="description" content="">
  9. <meta name="author" content="">
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <meta name="apple-mobile-web-app-title" content="{{ appService.getAppTitle() }}">
  12. {{ getConfig('crowi', 'customize:header') | default('') }}
  13. {% include '../widget/headers/favicon.html' %}
  14. {% include '../widget/headers/ie11-polyfills.html' %}
  15. {{ cdnScriptTagsByGroup('basis') }}
  16. {% if local_config.env.MATHJAX %}
  17. {% include '../widget/headers/mathjax.html' %}
  18. {% endif %}
  19. {% include '../widget/headers/scripts-for-dev.html' %}
  20. <script src="{{ webpack_asset('js/vendors.js') }}" defer></script>
  21. <script src="{{ webpack_asset('js/commons.js') }}" defer></script>
  22. {% if getConfig('crowi', 'plugin:isEnabledPlugins') %}
  23. <script src="{{ webpack_asset('js/plugin.js') }}" defer></script>
  24. {% endif %}
  25. {% block html_head_loading_legacy %}
  26. <script src="{{ webpack_asset('js/legacy.js') }}" defer></script>
  27. {% endblock %}
  28. {% block html_head_loading_app %}
  29. <script src="{{ webpack_asset('js/app.js') }}" defer></script>
  30. {% endblock %}
  31. <!-- styles -->
  32. {% include '../widget/headers/styles-for-app.html' %}
  33. {% if 'kibela' === getConfig('crowi', 'customize:layout') %}
  34. {% include '../widget/headers/styles-theme-kibela.html' %}
  35. {% else %}
  36. {% block theme_css_block %}
  37. {% set themeName = getConfig('crowi', 'customize:theme') %}
  38. {% include '../widget/headers/styles-theme.html' with {themeName: themeName} %}
  39. {% endblock %}
  40. {% endif %}
  41. {{ cdnStyleTagsByGroup('basis') }}
  42. {{ cdnHighlightJsStyleTag(getConfig('crowi', 'customize:highlightJsStyle')) }}
  43. {% block html_additional_headers %}{% endblock %}
  44. <style>
  45. {{ customizeService.getCustomCss() }}
  46. </style>
  47. </head>
  48. {% endblock %}
  49. {% block html_body %}
  50. <body
  51. class="{% block html_base_css %}{% endblock %}
  52. {% if !getConfig('crowi', 'customize:layout') || 'crowi' === getConfig('crowi', 'customize:layout') %}crowi{% elseif !getConfig('crowi', 'customize:layout') || 'kibela' === getConfig('crowi', 'customize:layout') %}kibela{% else %}growi{% endif %}"
  53. data-is-admin="{{ user.admin }}"
  54. data-plugin-enabled="{{ getConfig('crowi', 'plugin:isEnabledPlugins') }}"
  55. {% block html_base_attr %}{% endblock %}
  56. data-csrftoken="{{ csrf() }}"
  57. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  58. data-userlang="{% if user %}{{ user.lang }}{% endif %}"
  59. >
  60. <div id="wrapper">
  61. {% block layout_head_nav %}
  62. <nav class="navbar grw-navbar navbar-expand navbar-dark fixed-top mb-0 px-0">
  63. {# Brand Logo #}
  64. <div class="navbar-brand mr-0">
  65. <a class="grw-logo d-block" href="/">
  66. {% include '../widget/logo.html' %}
  67. </a>
  68. </div>
  69. <ul class="navbar-nav d-md-none">
  70. <li id="grw-navbar-toggler" class="nav-item"></li>
  71. </ul>
  72. <div class="grw-app-title d-none d-md-block">
  73. {{ appService.getAppTitle() | preventXss }}
  74. </div>
  75. {# Navbar Right #}
  76. <ul class="navbar-nav ml-auto">
  77. {% if user %}
  78. <li id="create-page-button" class="nav-item d-none d-md-block"></li>
  79. {% if isSearchServiceConfigured() %}
  80. <li class="nav-item d-md-none">
  81. <a type="button" class="nav-link px-4" data-target="#grw-search-top-collapse" data-toggle="collapse">
  82. <i class="icon-magnifier mr-2"></i>
  83. </a>
  84. </li>
  85. {% endif %}
  86. <li id="personal-dropdown" class="grw-personal-dropdown nav-item dropdown dropdown-toggle dropdown-toggle-no-caret"></li>
  87. {% else %}
  88. <li id="login-user" class="nav-item"><a class="nav-link" href="/login">Login</a></li>
  89. {% endif %}
  90. {% if getConfig('crowi', 'app:confidential').length > 4 %}
  91. <li class="nav-item confidential text-light">
  92. <i class="text-light icon-info" data-toggle="tooltip" title="{{ getConfig('crowi', 'app:confidential') }}"></i>
  93. </li>
  94. {% else %}
  95. <li class="nav-item confidential text-light">
  96. {{ getConfig('crowi', 'app:confidential') }}
  97. </li>
  98. {% endif %}
  99. </ul>
  100. </nav>
  101. {% include '../modal/create_page.html' %}
  102. {% endblock %} {# layout_head_nav #}
  103. {% block head_warn_breaking_changes %}{% include '../widget/alert_breaking_changes.html' %}{% endblock %}
  104. <div id="page-wrapper" class="page-wrapper d-flex">
  105. {# Sidebar #}
  106. <div id="grw-sidebar-wrapper"></div>
  107. <div class="flex-fill mw-0">
  108. {% block head_warn_alert_siteurl_undefined %}{% include '../widget/alert_siteurl_undefined.html' %}{% endblock %}
  109. {# Search #}
  110. {% if isSearchServiceConfigured() %}
  111. <div id="grw-search-top" class="search-top" role="search"></div>
  112. {% endif %}
  113. {% block layout_main %}{% endblock %}
  114. </div>
  115. </div>
  116. </div><!-- /#wrapper -->
  117. {% if user %}
  118. <div class="grw-fixed-controls-container d-md-none d-edit-none animated fadeInUp faster">
  119. <div class="grw-fixed-controls-button-container rounded-circle">
  120. <div id='create-page-button-icon'></div>
  121. </div>
  122. </div>
  123. {% endif %}
  124. <!-- /#staff-credit -->
  125. <div id="staff-credit"></div>
  126. <div id="page-create-modal"></div>
  127. {% include '../modal/shortcuts.html' %}
  128. {% block body_end %}
  129. {% endblock %}
  130. </body>
  131. {% endblock %}
  132. <script type="application/json" id="growi-context-hydrate">
  133. {{ local_config|json|safe|preventXss }}
  134. </script>
  135. {% if user != null %}
  136. <script type="application/json" id="growi-current-user">
  137. {{ user|json|safe|preventXss }}
  138. </script>
  139. {% endif %}
  140. {% block custom_script %}
  141. <script>
  142. {{ customizeService.getCustomScript() }}
  143. </script>
  144. {% endblock %}
  145. </html>