page_list.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 class="portal-header {% if page %}has-page{% endif %}">
  8. {% if page %}
  9. <a href="#" title="Bookmark" class="bookmark-link" id="bookmark-button" data-bookmarked="0"><i class="fa fa-star-o"></i></a>
  10. {% endif %}
  11. <h1 class="title">
  12. <span class="" id="revision-path">{{ path|insertSpaceToEachSlashes }}</span>
  13. {% if searchConfigured() && path != '/' %}
  14. <form class="input-group search-input-group hidden-xs hidden-sm" data-toggle="tooltip" data-placement="bottom" title="{{ path }} 以下から検索" id="search-listpage-form">
  15. <input type="text" class="search-listpage-input form-control" data-path="{{ path }}" id="search-listpage-input">
  16. <span class="input-group-btn search-listpage-submit-group">
  17. <button type="submit" class="btn btn-default" id="search-listpage-submit">
  18. <i class="fa fa-search"></i>
  19. </button>
  20. </span>
  21. <a class="search-listpage-clear" id="search-listpage-clear"><i class="fa fa-times-circle"></i></a>
  22. </form>
  23. {% endif %}
  24. </h1>
  25. </header>
  26. </div>
  27. {% endblock %}
  28. {% block content_main %}
  29. {% block content_main_before %}
  30. {% endblock %}
  31. {# page-list-search should be fully managed by react.js,
  32. # but now the header and page list content is rendered separately by the server,
  33. # so now bind the values through the hidden fields.
  34. #}
  35. {% if searchConfigured() && path != '/' %}
  36. <div id="page-list-search">
  37. </div>
  38. {% endif %}
  39. <div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
  40. id="content-main"
  41. data-path="{{ path }}"
  42. data-path-shortname="{{ path|path2name }}"
  43. data-page-portal="{% if page and page.isPortal() %}1{% else %}0{% endif %}"
  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. >
  50. <div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">
  51. <ul class="nav nav-tabs hidden-print">
  52. {# portal tab #}
  53. <li class=" {% if not req.body.pageForm %}active{% endif %}">
  54. {% if page %}
  55. <a href="#revision-body-content" data-toggle="tab">
  56. <i class="fa fa-magic"></i>
  57. PORTAL
  58. </a>
  59. {% else %}
  60. <a>Create Portal: {{ path }}</a>
  61. {% endif %}
  62. </li>
  63. <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>
  64. {% if not page %}
  65. <li class="pull-right close-button">
  66. <a href="#" id="portal-form-close">
  67. <i class="fa fa-times"></i>
  68. </a>
  69. </li>
  70. {% endif %}
  71. </ul>
  72. <div class="tab-content">
  73. <div class="wiki tab-pane {% if not req.body.pageForm %}active{% endif %}" id="revision-body-content">{{ page.revision.body|nl2br|safe }}</div>
  74. <script type="text/template" id="raw-text-original">{{ page.revision.body }}</script>
  75. <div class="tab-pane edit-form portal-form {% if req.body.pageForm %}active{% endif %}" id="edit-form">
  76. {% include '_form.html' with {forceGrant: 1} %}
  77. </div>
  78. </div>
  79. </div> {# /.portal #}
  80. <div class="page-list-container">
  81. <ul class="nav nav-tabs">
  82. <li class="active"><a href="#view-list" data-toggle="tab">リスト表示</a></li>
  83. <li><a href="#view-timeline" data-toggle="tab">タイムライン表示</a></li>
  84. </ul>
  85. <div class="tab-content">
  86. {% if pages.length == 0 %}
  87. There are no pages under <strong>{{ path }}</strong>.
  88. <h3>Next Actions</h3>
  89. <ul>
  90. <li>Create portal page?
  91. <ul>
  92. <li>Great! To create the portal of <strong>{{ path }}</strong>, click "Create Portal" button.</li>
  93. </ul>
  94. </li>
  95. <li>Create the under page directly?
  96. <ul>
  97. <li>Nice. To create the page under <strong>{{ path }}</strong> directly, type the page name on your browser.</li>
  98. </ul>
  99. </li>
  100. </ul>
  101. {% endif %}
  102. {# list view #}
  103. <div class="active tab-pane fade page-list-container in" id="view-list">
  104. {% include 'widget/page_list.html' with { pages: pages, pager: pager } %}
  105. </div>
  106. {# timeline view #}
  107. <div class="tab-pane" id="view-timeline">
  108. {% for page in pages %}
  109. <div class="timeline-body" id="id-{{ page.id }}">
  110. <h3 class="revision-path"><a href="{{ page.path }}">{{ page.path }}</a></h3>
  111. <div class="revision-body wiki"></div>
  112. <script type="text/template">{{ page.revision.body }}</script>
  113. </div>
  114. <hr>
  115. {% endfor %}
  116. </div>
  117. </div>
  118. </div>
  119. </div> {# /.content-main #}
  120. {% include 'modal/widget_what_is_portal.html' %}
  121. {% block content_main_after %}
  122. {% endblock %}
  123. {% endblock %}
  124. {% block content_footer %}
  125. <footer>
  126. </footer>
  127. {% endblock %}
  128. {% block side_header %}
  129. {% if not page and not isUserPageList(path) %}
  130. <div class="portal-side">
  131. <div class="portal-form-button">
  132. <button class="btn btn-primary" id="create-portal-button">Create Portal</button>
  133. <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>
  134. </div>
  135. </div>
  136. {% else %}
  137. {% include 'widget/page_side_header.html' %}
  138. {% endif %}
  139. {% endblock %} {# side_header #}
  140. {% block body_end %}
  141. <div class="modal fade portal-warning-modal" id="portal-warning-modal">
  142. <div class="modal-dialog">
  143. <div class="modal-content">
  144. <div class="modal-header">
  145. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  146. <h4 class="modal-title">ポータルに関するヒント</h4>
  147. </div>
  148. <div class="modal-body alert alert-danger">
  149. <strong>Warning!</strong><br>
  150. <p>既に <strong><a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a></strong> のページが存在します。</p>
  151. <p>
  152. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> をポータル化するには、
  153. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> に移動し、「ページを移動」させてください。<br>
  154. <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> とは別に、このページ(<code>{{ path }}</code>)にポータルを作成する場合、このまま編集を続けて作成してください。
  155. </p>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. {% endblock %} {# body_end #}