layout.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="main-container content-wrapper {% 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-me="{{ user._id.toString() }}"
  54. data-is-admin="{{ user.admin }}"
  55. data-plugin-enabled="{{ getConfig('crowi', 'plugin:isEnabledPlugins') }}"
  56. {% block html_base_attr %}{% endblock %}
  57. data-csrftoken="{{ csrf() }}"
  58. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  59. data-userlang="{% if user %}{{ user.lang }}{% endif %}"
  60. >
  61. <div id="wrapper">
  62. <!-- Navigation -->
  63. {% block layout_head_nav %}
  64. <nav class="navbar navbar-default navbar-static-top mb-0">
  65. <div class="navbar-header">
  66. <a class="navbar-toggle hidden-sm hidden-md hidden-lg " href="javascript:void(0)" data-toggle="collapse" data-target=".navbar-collapse">
  67. <i class="ti-menu"></i>
  68. </a>
  69. <div class="top-left-part">
  70. <a class="logo" href="/">
  71. <b>
  72. <div class="logo-mark">{% include '../widget/logo.html' %}</div>
  73. </b>
  74. <span class="hidden-xs" style="color: black">
  75. {% set appTitle = appService.getAppTitle() %}
  76. {% set appTitleFontSize = getAppTitleFontSize(appTitle) %}
  77. <span class="logo-text">
  78. <svg xmlns="http://www.w3.org/2000/svg">
  79. <text x="0" y="{{22+appTitleFontSize/2}}" font-size="{{appTitleFontSize}}">
  80. {% block title %}{{ appTitle }}{% endblock %}
  81. </text>
  82. </svg>
  83. </span>
  84. </span>
  85. </a>
  86. </div>
  87. <ul class="nav navbar-top-links navbar-left hidden-xs">
  88. <li>
  89. <a class="open-close hidden-xs waves-effect waves-light">
  90. <i class="ti-menu"></i>
  91. </a>
  92. </li>
  93. {# disabled temporary -- 2019.05.13 Yuki Takei
  94. <li>
  95. <li class="nav-item-admin">
  96. <a href="/tags">
  97. <i class="tag-icon icon-tag"></i><span>{{ t('Tags') }}</span>
  98. </a>
  99. </li>
  100. </li>
  101. #}
  102. <li>
  103. {% if searchConfigured() %}
  104. <div class="navbar-form navbar-left search-top" role="search" id="search-top"></div>
  105. {% endif %}
  106. </li>
  107. </ul>
  108. <ul class="nav navbar-top-links navbar-right pull-right">
  109. {% if user and user.admin %}
  110. <li class="nav-item-admin">
  111. <a href="/admin">
  112. <i class="icon-settings"></i><span>{{ t('Admin') }}</span>
  113. </a>
  114. </li>
  115. {% endif %}
  116. {% if user %}
  117. <li class="nav-item-create-page">
  118. <a href="#" data-target="#create-page" data-toggle="modal" class="create-page">
  119. <i class="icon-pencil"></i><span>{{ t('New') }}</span>
  120. </a>
  121. </li>
  122. <li class="nav-item-help">
  123. <a href="https://docs.growi.org/" target="_blank">
  124. <i class="icon-question"></i><span>{{ t('Help') }}</span><span class="text-muted small"><i class="icon-share-alt"></i></span>
  125. </a>
  126. </li>
  127. <li class="dropdown">
  128. <a class="dropdown-toggle waves-effect waves-light" data-toggle="dropdown">
  129. <img src="{{ user|picture }}" class="picture img-circle" width="25" /> <span class="user-name">{{ user.name }}</span>
  130. </a>
  131. <ul class="dropdown-menu dropdown-menu-right">
  132. <li><a href="/user/{{ user.username }}"><i class="icon-fw icon-home"></i>{{ t('Home') }}</a></li>
  133. <li><a href="/me"><i class="icon-fw icon-wrench"></i>{{ t('User Settings') }}</a></li>
  134. <li role="separator" class="divider"></li>
  135. <li><a href="/user/{{ user.username }}#user-draft-list"><i class="icon-fw icon-docs"></i>{{ t('List Drafts') }}</a></li>
  136. <li><a href="/trash"><i class="icon-fw icon-trash"></i>{{ t('Deleted Pages') }}</a></li>
  137. <li role="separator" class="divider"></li>
  138. <li><a href="/logout"><i class="icon-fw icon-power"></i>{{ t('Sign out') }}</a></li>
  139. </ul>
  140. <!-- /.dropdown-messages -->
  141. </li>
  142. {% else %}
  143. <li id="login-user"><a href="/login">Login</a></li>
  144. {% endif %}
  145. {% if getConfig('crowi', 'app:confidential') %}
  146. <li class="confidential"><a href="#">{{ getConfig('crowi', 'app:confidential') }}</a></li>
  147. {% endif %}
  148. </ul>
  149. </div><!-- /.navbar-header -->
  150. </nav>
  151. {% include '../modal/create_page.html' %}
  152. {% endblock %} {# layout_head_nav #}
  153. {% block head_warn_alert_siteurl_undefined %}{% include '../widget/alert_siteurl_undefined.html' %}{% endblock %}
  154. {% block head_warn_breaking_changes %}{% include '../widget/alert_breaking_changes.html' %}{% endblock %}
  155. {% block sidebar %}
  156. <!-- Left navbar-header -->
  157. <div class="navbar-default sidebar hidden-print" role="navigation">
  158. <div class="sidebar-nav navbar-collapse slimscrollsidebar">
  159. <ul class="nav" id="side-menu">
  160. <li class="sidebar-search hidden-sm hidden-md hidden-lg">
  161. {% if searchConfigured() %}
  162. <div class="search-sidebar" role="search" id="search-sidebar"></div>
  163. {% endif %}
  164. </li>
  165. <li class="tbd"><a href="#">(TBD) Create /Sidebar</a></li>
  166. </ul>
  167. </div>
  168. </div>
  169. <!-- Left navbar-header end -->
  170. {% endblock %}
  171. <!-- Page Content -->
  172. <div id="page-wrapper">
  173. {% block layout_main %}
  174. {% endblock %} {# layout_main #}
  175. </div><!-- /#page-wrapper -->
  176. </div><!-- /#wrapper -->
  177. <!-- /#staff-credit -->
  178. <div id="staff-credit"></div>
  179. {% include '../modal/shortcuts.html' %}
  180. {% block body_end %}
  181. {% endblock %}
  182. </body>
  183. {% endblock %}
  184. <script type="application/json" id="crowi-context-hydrate">
  185. {{ local_config|json|safe|preventXss }}
  186. </script>
  187. {% block custom_script %}
  188. <script>
  189. {{ customizeService.getCustomScript() }}
  190. </script>
  191. {% endblock %}
  192. </html>