page_list.html 7.0 KB

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