page.html 9.3 KB

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