page.html 8.3 KB

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