layout.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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" class="d-flex">
  61. {# Sidebar #}
  62. <nav>
  63. <div id="grw-sidebar" class="grw-sidebar"></div>
  64. </nav>
  65. <div class="flex-grow-1">
  66. {% block layout_head_nav %}
  67. <nav class="navbar grw-navbar navbar-expand-sm navbar-dark mb-0 p-0">
  68. {# Navbar Left #}
  69. <ul class="navbar-nav mr-auto pl-4">
  70. <li>
  71. {% if isSearchServiceConfigured() %}
  72. <div class="navbar-form navbar-left search-top" role="search" id="search-top"></div>
  73. {% endif %}
  74. </li>
  75. </ul>
  76. {# Navbar Right #}
  77. <ul class="navbar-nav">
  78. {% if user and user.admin %}
  79. <li class="nav-item">
  80. <a class="nav-link" href="/admin">
  81. <i class="icon-settings mr-2"></i>
  82. <span class="d-none d-md-inline-block">{{ t('Admin') }}</span>
  83. </a>
  84. </li>
  85. {% endif %}
  86. {% if user %}
  87. <li class="nav-item">
  88. <a class="nav-link" href="#" data-target="#create-page" data-toggle="modal">
  89. <i class="icon-pencil mr-2"></i>
  90. <span class="d-none d-md-inline-block">{{ t('New') }}</span>
  91. </a>
  92. </li>
  93. <li class="nav-item">
  94. <a class="nav-link" href="https://docs.growi.org/" target="_blank">
  95. <i class="icon-question mr-2"></i><span class="d-none d-md-inline-block mr-2">{{ t('Help') }}</span><span class="text-muted small"><i class="icon-share-alt"></i></span>
  96. </a>
  97. </li>
  98. <li id="personal-dropdown" class="nav-item dropdown"></li>
  99. {% else %}
  100. <li id="login-user" class="nav-item"><a class="nav-link" href="/login">Login</a></li>
  101. {% endif %}
  102. {% if getConfig('crowi', 'app:confidential') %}
  103. <li class="nav-item confidential text-light">{{ getConfig('crowi', 'app:confidential') }}</li>
  104. {% endif %}
  105. </ul>
  106. </nav>
  107. {% include '../modal/create_page.html' %}
  108. {% endblock %} {# layout_head_nav #}
  109. {% block head_warn_alert_siteurl_undefined %}{% include '../widget/alert_siteurl_undefined.html' %}{% endblock %}
  110. {% block head_warn_breaking_changes %}{% include '../widget/alert_breaking_changes.html' %}{% endblock %}
  111. <div id="page-wrapper">
  112. {% block layout_main %}
  113. {% endblock %} {# layout_main #}
  114. </div>
  115. </div>
  116. </div><!-- /#wrapper -->
  117. <!-- /#staff-credit -->
  118. <div id="staff-credit"></div>
  119. {% include '../modal/shortcuts.html' %}
  120. {% block body_end %}
  121. {% endblock %}
  122. </body>
  123. {% endblock %}
  124. <script type="application/json" id="growi-context-hydrate">
  125. {{ local_config|json|safe|preventXss }}
  126. </script>
  127. {% if user != null %}
  128. <script type="application/json" id="growi-current-user">
  129. {{ user|json|safe|preventXss }}
  130. </script>
  131. {% endif %}
  132. {% block custom_script %}
  133. <script>
  134. {{ customizeService.getCustomScript() }}
  135. </script>
  136. {% endblock %}
  137. </html>