layout.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 %}{{ customTitle(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="{{ appTitle() }}">
  12. {% include '../widget/favicon.html' %}
  13. {{ customHeader() }}
  14. <!-- polyfills for IE11 -->
  15. <script>
  16. var userAgent = window.navigator.userAgent.toLowerCase();
  17. if (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) {
  18. var scriptElement = document.createElement('script');
  19. scriptElement.src = '{{ webpack_asset("js/ie11-polyfill.js") }}';
  20. var headElement = document.getElementsByTagName('head')[0];
  21. headElement.appendChild(scriptElement);
  22. }
  23. </script>
  24. {{ cdnScriptTagsByGroup('basis') }}
  25. {% if local_config.env.MATHJAX %}
  26. <!-- Mathjax -->
  27. <script type="text/x-mathjax-config" async>
  28. MathJax.Hub.Config({
  29. skipStartupTypeset: true,
  30. extensions: ["tex2jax.js"],
  31. jax: ["input/TeX", "output/SVG"],
  32. tex2jax: {
  33. processEscapes: true
  34. },
  35. showMathMenu: false,
  36. showMathMenuMSIE: false,
  37. showProcessingMessages: false,
  38. messageStyle: "none"
  39. });
  40. </script>
  41. {{ cdnScriptTag('mathjax') }}
  42. {% endif %}
  43. {% if env === 'development' %}
  44. <script src="/dll/dll.js"></script>
  45. <script src="{{ webpack_asset('js/dev.js') }}" async></script>
  46. <!-- Browsersync -->
  47. <script id="__bs_script__">//<![CDATA[
  48. document.write("<script async src='http://HOST:3001/browser-sync/browser-sync-client.js?v=2.23.6'><\/script>".replace("HOST", location.hostname));
  49. //]]></script>
  50. {% endif %}
  51. <script src="{{ webpack_asset('js/vendors.js') }}" defer></script>
  52. <script src="{{ webpack_asset('js/commons.js') }}" defer></script>
  53. {% if isEnabledPlugins() %}
  54. <script src="{{ webpack_asset('js/plugin.js') }}" defer></script>
  55. {% endif %}
  56. {% block html_head_loading_legacy %}
  57. <script src="{{ webpack_asset('js/legacy.js') }}" defer></script>
  58. {% endblock %}
  59. {% block html_head_loading_app %}
  60. <script src="{{ webpack_asset('js/app.js') }}" defer></script>
  61. {% endblock %}
  62. <!-- styles -->
  63. {% block style_css_block %}
  64. {% if env === 'development' %}
  65. <script src="{{ webpack_asset('styles/style-commons.js') }}"></script>
  66. <script src="{{ webpack_asset('styles/style-app.js') }}"></script>
  67. {% else %}
  68. <script src="{{ webpack_asset('styles/style-commons.js') }}"></script>
  69. <link rel="stylesheet" href="{{ webpack_asset('styles/style-app.css') }}">
  70. {% endif %}
  71. {% endblock %}
  72. {% block theme_css_block %}
  73. {% if 'kibela' === layoutType() %}
  74. {% if env === 'development' %}
  75. <script src="{{ webpack_asset('styles/theme-kibela.js') }}"></script>
  76. {% else %}
  77. <link rel="stylesheet" href="{{ webpack_asset('styles/theme-kibela.css') }}">
  78. {% endif %}
  79. {% else %}
  80. {% if env === 'development' %}
  81. <script src="{{ webpack_asset('styles/theme-' + theme() + '.js') }}"></script>
  82. {% else %}
  83. <link rel="stylesheet" href="{{ webpack_asset('styles/theme-' + theme() + '.css') }}">
  84. {% endif %}
  85. {% endif %}
  86. {% endblock %}
  87. {{ cdnStyleTagsByGroup('basis') }}
  88. {{ cdnHighlightJsStyleTag(highlightJsStyle()) }}
  89. {% block html_additional_headers %}{% endblock %}
  90. <style>
  91. {{ customCss() }}
  92. </style>
  93. </head>
  94. {% endblock %}
  95. {% block html_body %}
  96. <body
  97. class="main-container content-wrapper {% block html_base_css %}{% endblock %}
  98. {% if !layoutType() || 'crowi' === layoutType() %}crowi{% elseif !layoutType() || 'kibela' === layoutType() %}kibela{% else %}growi{% endif %}"
  99. data-me="{{ user._id.toString() }}"
  100. data-is-admin="{{ user.admin }}"
  101. data-plugin-enabled="{{ isEnabledPlugins() }}"
  102. {% block html_base_attr %}{% endblock %}
  103. data-csrftoken="{{ csrf() }}"
  104. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  105. data-userlang="{% if user %}{{ user.lang }}{% endif %}"
  106. >
  107. <div id="wrapper">
  108. <!-- Navigation -->
  109. {% block layout_head_nav %}
  110. <nav class="navbar navbar-default navbar-static-top mb-0">
  111. <div class="navbar-header">
  112. <a class="navbar-toggle hidden-sm hidden-md hidden-lg " href="javascript:void(0)" data-toggle="collapse" data-target=".navbar-collapse">
  113. <i class="ti-menu"></i>
  114. </a>
  115. <div class="top-left-part">
  116. <a class="logo" href="/">
  117. <b>
  118. <div class="logo-mark">{% include '../widget/logo.html' %}</div>
  119. </b>
  120. <span class="hidden-xs" style="color: black">
  121. {% set appTitle = appTitle() %}
  122. {% set appTitleFontSize = getAppTitleFontSize(appTitle) %}
  123. <span class="logo-text">
  124. <svg xmlns="http://www.w3.org/2000/svg">
  125. <text x="0" y="{{22+appTitleFontSize/2}}" font-size="{{appTitleFontSize}}">
  126. {% block title %}{{ appTitle }}{% endblock %}
  127. </text>
  128. </svg>
  129. </span>
  130. </span>
  131. </a>
  132. </div>
  133. <ul class="nav navbar-top-links navbar-left hidden-xs">
  134. <li>
  135. <a class="open-close hidden-xs waves-effect waves-light">
  136. <i class="ti-menu"></i>
  137. </a>
  138. </li>
  139. <li>
  140. {% if searchConfigured() %}
  141. <div class="navbar-form navbar-left search-top" role="search" id="search-top"></div>
  142. {% endif %}
  143. </li>
  144. </ul>
  145. <ul class="nav navbar-top-links navbar-right pull-right">
  146. {% if user and user.admin %}
  147. <li class="nav-item-admin">
  148. <a href="/admin">
  149. <i class="icon-settings"></i><span>{{ t('Admin') }}</span>
  150. </a>
  151. </li>
  152. {% endif %}
  153. {% if user %}
  154. <li class="nav-item-create-page">
  155. <a href="#" data-target="#create-page" data-toggle="modal" class="create-page">
  156. <i class="icon-pencil"></i><span>{{ t('New') }}</span>
  157. </a>
  158. </li>
  159. <li class="dropdown">
  160. <a class="dropdown-toggle waves-effect waves-light" data-toggle="dropdown">
  161. <img src="{{ user|picture }}" class="picture img-circle" width="25" /> <span class="user-name">{{ user.name }}</span>
  162. </a>
  163. <ul class="dropdown-menu dropdown-menu-right">
  164. <li><a href="/user/{{ user.username }}"><i class="icon-fw icon-home"></i>{{ t('Home') }}</a></li>
  165. <li><a href="/me"><i class="icon-fw icon-wrench"></i>{{ t('User Settings') }}</a></li>
  166. <li role="separator" class="divider"></li>
  167. <li><a href="/trash"><i class="icon-fw icon-trash"></i>{{ t('Deleted Pages') }}</a></li>
  168. <li role="separator" class="divider"></li>
  169. <li><a href="/logout"><i class="icon-fw icon-power"></i>{{ t('Sign out') }}</a></li>
  170. </ul>
  171. <!-- /.dropdown-messages -->
  172. </li>
  173. {% else %}
  174. <li id="login-user"><a href="/login">Login</a></li>
  175. {% endif %}
  176. {% if config.crowi['app:confidential'] && config.crowi['app:confidential'] != '' %}
  177. <li class="confidential"><a href="#">{{ config.crowi['app:confidential'] }}</a></li>
  178. {% endif %}
  179. </ul>
  180. </div><!-- /.navbar-header -->
  181. </nav>
  182. {% include '../modal/create_page.html' %}
  183. {% endblock %} {# layout_head_nav #}
  184. {% block head_warn %}{% endblock %}
  185. {% block sidebar %}
  186. <!-- Left navbar-header -->
  187. <div class="navbar-default sidebar hidden-print" role="navigation">
  188. <div class="sidebar-nav navbar-collapse slimscrollsidebar">
  189. <ul class="nav" id="side-menu">
  190. <li class="sidebar-search hidden-sm hidden-md hidden-lg">
  191. {% if searchConfigured() %}
  192. <div class="search-sidebar" role="search" id="search-sidebar"></div>
  193. {% endif %}
  194. </li>
  195. <li class="tbd"><a href="#">(TBD) Create /Sidebar</a></li>
  196. </ul>
  197. </div>
  198. </div>
  199. <!-- Left navbar-header end -->
  200. {% endblock %}
  201. <!-- Page Content -->
  202. <div id="page-wrapper">
  203. {% block layout_main %}
  204. {% endblock %} {# layout_main #}
  205. </div><!-- /#page-wrapper -->
  206. </div><!-- /#wrapper -->
  207. <!-- /#staff-credit -->
  208. <div id="staff-credit"><div>
  209. {% include '../modal/shortcuts.html' %}
  210. {% block body_end %}
  211. {% endblock %}
  212. </body>
  213. {% endblock %}
  214. <script type="application/json" id="crowi-context-hydrate">
  215. {{ local_config|json|safe }}
  216. </script>
  217. {% block custom_script %}
  218. <script>
  219. {{ customScript() }}
  220. </script>
  221. {% endblock %}
  222. </html>