layout.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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(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. <ul class="navbar-nav d-md-none mr-auto">
  64. <li id="grw-navbar-toggler" class="nav-item"></li>
  65. </ul>
  66. {# Brand Logo #}
  67. <div class="navbar-brand mr-md-auto">
  68. <a class="grw-logo d-block" href="/">
  69. {% include '../widget/logo.html' %}
  70. </a>
  71. </div>
  72. {# Navbar Center #}
  73. <ul class="navbar-nav d-none d-md-block">
  74. <li>
  75. {% if isSearchServiceConfigured() %}
  76. <div class="search-top" role="search" id="search-top"></div>
  77. {% endif %}
  78. </li>
  79. </ul>
  80. {# Navbar Right #}
  81. <ul class="navbar-nav ml-auto">
  82. {% if user and user.admin %}
  83. <li class="nav-item d-none d-md-block">
  84. <a class="nav-link" href="/admin">
  85. <i class="icon-settings mr-2"></i>
  86. {{ t('Admin') }}
  87. </a>
  88. </li>
  89. {% endif %}
  90. {% if user %}
  91. <li class="nav-item d-none d-md-block">
  92. <a class="nav-link create-page" href="#" data-target="#create-page" data-toggle="modal">
  93. <i class="icon-pencil mr-2"></i>
  94. {{ t('New') }}
  95. </a>
  96. </li>
  97. <li class="nav-item d-none d-md-block">
  98. <a class="nav-link" href="https://docs.growi.org/" target="_blank">
  99. <i class="icon-question mr-2"></i><span class="mr-2">{{ t('Help') }}</span><span class="small"><i class="icon-share-alt"></i></span>
  100. </a>
  101. </li>
  102. <li id="personal-dropdown" class="nav-item dropdown dropdown-toggle"></li>
  103. {% else %}
  104. <li id="login-user" class="nav-item"><a class="nav-link" href="/login">Login</a></li>
  105. {% endif %}
  106. {% if getConfig('crowi', 'app:confidential') %}
  107. <li class="nav-item confidential text-light">{{ getConfig('crowi', 'app:confidential') }}</li>
  108. {% endif %}
  109. </ul>
  110. </nav>
  111. {% include '../modal/create_page.html' %}
  112. {% endblock %} {# layout_head_nav #}
  113. {% block head_warn_breaking_changes %}{% include '../widget/alert_breaking_changes.html' %}{% endblock %}
  114. <div class="d-flex">
  115. {# Sidebar #}
  116. <div id="grw-sidebar-wrapper"></div>
  117. <div id="page-wrapper" class="flex-grow-1">
  118. {% block head_warn_alert_siteurl_undefined %}{% include '../widget/alert_siteurl_undefined.html' %}{% endblock %}
  119. {% block layout_main %}
  120. {% endblock %} {# layout_main #}
  121. </div>
  122. </div>
  123. </div><!-- /#wrapper -->
  124. <div class="grw-fixed-controls-container d-md-none d-edit-none animated fadeInUp faster">
  125. <div class="grw-fixed-controls-button-container rounded-circle">
  126. <button class="btn btn-lg btn-primary rounded-circle waves-effect waves-light" type="button" data-target="#create-page" data-toggle="modal">
  127. <i class="icon-pencil"></i>
  128. </button>
  129. </div>
  130. </div>
  131. <!-- /#staff-credit -->
  132. <div id="staff-credit"></div>
  133. {% include '../modal/shortcuts.html' %}
  134. {% block body_end %}
  135. {% endblock %}
  136. </body>
  137. {% endblock %}
  138. <script type="application/json" id="growi-context-hydrate">
  139. {{ local_config|json|safe|preventXss }}
  140. </script>
  141. {% if user != null %}
  142. <script type="application/json" id="growi-current-user">
  143. {{ user|json|safe|preventXss }}
  144. </script>
  145. {% endif %}
  146. {% block custom_script %}
  147. <script>
  148. {{ customizeService.getCustomScript() }}
  149. </script>
  150. {% endblock %}
  151. </html>