layout.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 'kibela' === layoutType() %}
  65. {% if env === 'development' %}
  66. <script src="{{ webpack_asset('styles/style.js') }}"></script>
  67. <script src="{{ webpack_asset('styles/theme-kibela.js') }}"></script>
  68. {% else %}
  69. <link rel="stylesheet" href="{{ webpack_asset('styles/style.css') }}">
  70. <link rel="stylesheet" href="{{ webpack_asset('styles/theme-kibela.css') }}">
  71. {% endif %}
  72. {% else %}
  73. {% if env === 'development' %}
  74. <script src="{{ webpack_asset('styles/style.js') }}"></script>
  75. <script src="{{ webpack_asset('styles/theme-' + theme() + '.js') }}"></script>
  76. {% else %}
  77. <link rel="stylesheet" href="{{ webpack_asset('styles/style.css') }}">
  78. <link rel="stylesheet" href="{{ webpack_asset('styles/theme-' + theme() + '.css') }}">
  79. {% endif %}
  80. {% endif %}
  81. {% endblock %}
  82. {{ cdnStyleTagsByGroup('basis') }}
  83. {{ cdnHighlightJsStyleTag(highlightJsStyle()) }}
  84. {% block html_additional_headers %}{% endblock %}
  85. <style>
  86. {{ customCss() }}
  87. </style>
  88. </head>
  89. {% endblock %}
  90. {% block html_body %}
  91. <body
  92. class="main-container content-wrapper {% block html_base_css %}{% endblock %}
  93. {% if !layoutType() || 'crowi' === layoutType() %}crowi{% elseif !layoutType() || 'kibela' === layoutType() %}kibela{% else %}growi{% endif %}"
  94. data-me="{{ user._id.toString() }}"
  95. data-is-admin="{{ user.admin }}"
  96. data-plugin-enabled="{{ isEnabledPlugins() }}"
  97. {% block html_base_attr %}{% endblock %}
  98. data-csrftoken="{{ csrf() }}"
  99. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  100. data-userlang="{% if user %}{{ user.lang }}{% endif %}"
  101. >
  102. <div id="wrapper">
  103. <!-- Navigation -->
  104. {% block layout_head_nav %}
  105. <nav class="navbar navbar-default navbar-static-top m-b-0">
  106. <div class="navbar-header">
  107. <a class="navbar-toggle hidden-sm hidden-md hidden-lg " href="javascript:void(0)" data-toggle="collapse" data-target=".navbar-collapse">
  108. <i class="ti-menu"></i>
  109. </a>
  110. <div class="top-left-part">
  111. <a class="logo" href="/">
  112. <b>
  113. <div class="logo-mark">{% include '../widget/logo.html' %}</div>
  114. </b>
  115. <span class="hidden-xs" style="color: black">
  116. {% set appTitle = appTitle() %}
  117. {% set appTitleFontSize = getAppTitleFontSize(appTitle) %}
  118. <span class="logo-text">
  119. <svg xmlns="http://www.w3.org/2000/svg">
  120. <text x="0" y="{{22+appTitleFontSize/2}}" font-size="{{appTitleFontSize}}">
  121. {% block title %}{{ appTitle }}{% endblock %}
  122. </text>
  123. </svg>
  124. </span>
  125. </span>
  126. </a>
  127. </div>
  128. <ul class="nav navbar-top-links navbar-left hidden-xs">
  129. <li>
  130. <a class="open-close hidden-xs waves-effect waves-light">
  131. <i class="ti-menu"></i>
  132. </a>
  133. </li>
  134. <li>
  135. {% if searchConfigured() %}
  136. <div class="navbar-form navbar-left search-top" role="search" id="search-top"></div>
  137. {% endif %}
  138. </li>
  139. </ul>
  140. <ul class="nav navbar-top-links navbar-right pull-right">
  141. {% if user and user.admin %}
  142. <li class="nav-item-admin">
  143. <a href="/admin">
  144. <i class="icon-settings"></i><span>{{ t('Admin') }}</span>
  145. </a>
  146. </li>
  147. {% endif %}
  148. {% if user %}
  149. <li class="nav-item-create-page">
  150. <a href="#" data-target="#create-page" data-toggle="modal" class="create-page">
  151. <i class="icon-pencil"></i><span>{{ t('New') }}</span>
  152. </a>
  153. </li>
  154. <li class="dropdown">
  155. <a class="dropdown-toggle waves-effect waves-light" data-toggle="dropdown">
  156. <img src="{{ user|picture }}" class="picture img-circle" width="25" /> <span class="user-name">{{ user.name }}</span>
  157. </a>
  158. <ul class="dropdown-menu dropdown-menu-right">
  159. <li><a href="/user/{{ user.username }}"><i class="icon-fw icon-home"></i>{{ t('Home') }}</a></li>
  160. <li><a href="/me"><i class="icon-fw icon-wrench"></i>{{ t('User Settings') }}</a></li>
  161. <li role="separator" class="divider"></li>
  162. <li><a href="/trash"><i class="icon-fw icon-trash"></i>{{ t('Deleted Pages') }}</a></li>
  163. <li role="separator" class="divider"></li>
  164. <li><a href="/logout"><i class="icon-fw icon-power"></i>{{ t('Sign out') }}</a></li>
  165. </ul>
  166. <!-- /.dropdown-messages -->
  167. </li>
  168. {% else %}
  169. <li id="login-user"><a href="/login">Login</a></li>
  170. {% endif %}
  171. {% if config.crowi['app:confidential'] && config.crowi['app:confidential'] != '' %}
  172. <li class="confidential"><a href="#">{{ config.crowi['app:confidential'] }}</a></li>
  173. {% endif %}
  174. </ul>
  175. </div><!-- /.navbar-header -->
  176. </nav>
  177. {% include '../modal/create_page.html' %}
  178. {% endblock %} {# layout_head_nav #}
  179. {% block sidebar %}
  180. <!-- Left navbar-header -->
  181. <div class="navbar-default sidebar hidden-print" role="navigation">
  182. <div class="sidebar-nav navbar-collapse slimscrollsidebar">
  183. <ul class="nav" id="side-menu">
  184. <li class="sidebar-search hidden-sm hidden-md hidden-lg">
  185. {% if searchConfigured() %}
  186. <div class="search-sidebar" role="search" id="search-sidebar"></div>
  187. {% endif %}
  188. </li>
  189. <li class="tbd"><a href="#">(TBD) Create /Sidebar</a></li>
  190. </ul>
  191. </div>
  192. </div>
  193. <!-- Left navbar-header end -->
  194. {% endblock %}
  195. <!-- Page Content -->
  196. <div id="page-wrapper">
  197. {% block layout_main %}
  198. {% endblock %} {# layout_main #}
  199. </div><!-- /#page-wrapper -->
  200. </div><!-- /#wrapper -->
  201. {% include '../modal/shortcuts.html' %}
  202. {% block body_end %}
  203. {% endblock %}
  204. </body>
  205. {% endblock %}
  206. <script type="application/json" id="crowi-context-hydrate">
  207. {{ local_config|json|safe }}
  208. </script>
  209. {% block custom_script %}
  210. <script>
  211. {{ customScript() }}
  212. </script>
  213. {% endblock %}
  214. </html>