page.html 9.4 KB

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