page.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. {% extends 'layout/2column.html' %}
  2. {% block html_title %}{{ path|path2name }} · {{ path }}{% endblock %}
  3. {% block layout_header %}
  4. {% block layout_header_before %}
  5. {% endblock %}
  6. <div class="header-wrap">
  7. <header id="page-header">
  8. <div class="flex-title-line">
  9. <h1 class="title flex-item-title" id="revision-path"></h1>
  10. {% if page %}
  11. <div class="flex-item-action">
  12. {% if user %}
  13. <span id="bookmark-button"></span>
  14. {% endif %}
  15. </div>
  16. <div class="flex-item-action visible-xs visible-sm">
  17. {% if user %}
  18. <button
  19. data-csrftoken="{{ csrf() }}"
  20. data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
  21. class="like-button btn btn-default btn-outline btn-circle {% if page.isLiked(user) %}active{% endif %}"
  22. ><i class="icon-like"></i></button>
  23. {% endif %}
  24. </div>
  25. {% endif %}
  26. </div>
  27. <div id="revision-url" class="url-line"></div>
  28. </header>
  29. </div>
  30. {% block layout_header_after %}
  31. {% endblock %}
  32. {% endblock %}
  33. {% block content_main %}
  34. {% block content_main_before %}
  35. {% if page.isDeleted() %}
  36. <div class="alert alert-warning alert-trash d-flex align-items-center justify-content-between">
  37. <div>
  38. <i class="icon-trash" aria-hidden="true"></i>
  39. This page is in the trash.<br>
  40. Deleted by <img src="{{ page.lastUpdateUser|picture }}" class="picture picture-sm img-circle"> {{ page.lastUpdateUser.name }} at {{ page.updatedAt|datetz('Y-m-d H:i:s') }}
  41. </div>
  42. {% if user %}
  43. <ul class="list-inline">
  44. <li>
  45. <a href="#" class="btn btn-default btn-rounded btn-sm" data-target="#putBackPage" data-toggle="modal"><i class="icon-action-undo" aria-hidden="true"></i> {{ t('Put Back') }}</a>
  46. </li>
  47. <li>
  48. <a href="#" class="btn btn-danger btn-rounded btn-sm" data-target="#deletePage" data-toggle="modal"><i class="icon-fire" aria-hidden="true"></i> {{ t('Delete Completely') }}</a>
  49. </li>
  50. </ul>{# /.pull-right #}
  51. {% endif %}
  52. </div>
  53. {% endif %}
  54. {% if req.query.renamed and not page.isDeleted() %}
  55. <div class="alert alert-info alert-moved">
  56. <span>
  57. <strong>{{ t('Moved') }}: </strong> {{ t('page_page.notice.moved', req.query.renamed) }}
  58. </span>
  59. </div>
  60. {% endif %}
  61. {% if req.query.redirectFrom and not page.isDeleted() %}
  62. <div class="alert alert-info alert-moved d-flex align-items-center justify-content-between">
  63. <span>
  64. <strong>{{ t('Moved') }}: </strong> {{ t('page_page.notice.moved', req.query.redirectFrom) }}
  65. </span>
  66. {% if user %}
  67. <form role="form" id="unlink-page-form" onsubmit="return false;">
  68. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  69. <input type="hidden" name="path" value="{{ page.path }}">
  70. <input type="hidden" name="page_id" value="{{ page._id.toString() }}">
  71. <button type="submit" class="btn btn-default btn-sm pull-right">
  72. <i class="fa fa-unlink" aria-hidden="true"></i>
  73. Unlink
  74. </button>
  75. </form>
  76. {% endif %}
  77. </div>
  78. {% endif %}
  79. {% if req.query.unlinked %}
  80. <div class="alert alert-info alert-unlinked">
  81. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  82. </div>
  83. {% endif %}
  84. {% endblock %}
  85. <div id="content-main" class="content-main {% if not page or req.body.pageForm %}on-edit{% endif %}"
  86. data-path="{{ path }}"
  87. data-path-shortname="{{ path|path2name }}"
  88. data-page-id="{% if page %}{{ page._id.toString() }}{% endif %}"
  89. data-current-user="{% if user %}{{ user._id.toString() }}{% endif %}"
  90. data-page-revision-id="{% if revision %}{{ revision._id.toString() }}{% endif %}"
  91. data-page-revision-created="{% if revision %}{{ revision.createdAt|datetz('U') }}{% endif %}"
  92. data-page-is-seen="{% if page and page.isSeenUser(user) %}1{% else %}0{% endif %}"
  93. >
  94. {% if not page %}
  95. <ul class="nav nav-tabs hidden-print">
  96. <li><a>Create: {{ path }}</a></li>
  97. <li class="dropdown pull-right">
  98. <a href="#" onclick="history.back();"><i class="fa fa-times"></i> {{ t('Cancel') }}</a>
  99. </li>
  100. </ul>
  101. <div class="tab-content">
  102. <div class="edit-form">
  103. {% include '_form.html' %}
  104. </div>
  105. </div>
  106. {% else %}
  107. {% if not page.isDeleted() %}
  108. <ul class="nav nav-tabs hidden-print">
  109. <li class=" {% if not req.body.pageForm %}active{% endif %}" data-toggle="tooltip" {# data-title="あなたの 確認待ち です" title="" data-placement="bottom" data-trigger="manual" data-tooltip-stay #}>
  110. <a href="#revision-body" data-toggle="tab">
  111. <i class="icon-control-play"></i> View
  112. {#
  113. <span class="label label-danger" style=""> 承認待ち</span>
  114. #}
  115. </a>
  116. </li>
  117. <li {% if req.body.pageForm %}class="active"{% endif %}>
  118. <a {% if user %}href="#edit-form" data-toggle="tab"{% endif %} class="edit-button {% if not user %}edit-button-disabled{% endif %}">
  119. <i class="icon-note"></i> {{ t('Edit') }}
  120. </a>
  121. </li>
  122. <li class="dropdown pull-right">
  123. <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
  124. <i class="icon-options-vertical"></i>
  125. </a>
  126. <ul class="dropdown-menu">
  127. <li><a href="#" data-target="#renamePage" data-toggle="modal"><i class="icon-fw icon-action-redo"></i> {{ t('Move') }}</a></li>
  128. <li class="divider"></li>
  129. <li><a href="#" data-target="#duplicatePage" data-toggle="modal"><i class="icon-fw icon-docs"></i> {{ t('Duplicate') }}</a></li>
  130. {% if isDeletablePage() %}
  131. <li class="divider"></li>
  132. <li class=""><a href="#" data-target="#deletePage" data-toggle="modal"><i class="icon-fw icon-fire text-danger"></i> {{ t('Delete') }}</a></li>
  133. {% endif %}
  134. </ul>
  135. </li>
  136. {% if page %}
  137. <li class="pull-right"><a href="#revision-history" data-toggle="tab"><i class="icon-layers"></i> History</a></li>
  138. <li class="pull-right"><a href="?presentation=1" class="toggle-presentation"><i class="icon-film"></i> {{ t('Presentation Mode') }}</a></li>
  139. {% endif %}
  140. </ul>
  141. {% endif %}
  142. <div class="tab-content">
  143. {% if not page.isLatestRevision() %}
  144. <div class="alert alert-warning">
  145. <strong>{{ t('Warning') }}: </strong> {{ t('page_page.notice.version') }} <i class="fa fa-magic"></i> <a href="{{ page.path }}">{{ t('Show latest') }}</a>
  146. </div>
  147. {% endif %}
  148. {#
  149. <div class="panel panel-default">
  150. <div class="panel-heading">承認待ち</div>
  151. <div class="panel-body">
  152. ほげほげ
  153. </div>
  154. </div>
  155. #}
  156. <script type="text/template" id="raw-text-original">{{ revision.body }}</script>
  157. {# formatted text #}
  158. <div class="tab-pane {% if not req.body.pageForm %}active{% endif %}" id="revision-body">
  159. <div class="revision-toc" id="revision-toc">
  160. <a data-toggle="collapse" data-parent="#revision-toc" href="#revision-toc-content" class="revision-toc-head">{{ t('Table of Contents') }}</a>
  161. <div id="revision-toc-content" class="revision-toc-content collapse in"></div>
  162. </div>
  163. <div id="page" class="m-t-15"></div>
  164. </div>
  165. {# edit form #}
  166. {% if not page.isDeleted() %}
  167. <div class="edit-form tab-pane {% if req.body.pageForm %}active{% endif %}" id="edit-form">
  168. {% include '_form.html' %}
  169. </div>
  170. {% endif %}
  171. {# raw revision history #}
  172. {% if not page %}
  173. {% else %}
  174. <div class="tab-pane revision-history m-t-10" id="revision-history">
  175. </div>
  176. {% endif %}
  177. </div>
  178. {% endif %}
  179. <div id="notifPageEdited" class="myadmin-alert alert-warning myadmin-alert-bottom alertbottom2">
  180. <i class="fa fa-exclamation-triangle"></i> <span class="edited-user"></span> {{ t('edited this page') }} <a href="javascript:location.reload();"><i class="fa fa-angle-double-right"></i> {{ t('Load latest') }}</a>
  181. </div>
  182. </div>
  183. {% block content_main_after %}
  184. {% endblock %}
  185. {% endblock %}
  186. {% block content_footer %}
  187. {% if page %}
  188. <div class="page-attachments meta" id="page-attachment">
  189. </div>
  190. <p class="page-meta meta">
  191. Path: <span id="pagePath">{{ page.path }}</span><br>
  192. {# for BC #}
  193. {% if page.lastUpdateUser %}
  194. Last updated at {{ page.updatedAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.lastUpdateUser|picture }}" class="picture img-circle"> {{ page.lastUpdateUser.name }}<br>
  195. {% else %}
  196. Last updated at {{ page.revision.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.revision.author|picture }}" class="picture img-circle"> {{ page.revision.author.name }}<br>
  197. {% endif %}
  198. {# /for BC #}
  199. Created at {{ page.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.creator|default(page.creator)|picture }}" class="picture img-circle"> {{ page.creator.name }}<br>
  200. </p>
  201. {% endif %}
  202. {% endblock %}
  203. {% block side_header %}
  204. {% if not page.isDeleted() %}
  205. {% include 'widget/page_side_header.html' %}
  206. {% endif %}
  207. {% endblock %} {# side_header #}
  208. {% block side_content %}
  209. {% if not page.isDeleted() %}
  210. {% include 'widget/page_side_content.html' %}
  211. {% endif %}
  212. {% endblock %}
  213. {% block layout_footer %}
  214. {% endblock %}
  215. {% block body_end %}
  216. {% parent %}
  217. <div id="presentation-layer" class="fullscreen-layer">
  218. <div id="presentation-container"></div>
  219. </div>
  220. <div id="crowi-modals">
  221. {% include 'modal/rename.html' %}
  222. {% include 'modal/delete.html' %}
  223. {% include 'modal/duplicate.html' %}
  224. {% include 'modal/put_back.html' %}
  225. {% include 'modal/page_name_warning.html' %}
  226. </div>
  227. {% endblock %}