page.html 8.3 KB

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