page_list.html 6.6 KB

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