page_list.html 6.5 KB

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