layout.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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 %}{% endblock %} {{ config.crowi['app:title']|default('Crowi') }}</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="{{ config.crowi['app:title']|default('Crowi') }}">
  12. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  13. <link rel="apple-touch-icon" href="/apple-touch-icon.png">
  14. <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
  15. <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
  16. <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
  17. <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
  18. <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
  19. <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
  20. <!-- polyfills for IE11 -->
  21. <script>
  22. var userAgent = window.navigator.userAgent.toLowerCase();
  23. if (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) {
  24. var scriptElement = document.createElement('script');
  25. scriptElement.src = 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js';
  26. var headElement = document.getElementsByTagName('head')[0];
  27. headElement.appendChild(scriptElement);
  28. }
  29. </script>
  30. <!-- jQuery, emojione -->
  31. <script src="https://cdn.jsdelivr.net/combine/npm/emojione@3.1.2,npm/jquery@3.3.1"></script>
  32. <!-- highlight.js -->
  33. <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
  34. {% if local_config.env.MATHJAX %}
  35. <!-- Mathjax -->
  36. <script type="text/x-mathjax-config" async>
  37. MathJax.Hub.Config({
  38. skipStartupTypeset: true,
  39. extensions: ["tex2jax.js"],
  40. jax: ["input/TeX", "output/SVG"],
  41. tex2jax: {
  42. processEscapes: true
  43. },
  44. showMathMenu: false,
  45. showMathMenuMSIE: false,
  46. showProcessingMessages: false,
  47. messageStyle: "none"
  48. });
  49. </script>
  50. <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js" async></script>
  51. {% endif %}
  52. {% if env === 'development' %}
  53. <script src="/dll/vendor.dll.js"></script>
  54. <script src="{{ webpack_asset('dev').js }}" async></script>
  55. {% endif %}
  56. <script src="{{ webpack_asset('style').js }}"></script>
  57. <script src="{{ webpack_asset('commons').js }}" defer></script>
  58. {% if isEnabledPlugins() %}
  59. <script src="{{ webpack_asset('plugin').js }}" defer></script>
  60. {% endif %}
  61. {% block html_head_loading_legacy %}
  62. <script src="{{ webpack_asset('legacy').js }}" defer></script>
  63. {% endblock %}
  64. <script src="{{ webpack_asset('app').js }}" defer></script>
  65. <!-- Google Fonts -->
  66. <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
  67. <!-- Font Awesome -->
  68. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  69. <!-- emojione -->
  70. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/emojione@3.1.2/extras/css/emojione.min.css">
  71. <!-- highlight.js -->
  72. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/github.css">
  73. {% block html_additional_headers %}{% endblock %}
  74. <style>
  75. {{ customCss() }}
  76. </style>
  77. </head>
  78. {% endblock %}
  79. {% block html_body %}
  80. <body
  81. class="crowi main-container {% block html_base_css %}{% endblock %} {% if 'crowi-plus' === layoutType() %}crowi-plus{% endif %}"
  82. data-me="{{ user._id.toString() }}"
  83. data-plugin-enabled="{{ isEnabledPlugins() }}"
  84. {% block html_base_attr %}{% endblock %}
  85. data-csrftoken="{{ csrf() }}"
  86. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  87. >
  88. {% block layout_head_nav %}
  89. <nav class="crowi-header navbar navbar-default" role="navigation">
  90. <!-- Brand and toggle get grouped for better mobile display -->
  91. <div class="navbar-header">
  92. <a class="navbar-brand" href="/">
  93. <img alt="Crowi" src="/logo/32x32.png" width="16">
  94. <span class="hidden-xs">{% block title %}{{ config.crowi['app:title']|default('Crowi') }}{% endblock %}</span>
  95. </a>
  96. {% if searchConfigured() %}
  97. <div class="navbar-form navbar-left search-top" role="search" id="search-top">
  98. </div>
  99. {% endif %}
  100. </div>
  101. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse">
  102. <span class="sr-only">Toggle navigation</span>
  103. <span class="icon-bar"></span>
  104. <span class="icon-bar"></span>
  105. <span class="icon-bar"></span>
  106. </button>
  107. <!-- Collect the nav links, forms, and other content for toggling -->
  108. <div class="collapse navbar-collapse" id="navbarCollapse">
  109. <ul class="nav navbar-nav navbar-right">
  110. {% if user and user.admin %}
  111. <li id="">
  112. <a href="/admin" id="link-mypage">
  113. <i class="fa fa-cube"></i> {{ t('Admin') }}
  114. </a>
  115. </li>
  116. {% endif %}
  117. {#
  118. <li id="">
  119. <a href="#" id="createPage">
  120. <i class="fa fa-plus"> 新規</i>
  121. </a>
  122. </li>
  123. #}
  124. {% if user %}
  125. {#
  126. <li id="" class="notif">
  127. <a href="" id="notif-opener">
  128. <i class="fa fa-globe"></i> <span class="badge badge-danger">6</span>
  129. </a>
  130. </li>
  131. #}
  132. <li id="" class="dropdown">
  133. <button class="btn btn-default create-page-button" data-target="#create-page" data-toggle="modal">
  134. <i class="fa fa-pencil"></i> {{ t('New') }}
  135. </button>
  136. </li>
  137. <li id="login-user">
  138. <a href="/user/{{ user.username }}" id="link-mypage">
  139. <img src="{{ user|picture }}" class="picture picture-rounded" width="25" /> {{ user.name }}
  140. </a>
  141. </li>
  142. <li class="dropdown">
  143. <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bars"></i> <label class="sr-only">メニュー</label></a>
  144. <ul class="dropdown-menu">
  145. <li><a href="/me"><i class="fa fa-gears"></i> {{ t('User Settings') }}</a></li>
  146. <li class="divider"></li>
  147. <li><a href="/trash/"><i class="fa fa-trash-o"></i> {{ t('Deleted Pages') }}</a></li>
  148. <li class="divider"></li>
  149. <li><a href="/logout"><i class="fa fa-sign-out"></i> {{ t('Sign out') }}</a></li>
  150. {# <li><a href="#">今日の日報を作成</a></li> #}
  151. {# <li class="divider"></li> #}
  152. {# <li class="divider"></li> #}
  153. {# <li><a href="#">ログアウト</a></li> #}
  154. </ul>
  155. </li>
  156. {% else %}
  157. <li id="login-user"><a href="/login"><i class="fa fa-user"></i> Login</a></li>
  158. {% endif %}
  159. {% if config.crowi['app:confidential'] && config.crowi['app:confidential'] != '' %}
  160. <li class="confidential"><a href="#">{{ config.crowi['app:confidential'] }}</a></li>
  161. {% endif %}
  162. </ul>
  163. </div><!-- /.navbar-collapse -->
  164. </nav>
  165. {% include '../modal/create_page.html' %}
  166. {% endblock %} {# layout_head_nav #}
  167. <div class="container-fluid">
  168. <div class="row">
  169. {% block layout_sidebar %}
  170. {% endblock %} {# layout_sidebar #}
  171. {% block layout_main %}
  172. {% endblock %} {# layout_main #}
  173. {% block footer %}
  174. {% endblock %}
  175. </div> {# /.row #}
  176. </div> {# /.container-fluid #}
  177. {% block body_end %}
  178. {% endblock %}
  179. {% include '../modal/shortcuts.html' %}
  180. </body>
  181. {% endblock %}
  182. <script type="application/json" id="crowi-context-hydrate">
  183. {{ local_config|json|safe }}
  184. </script>
  185. {% block custom_script %}
  186. <script>
  187. {{ customScript() }}
  188. </script>
  189. {% endblock %}
  190. </html>