Просмотр исходного кода

Merge pull request #2023 from weseek/support/fix-subnav-layout

Support/fix subnav layout
itizawa 6 лет назад
Родитель
Сommit
92e6e93d44

+ 9 - 5
src/client/js/components/Navbar/GrowiSubNavigation.jsx

@@ -44,11 +44,15 @@ const GrowiSubNavigation = (props) => {
   }
 
   const additionalClassNames = ['grw-subnavbar'];
-  if (isHeaderSticky) {
-    additionalClassNames.push('grw-subnavbar-sticky');
-  }
-  if (isSubnavCompact) {
-    additionalClassNames.push('grw-subnavbar-compact');
+  const layoutType = appContainer.getConfig().layoutType;
+
+  if (layoutType === 'growi') {
+    if (isHeaderSticky) {
+      additionalClassNames.push('grw-subnavbar-sticky');
+    }
+    if (isSubnavCompact) {
+      additionalClassNames.push('grw-subnavbar-compact');
+    }
   }
 
   return (

+ 12 - 8
src/client/js/components/Navbar/GrowiSubNavigationForUserPage.jsx

@@ -16,14 +16,18 @@ const GrowiSubNavigationForUserPage = (props) => {
   const { pageId, isHeaderSticky, isSubnavCompact } = pageContainer.state;
 
   const additionalClassNames = ['grw-subnavbar', 'grw-subnavbar-user-page'];
-  if (isHeaderSticky) {
-    additionalClassNames.push('grw-subnavbar-sticky');
-  }
-  if (isSubnavCompact) {
-    additionalClassNames.push('py-2 grw-subnavbar-compact');
-  }
-  else {
-    additionalClassNames.push('py-3');
+  const layoutType = appContainer.getConfig().layoutType;
+
+  if (layoutType === 'growi') {
+    if (isHeaderSticky) {
+      additionalClassNames.push('grw-subnavbar-sticky');
+    }
+    if (isSubnavCompact) {
+      additionalClassNames.push('py-2 grw-subnavbar-compact');
+    }
+    else {
+      additionalClassNames.push('py-3');
+    }
   }
 
   return (

+ 0 - 10
src/client/styles/scss/theme/_apply-colors-kibela.scss

@@ -25,11 +25,6 @@ body.kibela {
     background-color: $bgcolor-global;
   }
 
-  /* header*/
-  .background-t {
-    background-color: transparent;
-  }
-
   .search-input-group,
   .search-typeahead {
     .btn {
@@ -160,11 +155,6 @@ body.kibela {
     }
   }
 
-  /* subnavbar */
-  .grw-subnavbar {
-    background: transparent;
-  }
-
   /* navbar */
   .grw-navbar {
     .nav-item > .nav-link:hover {

+ 0 - 12
src/client/styles/scss/theme/_apply-colors.scss

@@ -167,18 +167,6 @@ $link-hover-color: $color-link-hover;
   }
 }
 
-/*
- * Crowi sidebar
- */
-.crowi-sidebar {
-  background-color: darken($bgcolor-global, 4%);
-  border-left: solid 1px $border-color;
-
-  .system-version {
-    background-color: darken($bgcolor-global, 4%);
-  }
-}
-
 /*
  * GROWI wiki
  */

+ 6 - 48
src/server/views/layout-kibela/widget/header.html

@@ -1,49 +1,7 @@
-<header id="page-header background-t">
-  <div class="d-flex align-items-center">
-    <div class="hidden-xs hidden-sm">
-      <a class="logo" href="/">
-        <div class="">{% include '../../widget/logo.html' %}</div>
-      </a>
-    </div>
-    <div class="title-container">
-      <h1 class="title" id="revision-path"></h1>
-      {% if not forbidden and not isTrashPage() %}
-        <div id="tag-label"></div>
-      {% endif %}
-    </div>
-    {% if page %}
+<div id="grw-subnav" class="grw-subnav" data-is-forbidden-page="{{ forbidden }}"></div>
 
-    <ul class="authors hidden-sm hidden-xs text-nowrap grw-pt-10px">
-      <li>
-        <div class="d-flex align-items-center b">
-          <a class="mr-2" href="{{ userPageRoot(page.creator) }}">
-            <img src="{{ page.creator|default(author)|picture }}" class="picture rounded-circle">
-          </a>
-          <div>
-            <div>Created by
-              <a href="{{ userPageRoot(page.creator) }}">{{ page.creator.name|default(author.name) }}</a>
-            </div>
-            <div class="text-muted">{{ page.createdAt|datetz('Y/m/d H:i:s') }}</div>
-          </div>
-        </div>
-      </li>
-      <li class="mt-2">
-        <div class="d-flex align-items-center">
-          <a class="mr-2" href="{{ userPageRoot(author) }}">
-            <img src="{{ author|picture }}" class="picture rounded-circle">
-          </a>
-          <div>
-            <div>Updated by
-              <a href="{{ userPageRoot(author) }}">{{ author.name }}</a>
-            </div>
-            <div class="text-muted">{{ page.updatedAt|datetz('Y/m/d H:i:s') }}</div>
-          </div>
-        </div>
-      </li>
-    </ul>
-    {% endif %} {% if not page and ('/' === path or 'crowi' === getConfig('crowi', 'customize:behavior')) and not isUserPageList(path) and !isTrashPage()
-    %} {% if '/' === path.slice(-1) %} {% include '../../widget/create_portal.html' %} {% endif %} {% endif %}
-
-  </div>
-
-</header>
+{% if not page and ('/' === path or 'crowi' === getConfig('crowi', 'customize:behavior')) and not isUserPageList(path) and !isTrashPage() %}
+  {% if '/' === path.slice(-1) %}
+    {% include '../../widget/create_portal.html' %}
+  {% endif %}
+{% endif %}