2
0

page_list.html 9.5 KB

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