page_list.html 6.8 KB

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