Przeglądaj źródła

WIP: reconstruct layouts

* page_list
Yuki Takei 8 lat temu
rodzic
commit
ba67a75bd2

+ 8 - 1
lib/views/layout-growi/page_list.html

@@ -24,11 +24,12 @@
 
 {% block content_main %}
   <div class="container-fluid">
+
     <div class="row">
 
       <div class="col-lg-10 col-md-9">
 
-          {% include '../widget/page_content.html' %}
+        {% include '../widget/page_content.html' %}
 
         {# force remove #revision-toc from #content_main of parent #}
         <script>
@@ -48,6 +49,12 @@
       </div> {# /.col- #}
 
     </div>
+
+    <div class="row page-list">
+      <div class="col-md-12">
+        {% include '../widget/page_list_container.html' %}
+      </div>
+    </div>
   </div>
 {% endblock %}
 

+ 17 - 150
lib/views/page_list.html

@@ -61,169 +61,37 @@
 
 {% block content_main %}
 
-{% block content_main_before %}
-{% endblock %}
-
-{# page-list-search should be fully managed by react.js,
- # but now the header and page list content is rendered separately by the server,
- # so now bind the values through the hidden fields.
- #}
-{% if false %} {# Disable temporaly -- 2018.03.08 Yuki Takei #}
-{% if searchConfigured() && !isTopPage() && !isTrashPage() %}
-<div id="page-list-search">
-</div>
-{% endif %}
-{% endif %}
-
-<div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
-  id="content-main"
-  data-path="{{ path }}"
-  data-path-shortname="{{ path|path2name }}"
-  data-page-portal="{% if page and page.isPortal() %}1{% else %}0{% endif %}"
-  data-page-id="{% if page %}{{ page._id.toString() }}{% endif %}"
-  data-current-user="{% if user %}{{ user._id.toString() }}{% endif %}"
-  data-page-revision-id="{% if revision %}{{ revision._id.toString() }}{% endif %}"
-  data-page-revision-created="{% if revision %}{{ revision.createdAt|datetz('U') }}{% endif %}"
-  data-page-is-seen="{% if page and page.isSeenUser(user) %}1{% else %}0{% endif %}"
-  >
-
-<div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">
-
-  {% if page %}
-    {% include 'widget/page_tabs.html' %}
-  {% else %}
-    <ul class="nav nav-tabs hidden-print">
-      <li class=" {% if not req.body.pageForm %}active{% endif %}">
-        <a>Create Portal: {{ path }}</a>
-      </li>
-      <li {% if req.body.pageForm %}class="active"{% endif %}>
-        <a {% if user %}href="#edit-form" data-toggle="tab"{% endif %} class="edit-button {% if not user %}edit-button-disabled{% endif %}">
-          <i class="icon-note"></i> {{ t('Edit') }}
-        </a>
-      </li>
-
-      <li class="pull-right close-button">
-        <a href="#" id="portal-form-close">
-          <i class="fa fa-times"></i>
-        </a>
-      </li>
-    </ul>
-  {% endif %}
-
-  <div class="tab-content">
-  {% if page and not page.isLatestRevision() %}
-  <div class="alert alert-warning">
-    <strong>{{ t('Warning') }}: </strong> {{ t('page.notice.version') }} <i class="fa fa-magic"></i> <a href="{{ page.path }}">最新のポータルを表示</a>
+  {% block content_main_before %}
+  {% endblock %}
+
+  {# page-list-search should be fully managed by react.js,
+  # but now the header and page list content is rendered separately by the server,
+  # so now bind the values through the hidden fields.
+  #}
+  {% if false %} {# Disable temporaly -- 2018.03.08 Yuki Takei #}
+  {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
+  <div id="page-list-search">
   </div>
   {% endif %}
-    <div class="tab-pane {% if not req.body.pageForm %}active{% endif %}" id="revision-body">
-      <div id="page" class="m-t-15"></div>
-    </div>
-
-    <script type="text/template" id="raw-text-original">{{ page.revision.body }}</script>
-
-    <div class="tab-pane edit-form portal-form {% if req.body.pageForm %}active{% endif %}" id="edit-form">
-      {% include '_form.html' with {forceGrant: 1} %}
-    </div>
-
-    <div class="tab-pane revision-history m-t-10" id="revision-history">
-      {% if not page %}
-      {% else %}
-      <div class="revision-history-list">
-        {% for tr in tree %}
-        <div class="revision-hisory-outer">
-          <img src="{{ tr.author|picture }}" class="picture img-circle">
-          <div class="revision-history-main">
-            <div class="revision-history-author">
-              <strong>{% if tr.author %}{{ tr.author.username }}{% else %}-{% endif %}</strong>
-            </div>
-            <div class="revision-history-comment">
-            </div>
-            <div class="revision-history-meta">
-              {{ tr.createdAt|datetz('Y-m-d H:i:s') }}
-              <br>
-              <a href="?revision={{ tr._id.toString() }}"><i class="fa fa-history"></i> {{ t('View this version') }}</a>
-              <a class="diff-view" data-revision-id="{{ tr._id.toString() }}">
-                <i id="diff-icon-{{ tr._id.toString() }}" class="fa fa-arrow-circle-right"></i> {{ t('View diff') }}
-              </a>
-              <div class="" id="diff-display-{{ tr._id.toString()}}" style="display: none"></div>
-            </div>
-          </div>
-        </div>
-        {% endfor %}
-      </div>
-      {% endif %}
-    </div>
-  </div>
-
-</div> {# /.portal #}
-
-<div class="page-list-container">
-  <ul class="nav nav-tabs">
-      <li class="active"><a href="#view-list" data-toggle="tab">{{ t('List View') }}</a></li>
-      {% if isEnabledTimeline() %}
-      <li><a href="#view-timeline" data-toggle="tab">{{ t('Timeline View') }}</a></li>
-      {% endif %}
-  </ul>
-
-  <div class="tab-content">
-    {% if pages.length == 0 %}
-
-      {% if isTrashPage() %}
-      No deleted pages.
-      {% else %}
-      There are no pages under <strong>{{ path }}</strong>.
-
-      <h3>Next Actions</h3>
-
-      <ul>
-        <li>Create portal page?
-          <ul>
-            <li>Great! To create the portal of <strong>{{ path }}</strong>, click "Create Portal" button.</li>
-          </ul>
-        </li>
-        <li>Create the under page directly?
-          <ul>
-            <li>Nice. To create the page under <strong>{{ path }}</strong> directly, type the page name on your browser.</li>
-          </ul>
-        </li>
-      </ul>
-      {% endif %}
-    {% endif  %}
+  {% endif %}
 
-    {# list view #}
-    <div class="p-t-10 active tab-pane fade page-list-container in" id="view-list">
-      {% include 'widget/page_list.html' with { pages: pages, pager: pager, viewConfig: viewConfig } %}
-    </div>
+  {% include 'widget/page_content.html' %}
 
-    {# timeline view #}
-    {% if isEnabledTimeline() %}
-    <div class="tab-pane" id="view-timeline" data-shown=0>
-      {% for page in pages %}
-      <div class="timeline-body" id="id-{{ page.id }}" data-page-path="{{ page.path }}">
-        <h3 class="revision-path"><a href="{{ page.path }}">{{ page.path }}</a></h3>
-        <div class="revision-body wiki"></div>
-        <script type="text/template">{{ page.revision.body }}</script>
-      </div>
-      <hr>
-      {% endfor %}
+  <div class="row page-list">
+    <div class="col-md-12">
+      {% include 'widget/page_list_container.html' %}
     </div>
-    {% endif %}
   </div>
-</div>
 
+{% endblock %}
 
-</div> {# /.content-main #}
 
 {% block content_main_after %}
 {% endblock %}
 
-{% endblock %}
-
 
 {% block content_footer %}
 <footer>
-
 </footer>
 {% endblock %}
 
@@ -236,7 +104,6 @@
     <button class="btn btn-primary" id="create-portal-button">Create Portal</button>
     <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>
   </div>
-
 </div>
 {% else %}
   {% include 'widget/page_side_header.html' %}
@@ -257,7 +124,7 @@
         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
         <h4 class="modal-title">ポータルに関するヒント</h4>
       </div>
-      <div class="modal-body alert alert-danger">
+      <div class="modal-body">
 
         <strong>Warning!</strong><br>
 

+ 2 - 0
lib/views/widget/page_tabs.html

@@ -1,3 +1,4 @@
+{% if page %}
 <ul class="nav nav-tabs hidden-print">
 
   {#
@@ -47,3 +48,4 @@
   <li class="pull-right"><a href="#revision-history" data-toggle="tab"><i class="icon-layers"></i> History</a></li>
   <li class="pull-right"><a href="?presentation=1" class="toggle-presentation"><i class="icon-film"></i> {{ t('Presentation Mode') }}</a></li>
 </ul>
+{% endif %}