page_list.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. {% extends 'layout/2column.html' %}
  2. {% block html_title %}{{ path|path2name }} · {{ path }}{% endblock %}
  3. {% block html_base_attr %}
  4. data-spy="scroll"
  5. data-target="#search-result-list"
  6. {% endblock %}
  7. {% block content_head %}
  8. {% block content_head_before %}
  9. {% endblock %}
  10. <div class="header-wrap">
  11. <header class="portal-header {% if page %}has-page{% endif %}">
  12. {% if page %}
  13. <a href="#" title="Bookmark" class="bookmark-link" id="bookmark-button" data-csrftoken="{{ csrf() }}" data-bookmarked="0"><i class="fa fa-star-o"></i></a>
  14. {% endif %}
  15. <h1 class="title">
  16. <span class="" id="revision-path">{{ path|insertSpaceToEachSlashes }}</span>
  17. {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
  18. <form class="input-group search-input-group hidden-xs hidden-sm" data-toggle="tooltip" data-placement="bottom" title="{{ path }} 以下から検索" id="search-listpage-form">
  19. <input type="text" class="search-listpage-input form-control" data-path="{{ path }}" id="search-listpage-input">
  20. <span class="input-group-btn search-listpage-submit-group">
  21. <button type="submit" class="btn btn-default" id="search-listpage-submit">
  22. <i class="fa fa-search"></i>
  23. </button>
  24. </span>
  25. <a class="search-listpage-clear" id="search-listpage-clear"><i class="fa fa-times-circle"></i></a>
  26. </form>
  27. {% endif %}
  28. </h1>
  29. </header>
  30. </div>
  31. {% endblock %}
  32. {% block content_main %}
  33. {% block content_main_before %}
  34. {% endblock %}
  35. {# page-list-search should be fully managed by react.js,
  36. # but now the header and page list content is rendered separately by the server,
  37. # so now bind the values through the hidden fields.
  38. #}
  39. {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
  40. <div id="page-list-search">
  41. </div>
  42. {% endif %}
  43. <div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
  44. id="content-main"
  45. data-path="{{ path }}"
  46. data-path-shortname="{{ path|path2name }}"
  47. data-page-portal="{% if page and page.isPortal() %}1{% else %}0{% endif %}"
  48. data-page-id="{% if page %}{{ page._id.toString() }}{% endif %}"
  49. data-current-user="{% if user %}{{ user._id.toString() }}{% endif %}"
  50. data-current-username="{% if user %}{{ user.username }}{% endif %}"
  51. data-page-revision-id="{% if revision %}{{ revision._id.toString() }}{% endif %}"
  52. data-page-revision-created="{% if revision %}{{ revision.createdAt|datetz('U') }}{% endif %}"
  53. data-page-is-seen="{% if page and page.isSeenUser(user) %}1{% else %}0{% endif %}"
  54. >
  55. <div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">
  56. <ul class="nav nav-tabs hidden-print">
  57. {# portal tab #}
  58. <li class=" {% if not req.body.pageForm %}active{% endif %}">
  59. {% if page %}
  60. <a href="#revision-body" data-toggle="tab">
  61. <i class="fa fa-magic"></i>
  62. PORTAL
  63. </a>
  64. {% else %}
  65. <a>Create Portal: {{ path }}</a>
  66. {% endif %}
  67. </li>
  68. <li {% if req.body.pageForm %}class="active"{% endif %}><a href="#edit-form" data-toggle="tab"><i class="fa fa-pencil-square-o"></i> 編集</a></li>
  69. {% if not page %}
  70. <li class="pull-right close-button">
  71. <a href="#" id="portal-form-close">
  72. <i class="fa fa-times"></i>
  73. </a>
  74. </li>
  75. {% else %}
  76. <li class="dropdown pull-right">
  77. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  78. <i class="fa fa-wrench"></i> <span class="caret"></span>
  79. </a>
  80. <ul class="dropdown-menu">
  81. <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> ポータル解除</a></li>
  82. </ul>
  83. </li>
  84. <li class="pull-right"><a href="#revision-history" data-toggle="tab"><i class="fa fa-history"></i> History</a></li>
  85. {% endif %}
  86. </ul>
  87. <div class="tab-content">
  88. {% if page and not page.isLatestRevision() %}
  89. <div class="alert alert-warning">
  90. <strong>注意: </strong> これは現在の版ではありません。 <i class="fa fa-magic"></i> <a href="{{ page.path }}">最新のポータルを表示</a>
  91. </div>
  92. {% endif %}
  93. <div class="tab-pane {% if not req.body.pageForm %}active{% endif %}" id="revision-body">
  94. <div class="wiki" id="revision-body-content">
  95. <i class="fa fa-spinner fa-pulse fa-fw"></i>
  96. </div>
  97. </div>
  98. <script type="text/template" id="raw-text-original">{{ page.revision.body }}</script>
  99. <div class="tab-pane edit-form portal-form {% if req.body.pageForm %}active{% endif %}" id="edit-form">
  100. {% include '_form.html' with {forceGrant: 1} %}
  101. </div>
  102. <div class="tab-pane revision-history" id="revision-history">
  103. <h1><i class="fa fa-history"></i> History</h1>
  104. {% if not page %}
  105. {% else %}
  106. <div class="revision-history-list">
  107. {% for t in tree %}
  108. <div class="revision-hisory-outer">
  109. <img src="{{ t.author|picture }}" class="picture picture-rounded">
  110. <div class="revision-history-main">
  111. <div class="revision-history-author">
  112. <strong>{% if t.author %}{{ t.author.username }}{% else %}-{% endif %}</strong>
  113. </div>
  114. <div class="revision-history-comment">
  115. </div>
  116. <div class="revision-history-meta">
  117. {{ t.createdAt|datetz('Y-m-d H:i:s') }}
  118. <br>
  119. <a href="?revision={{ t._id.toString() }}"><i class="fa fa-history"></i> このバージョンを見る</a>
  120. <a class="diff-view" data-revision-id="{{ t._id.toString() }}">
  121. <i id="diff-icon-{{ t._id.toString() }}" class="fa fa-arrow-circle-right"></i> 差分を見る
  122. </a>
  123. <pre class="" id="diff-display-{{ t._id.toString()}}" style="display: none"></pre>
  124. </div>
  125. </div>
  126. </div>
  127. {% endfor %}
  128. </div>
  129. {% endif %}
  130. </div>
  131. </div>
  132. </div> {# /.portal #}
  133. <div class="page-list-container">
  134. <ul class="nav nav-tabs">
  135. <li class="active"><a href="#view-list" data-toggle="tab">リスト表示</a></li>
  136. <li><a href="#view-timeline" data-toggle="tab">タイムライン表示</a></li>
  137. </ul>
  138. <div class="tab-content">
  139. {% if pages.length == 0 %}
  140. {% if isTrashPage() %}
  141. No deleted pages.
  142. {% else %}
  143. There are no pages under <strong>{{ path }}</strong>.
  144. <h3>Next Actions</h3>
  145. <ul>
  146. <li>Create portal page?
  147. <ul>
  148. <li>Great! To create the portal of <strong>{{ path }}</strong>, click "Create Portal" button.</li>
  149. </ul>
  150. </li>
  151. <li>Create the under page directly?
  152. <ul>
  153. <li>Nice. To create the page under <strong>{{ path }}</strong> directly, type the page name on your browser.</li>
  154. </ul>
  155. </li>
  156. </ul>
  157. {% endif %}
  158. {% endif %}
  159. {# list view #}
  160. <div class="active tab-pane fade page-list-container in" id="view-list">
  161. {% include 'widget/page_list.html' with { pages: pages, pager: pager, viewConfig: viewConfig } %}
  162. </div>
  163. {# timeline view #}
  164. <div class="tab-pane" id="view-timeline" data-shown=0>
  165. {% for page in pages %}
  166. <div class="timeline-body" id="id-{{ page.id }}">
  167. <h3 class="revision-path"><a href="{{ page.path }}">{{ page.path }}</a></h3>
  168. <div class="revision-body wiki"></div>
  169. <script type="text/template">{{ page.revision.body }}</script>
  170. </div>
  171. <hr>
  172. {% endfor %}
  173. </div>
  174. </div>
  175. </div>
  176. </div> {# /.content-main #}
  177. {% block content_main_after %}
  178. {% endblock %}
  179. {% endblock %}
  180. {% block content_footer %}
  181. <footer>
  182. </footer>
  183. {% endblock %}
  184. {% block side_header %}
  185. {% if not page and not isUserPageList(path) and !isTrashPage() %}
  186. <div class="portal-side">
  187. <div class="portal-form-button">
  188. <button class="btn btn-primary" id="create-portal-button">Create Portal</button>
  189. <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>
  190. </div>
  191. </div>
  192. {% else %}
  193. {% include 'widget/page_side_header.html' %}
  194. {% endif %}
  195. {% endblock %} {# side_header #}
  196. {% block body_end %}
  197. <div id="crowi-modals">
  198. {% include 'modal/what_is_portal.html' %}
  199. {% include 'modal/unportalize.html' %}
  200. </div>
  201. <div class="modal fade portal-warning-modal" id="portal-warning-modal">
  202. <div class="modal-dialog">
  203. <div class="modal-content">
  204. <div class="modal-header">
  205. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  206. <h4 class="modal-title">ポータルに関するヒント</h4>
  207. </div>
  208. <div class="modal-body alert alert-danger">
  209. <strong>Warning!</strong><br>
  210. <p>既に <strong><a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a></strong> のページが存在します。</p>
  211. <p>
  212. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> をポータル化するには、
  213. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> に移動し、「ページを移動」させてください。<br>
  214. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> とは別に、このページ(<code>{{ path }}</code>)にポータルを作成する場合、このまま編集を続けて作成してください。
  215. </p>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. {% endblock %} {# body_end #}