Przeglądaj źródła

WIP: reconstruct layouts

* page tabs
Yuki Takei 8 lat temu
rodzic
commit
3342c31e9e

+ 1 - 1
lib/views/layout-growi/page.html

@@ -49,7 +49,7 @@
     {% if 'crowi-plus' === behaviorType() %}
     {% if 'crowi-plus' === behaviorType() %}
     <div class="row page-list">
     <div class="row page-list">
       <div class="col-md-12">
       <div class="col-md-12">
-        {% include './widget/page_list_container.html' %}
+        {% include '../widget/page_list_container.html' %}
       </div>
       </div>
     </div>
     </div>
     {% endif %}
     {% endif %}

+ 25 - 36
lib/views/page_list.html

@@ -19,11 +19,12 @@
       <div class="title-container">
       <div class="title-container">
         <div class="d-flex">
         <div class="d-flex">
           <h1 class="title flex-item-title" id="revision-path"></h1>
           <h1 class="title flex-item-title" id="revision-path"></h1>
+          {% if false %} {# Disable temporaly -- 2018.03.08 Yuki Takei #}
           {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
           {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
           <form id="search-listpage-form" class="m-l-10 input-group search-input-group hidden-xs hidden-sm"
           <form id="search-listpage-form" class="m-l-10 input-group search-input-group hidden-xs hidden-sm"
               data-toggle="tooltip" data-placement="bottom" title="{{ path }} 以下から検索" data-container="body">
               data-toggle="tooltip" data-placement="bottom" title="{{ path }} 以下から検索" data-container="body">
             <div class="input-group">
             <div class="input-group">
-              <input id="#search-listpage-input" type="text" class="form-control input-sm" data-path="{{ path }}" placeholder="Search for...">
+              <input id="search-listpage-input" type="text" class="form-control input-sm" data-path="{{ path }}" placeholder="Search for...">
               <span class="input-group-btn">
               <span class="input-group-btn">
                 <button class="btn btn-default btn-sm"><i class="icon-magnifier"></i></button>
                 <button class="btn btn-default btn-sm"><i class="icon-magnifier"></i></button>
               </span>
               </span>
@@ -31,6 +32,7 @@
             <a class="search-listpage-clear" id="search-listpage-clear"><i class="fa fa-times-circle"></i></a>
             <a class="search-listpage-clear" id="search-listpage-clear"><i class="fa fa-times-circle"></i></a>
           </form>
           </form>
           {% endif %}
           {% endif %}
+          {% endif %}
         </div>
         </div>
         <div id="revision-url" class="url-line"></div>
         <div id="revision-url" class="url-line"></div>
       </div>
       </div>
@@ -66,10 +68,12 @@
  # but now the header and page list content is rendered separately by the server,
  # but now the header and page list content is rendered separately by the server,
  # so now bind the values through the hidden fields.
  # so now bind the values through the hidden fields.
  #}
  #}
+{% if false %} {# Disable temporaly -- 2018.03.08 Yuki Takei #}
 {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
 {% if searchConfigured() && !isTopPage() && !isTrashPage() %}
 <div id="page-list-search">
 <div id="page-list-search">
 </div>
 </div>
 {% endif %}
 {% endif %}
+{% endif %}
 
 
 <div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
 <div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
   id="content-main"
   id="content-main"
@@ -85,41 +89,26 @@
 
 
 <div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">
 <div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">
 
 
-  <ul class="nav nav-tabs hidden-print">
-   {# portal tab #}
-    <li class=" {% if not req.body.pageForm %}active{% endif %}">
-      {% if page %}
-      <a href="#revision-body" data-toggle="tab">
-        <i class="icon-control-play"></i> View
-      </a>
-      {% else %}
-      <a>Create Portal: {{ path }}</a>
-      {% endif %}
-    </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>
-
-    {% if not page %}
-    <li class="pull-right close-button">
-      <a href="#" id="portal-form-close">
-        <i class="fa fa-times"></i>
-      </a>
-    </li>
-    {% else %}
-    <li class="dropdown pull-right">
-      <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
-        <i class="icon-options-vertical"></i>
-      </a>
-      <ul class="dropdown-menu">
-        <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> {{ t('Unportalize') }}</a></li>
-      </ul>
-    </li>
-    <li class="pull-right"><a href="#revision-history" data-toggle="tab"><i class="icon-layers"></i> History</a></li>
-    {% endif %}
-  </ul>
+  {% 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">
   <div class="tab-content">
   {% if page and not page.isLatestRevision() %}
   {% if page and not page.isLatestRevision() %}

+ 1 - 38
lib/views/widget/page_content.html

@@ -10,41 +10,7 @@
 
 
   {% include 'page_alerts.html' %}
   {% include 'page_alerts.html' %}
 
 
-  {% if not page.isDeleted() %}
-  <ul class="nav nav-tabs hidden-print">
-    <li class=" {% if not req.body.pageForm %}active{% endif %}" data-toggle="tooltip" {# data-title="あなたの 確認待ち です" title="" data-placement="bottom" data-trigger="manual" data-tooltip-stay #}>
-      <a href="#revision-body" data-toggle="tab">
-      <i class="icon-control-play"></i> View
-      </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="dropdown pull-right">
-      <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
-        <i class="icon-options-vertical"></i>
-      </a>
-      <ul class="dropdown-menu">
-        <li><a href="#" data-target="#renamePage" data-toggle="modal"><i class="icon-fw icon-action-redo"></i> {{ t('Move') }}</a></li>
-        <li class="divider"></li>
-        <li><a href="#" data-target="#duplicatePage" data-toggle="modal"><i class="icon-fw icon-docs"></i> {{ t('Duplicate') }}</a></li>
-        {% if isDeletablePage() %}
-        <li class="divider"></li>
-        <li class=""><a href="#" data-target="#deletePage" data-toggle="modal"><i class="icon-fw icon-fire text-danger"></i> {{ t('Delete') }}</a></li>
-        {% endif %}
-      </ul>
-    </li>
-    {% if page %}
-    <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>
-    {% endif %}
-  </ul>
-  {% endif %}
+  {% include 'page_tabs.html' %}
 
 
   <div class="tab-content">
   <div class="tab-content">
 
 
@@ -85,6 +51,3 @@
     <i class="fa fa-exclamation-triangle"></i> <span class="edited-user"></span> {{ t('edited this page') }} <a href="javascript:location.reload();"><i class="fa fa-angle-double-right"></i> {{ t('Load latest') }}</a>
     <i class="fa fa-exclamation-triangle"></i> <span class="edited-user"></span> {{ t('edited this page') }} <a href="javascript:location.reload();"><i class="fa fa-angle-double-right"></i> {{ t('Load latest') }}</a>
   </div>
   </div>
 </div>
 </div>
-
-{% block content_main_after %}
-{% endblock %}

+ 1 - 1
lib/views/layout-growi/widget/page_list_container.html → lib/views/widget/page_list_container.html

@@ -18,7 +18,7 @@
 
 
     {# list view #}
     {# list view #}
     <div class="p-t-10 active tab-pane fade page-list-container in" id="view-list">
     <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 } %}
+      {% include 'page_list.html' with { pages: pages, pager: pager, viewConfig: viewConfig } %}
     </div>
     </div>
 
 
     {# timeline view #}
     {# timeline view #}

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

@@ -0,0 +1,49 @@
+<ul class="nav nav-tabs hidden-print">
+
+  {#
+    Left Tabs
+  #}
+  <li class=" {% if not req.body.pageForm %}active{% endif %}" data-toggle="tooltip">
+    <a href="#revision-body" data-toggle="tab">
+    <i class="icon-control-play"></i> View
+    </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>
+
+  {#
+    Right Tabs
+  #}
+
+  {% if isPortal %}
+  <li class="dropdown pull-right">
+    <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
+      <i class="icon-options-vertical"></i>
+    </a>
+    <ul class="dropdown-menu">
+      <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> {{ t('Unportalize') }}</a></li>
+    </ul>
+  </li>
+  {% else %}
+  <li class="dropdown pull-right">
+    <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
+      <i class="icon-options-vertical"></i>
+    </a>
+    <ul class="dropdown-menu">
+      <li><a href="#" data-target="#renamePage" data-toggle="modal"><i class="icon-fw icon-action-redo"></i> {{ t('Move') }}</a></li>
+      <li class="divider"></li>
+      <li><a href="#" data-target="#duplicatePage" data-toggle="modal"><i class="icon-fw icon-docs"></i> {{ t('Duplicate') }}</a></li>
+      {% if isDeletablePage() %}
+      <li class="divider"></li>
+      <li class=""><a href="#" data-target="#deletePage" data-toggle="modal"><i class="icon-fw icon-fire text-danger"></i> {{ t('Delete') }}</a></li>
+      {% endif %}
+    </ul>
+  </li>
+  {% endif %}
+  <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>