Răsfoiți Sursa

HUE-6077 [home] Move styles to less, unify colours and extend browser flex support

Johan Ahlen 8 ani în urmă
părinte
comite
1b3fc57c7e

+ 1 - 0
Gruntfile.js

@@ -34,6 +34,7 @@ module.exports = function(grunt) {
           banner: '/*!\nLicensed to Cloudera, Inc. under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  Cloudera, Inc. licenses this file\nto you under the Apache License, Version 2.0 (the\n"License"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n */'
         },
         files: {
+          'desktop/core/src/desktop/static/desktop/css/home.css': 'desktop/core/src/desktop/static/desktop/less/home.less',
           'desktop/core/src/desktop/static/desktop/css/hue.css': 'desktop/core/src/desktop/static/desktop/less/hue.less',
           'desktop/core/src/desktop/static/desktop/css/hue3-extra.css': 'desktop/core/src/desktop/static/desktop/less/hue3-extra.less',
           'desktop/core/src/desktop/static/desktop/css/login.css': 'desktop/core/src/desktop/static/desktop/less/login.less',

Fișier diff suprimat deoarece este prea mare
+ 16 - 0
desktop/core/src/desktop/static/desktop/css/home.css


+ 322 - 0
desktop/core/src/desktop/static/desktop/less/home.less

@@ -0,0 +1,322 @@
+/*
+ Licensed to Cloudera, Inc. under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  Cloudera, Inc. licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+@import (reference) "cui/colors.less";
+@import (reference) "cui/extra-variables.less";
+@import (reference) "hue-mixins.less";
+
+.doc-browser-container {
+  .display-flex();
+  .flex-direction(column);
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  right: 0;
+  left: 0;
+}
+
+.doc-browser-action-bar,
+.doc-browser-header {
+  .flex(0 0 auto);
+  .display-flex();
+  .flex-wrap(nowrap);
+  overflow: hidden;
+  padding: 2px;
+  clear: both;
+}
+
+.doc-browser-header {
+  border-bottom: 1px solid @cui-default-border-color;
+  letter-spacing: 0.035em;
+  font-size: 15px;
+  color: @cui-gray-700;
+}
+
+.doc-browser-empty {
+  letter-spacing: 0.035em;
+  font-size: 15px;
+  color: @cui-gray-700;
+  padding: 40px 0;
+  text-align: center;
+  -webkit-animation-name: fadeIn;
+  animation-name: fadeIn;
+}
+
+.doc-browser-list {
+  .flex(1 1 auto);
+  overflow-y: scroll;
+  overflow-x: hidden;
+}
+
+.doc-browser-breadcrumbs {
+  padding: 9px 9px;
+  margin: 0 10px 10px 10px;
+  list-style: none outside none;
+}
+
+.doc-browser-breadcrumbs li {
+  line-height: 54px;
+  padding: 0;
+  vertical-align: middle;
+  display: inline-block;
+  height: 36px;
+  border-bottom: 2px solid transparent;
+}
+
+.doc-browser-breadcrumbs .doc-browser-drop-target {
+  padding: 0 6px;
+}
+
+.doc-browser-container .active {
+  padding: 0 12px;
+  color: @cui-gray-800;
+}
+
+.doc-browser-breadcrumbs li:not(.divider):not(.active):hover {
+  border-bottom: @hue-primary-color-dark;
+}
+
+.doc-browser-breadcrumbs a {
+  color: @hue-primary-color-dark !important;
+}
+
+.doc-browser-breadcrumbs a:hover {
+  text-decoration: none;
+}
+
+.doc-browser-main-header {
+  position: relative;
+}
+
+.doc-browser-folder-actions {
+  display: inline-block;
+  position: absolute;
+  right: 10px;
+  top: 14px;
+  height: 50px;
+  line-height: 50px;
+}
+
+.doc-browser-folder-actions > div {
+  float: left;
+}
+
+.doc-browser-list {
+  padding: 4px 0;
+}
+
+.doc-browser-entries {
+  list-style: none;
+  margin: 0;
+}
+
+.doc-browser-entries > li {
+  clear: both;
+  line-height: 42px;
+  border: 1px solid transparent;
+  margin: 1px;
+  color: @cui-gray-800;
+  font-size: 14px;
+  cursor: pointer;
+}
+
+.doc-browser-entries > li:hover:not(.doc-browser-selected) {
+  background-color: @cui-blue-050;
+}
+
+.doc-browser-selected {
+  background-color: @cui-blue-100;
+}
+
+.doc-browser-list i {
+  color: @hue-primary-color-dark;
+  font-size: 20px;
+  font-weight: lighter;
+}
+
+.doc-browser-list .hi {
+  color: @hue-primary-color-dark;
+  font-size: 24px;
+}
+
+.doc-browser-action {
+  font-size: 25px;
+  margin-left: 5px;
+}
+
+.doc-browser-row {
+  .display-flex();
+  .flex-wrap(nowrap);
+  width: 100%;
+  height: 100%;
+}
+
+.doc-browser-primary-col {
+  .flex(2);
+  vertical-align: middle;
+  padding-left: 8px;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  padding-right: 20px;
+}
+
+.doc-browser-header .doc-browser-primary-col {
+  height: 30px;
+  line-height: 30px;
+}
+
+.doc-browser-row .doc-browser-primary-col {
+  height: 42px;
+}
+
+.doc-browser-primary-col .fa {
+  vertical-align: middle;
+}
+
+.doc-browser-attr-group {
+  .flex(1);
+  white-space: nowrap;
+  float: right;
+  display: inline-block;
+  height: 30px;
+}
+
+.doc-browser-row .doc-browser-attr-group {
+  height: 42px;
+}
+
+.doc-browser-attr-col {
+  display: inline-block;;
+  height: 30px;
+  line-height: 30px;
+  vertical-align: middle;
+  padding-right: 20px;
+}
+
+.doc-browser-row a {
+  text-decoration: none;
+}
+
+.doc-browser-row .doc-browser-attr-col {
+  margin-bottom: 2px;
+}
+
+.doc-browser-shared-icon-active {
+  color: @hue-primary-color-dark !important;
+}
+
+.doc-browser-type {
+  width: 140px;
+}
+
+.doc-browser-owner {
+  width: 170px;
+}
+
+.doc-browser-modified {
+  width: 150px;
+}
+
+.doc-browser-drag-container {
+  position: fixed;
+}
+
+.doc-browser-drag-select {
+  position: fixed;
+  border: 1px solid @hue-primary-color-dark;
+  cursor: pointer;
+}
+
+.doc-browser-drag-helper {
+  display: none;
+  position: absolute;
+  width: auto;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  top: -15px;
+  left: 10px;
+  height: 30px;
+  line-height: 30px;
+  vertical-align: middle;
+  padding: 1px 12px 1px 7px;
+  cursor: pointer;
+  background-color: @hue-primary-color-dark;
+  color: @hue-primary-color-light;
+  border-radius: 2px;
+  z-index: 1000;
+}
+
+.doc-browser-drag-helper i {
+  line-height: 30px;
+  vertical-align: middle;
+  margin-right: 8px;
+  font-size: 16px;
+}
+
+.doc-browser-drop-target {
+  border: 1px solid transparent;
+}
+
+.doc-browser-drop-hover {
+  border: 1px solid @hue-primary-color-dark !important;
+}
+
+.hue-breadcrumbs-bar a {
+  color: @hue-primary-color-dark !important;
+  display: inline !important;
+}
+
+.divider {
+  color: @cui-gray-300;
+}
+
+.large-as-modal {
+  width: 95%;
+}
+
+@-webkit-keyframes doc-browser-search-visible {
+  from { opacity: 0; }
+  to { opacity: 1; }
+}
+
+@keyframes doc-browser-search-visible {
+  from { opacity: 0; }
+  to { opacity: 1; }
+}
+
+.doc-browser-search-container {
+  margin-top: 5px;
+  margin-right: 6px;
+  -webkit-animation-name: doc-browser-search-visible;
+  animation-name: doc-browser-search-visible;
+  -webkit-animation-duration: 0.4s;
+  animation-duration: 0.4s;
+}
+
+.doc-browser-search-container input {
+  width: 300px;
+}
+
+.typeahead .active {
+  padding: 0;
+}
+
+.document-types .app-icon {
+  margin-right: 4px;
+}

+ 16 - 10
desktop/core/src/desktop/static/desktop/less/hue-mixins.less

@@ -113,6 +113,18 @@
   flex: @flex;
 }
 
+.flex-align-items(@align: stretch) {
+  -webkit-align-items: @align;
+  -ms-align-items: @align;
+  align-items: @align;
+}
+
+.flex-basis(@basis) {
+  -webkit-flex-basis: @basis;
+  -ms-flex-basis: @basis;
+  flex-basis: @basis;
+}
+
 .flex-direction(@direction: row) {
   -webkit-flex-direction: @direction;
   -ms-flex-direction: @direction;
@@ -125,14 +137,8 @@
   flex-flow: @flow;
 }
 
-.flex-align-items(@align: stretch) {
-  -webkit-align-items: @align;
-  -ms-align-items: @align;
-  align-items: @align;
-}
-
-.flex-basis(@basis) {
-  -webkit-flex-basis: @basis;
-  -ms-flex-basis: @basis;
-  flex-basis: @basis;
+.flex-wrap(@wrap: nowrap) {
+  -webkit-flex-wrap: @wrap;
+  -ms-flex-wrap: @wrap;
+  flex-wrap: @wrap;
 }

+ 1 - 311
desktop/core/src/desktop/templates/document_browser.mako

@@ -25,319 +25,9 @@ from desktop.views import _ko
 
   <script src="${ static('desktop/ext/js/bootstrap-fileupload.js') }" type="text/javascript" charset="utf-8"></script>
   <script src="${ static('desktop/ext/js/jquery/plugins/jquery.hotkeys.js') }"></script>
+  <link rel="stylesheet" href="/static/desktop/css/home.css">
   <link rel="stylesheet" href="/static/desktop/ext/css/bootstrap-fileupload.css">
 
-  <style>
-    .doc-browser-container {
-      position: absolute;
-      top: 0;
-      bottom: 0;
-      right: 0;
-      left: 0;
-      display: flex;
-      flex-direction: column;
-    }
-
-    .doc-browser-action-bar,
-    .doc-browser-header {
-      -ms-flex: 0 0 auto;
-      flex: 0 0 auto;
-      overflow: hidden;
-      padding: 2px;
-      clear: both;
-      display: -ms-flexbox;
-      display: flex;
-      -ms-flex-wrap: nowrap;
-      flex-wrap: nowrap;
-    }
-
-    .doc-browser-header {
-      border-bottom: 1px solid #f1f1f1;
-      letter-spacing: 0.035em;
-      font-size: 15px;
-      color: #737373;
-    }
-
-    .doc-browser-empty {
-      letter-spacing: 0.035em;
-      font-size: 15px;
-      color: #737373;
-      padding: 40px 0;
-      text-align: center;
-      -webkit-animation-name: fadeIn;
-      animation-name: fadeIn;
-    }
-
-    .doc-browser-list {
-      -ms-flex: 1 1 auto;
-      flex: 1 1 auto;
-      overflow-y: scroll;
-      overflow-x: hidden;
-    }
-
-    .doc-browser-breadcrumbs {
-      padding: 9px 9px;
-      margin: 0 10px 10px 10px;
-      list-style: none outside none;
-    }
-
-    .doc-browser-breadcrumbs li {
-      line-height: 54px;
-      padding: 0;
-      vertical-align: middle;
-      display: inline-block;
-      height: 36px;
-      border-bottom: 2px solid transparent;
-    }
-
-    .doc-browser-breadcrumbs .doc-browser-drop-target {
-      padding: 0 6px;
-    }
-
-    .doc-browser-container .active {
-      padding: 0 12px;
-      color: #444;
-    }
-
-    .doc-browser-breadcrumbs li:not(.divider):not(.active):hover {
-      border-bottom: 2px solid #0B7FAD;
-    }
-
-    .doc-browser-breadcrumbs a {
-      color: #0B7FAD !important;
-    }
-
-    .doc-browser-breadcrumbs a:hover {
-      text-decoration: none;
-    }
-
-    .doc-browser-main-header {
-      position: relative;
-    }
-
-    .doc-browser-folder-actions {
-      display: inline-block;
-      position: absolute;
-      right: 10px;
-      top: 14px;
-      height: 50px;
-      line-height: 50px;
-    }
-
-    .doc-browser-folder-actions > div {
-      float: left;
-    }
-
-    .doc-browser-list {
-      padding: 4px 0;
-    }
-
-    .doc-browser-entries {
-      list-style: none;
-      margin: 0;
-    }
-
-    .doc-browser-entries > li {
-      clear: both;
-      line-height: 42px;
-      border: 1px solid transparent;
-      margin: 1px;
-      color: #444;
-      font-size: 14px;
-      cursor: pointer;
-    }
-
-    .doc-browser-entries > li:hover:not(.doc-browser-selected) {
-      background-color: #E8F5FE;
-    }
-
-    .doc-browser-selected {
-      background-color: #DBE8F1;
-    }
-
-    .doc-browser-list i {
-      color: #0B7FAD;
-      font-size: 20px;
-      font-weight: lighter;
-    }
-
-    .doc-browser-list .hi {
-      color: #0B7FAD;
-      font-size: 24px;
-    }
-
-    .doc-browser-action {
-      font-size: 25px;
-      margin-left: 5px;
-    }
-
-    .doc-browser-row {
-      display: -ms-flexbox;
-      display: flex;
-      -ms-flex-wrap: nowrap;
-      flex-wrap: nowrap;
-      width: 100%;
-      height: 100%;
-    }
-
-    .doc-browser-primary-col {
-      -ms-flex: 2;
-      flex: 2;
-      vertical-align: middle;
-      padding-left: 8px;
-      white-space: nowrap;
-      text-overflow: ellipsis;
-      overflow: hidden;
-      padding-right: 20px;
-    }
-
-    .doc-browser-header .doc-browser-primary-col {
-      height: 30px;
-      line-height: 30px;
-    }
-
-    .doc-browser-row .doc-browser-primary-col {
-      height: 42px;
-    }
-
-    .doc-browser-primary-col .fa {
-      vertical-align: middle;
-    }
-
-    .doc-browser-attr-group {
-      -ms-flex: 1;
-      flex: 1;
-      white-space: nowrap;
-      float: right;
-      display: inline-block;
-      height: 30px;
-    }
-
-    .doc-browser-row .doc-browser-attr-group {
-      height: 42px;
-    }
-
-    .doc-browser-attr-col {
-      display: inline-block;;
-      height: 30px;
-      line-height: 30px;
-      vertical-align: middle;
-      padding-right: 20px;
-    }
-
-    .doc-browser-row a {
-      text-decoration: none;
-    }
-
-    .doc-browser-row .doc-browser-attr-col {
-      margin-bottom: 2px;
-    }
-
-    .doc-browser-shared-icon-active {
-      color: #0B7FAD !important;
-    }
-
-    .doc-browser-type {
-      width: 140px;
-    }
-
-    .doc-browser-owner {
-      width: 170px;
-    }
-
-    .doc-browser-modified {
-      width: 150px;
-    }
-
-    .doc-browser-drag-container {
-      position: fixed;
-    }
-
-    .doc-browser-drag-select {
-      position: fixed;
-      border: 1px solid #0B7FAD;
-      cursor: pointer;
-    }
-
-    .doc-browser-drag-helper {
-      display: none;
-      position: absolute;
-      width: auto;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-      top: -15px;
-      left: 10px;
-      height: 30px;
-      line-height: 30px;
-      vertical-align: middle;
-      padding: 1px 12px 1px 7px;
-      cursor: pointer;
-      background-color: #0B7FAD;
-      color: #DBE8F1;
-      border-radius: 2px;
-      z-index: 1000;
-    }
-
-    .doc-browser-drag-helper i {
-      line-height: 30px;
-      vertical-align: middle;
-      margin-right: 8px;
-      font-size: 16px;
-    }
-
-    .doc-browser-drop-target {
-      border: 1px solid transparent;
-    }
-
-    .doc-browser-drop-hover {
-      border: 1px solid #0B7FAD !important;
-    }
-
-    .hue-breadcrumbs-bar a {
-      color: #0B7FAD !important;
-      display: inline !important;
-    }
-
-    .divider {
-      color: #CCC;
-    }
-
-    .large-as-modal {
-      width: 95%;
-    }
-
-    @-webkit-keyframes doc-browser-search-visible {
-      from { opacity: 0; }
-      to { opacity: 1; }
-    }
-
-    @keyframes doc-browser-search-visible {
-      from { opacity: 0; }
-      to { opacity: 1; }
-    }
-
-    .doc-browser-search-container {
-      margin-top: 5px;
-      margin-right: 6px;
-      -webkit-animation-name: doc-browser-search-visible;
-      animation-name: doc-browser-search-visible;
-      -webkit-animation-duration: 0.4s;
-      animation-duration: 0.4s;
-    }
-
-    .doc-browser-search-container input {
-      width: 300px;
-    }
-
-    .typeahead .active {
-      padding: 0;
-    }
-
-    .document-types .app-icon {
-      margin-right: 4px;
-    }
-  </style>
-
   <script type="text/html" id="doc-browser-template">
     <div class="doc-browser-drag-helper">
       <i class="fa fa-fw"></i><span class="drag-text">4 entries</span>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff