page.html 9.3 KB

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