From 9b3b1f69dfc2d2e31c54e578647e6aa1a491d397 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 10 Aug 2016 22:59:35 -0700 Subject: [PATCH] Fixes explore view when no slice is defined (#924) --- .../assets/javascripts/explore/explore.jsx | 2 +- .../assets/stylesheets/less/bootswatch.less | 38 ++++++++++++------- caravel/templates/appbuilder/navbar.html | 2 +- caravel/templates/caravel/explore.html | 32 +++++++++++----- 4 files changed, 50 insertions(+), 24 deletions(-) diff --git a/caravel/assets/javascripts/explore/explore.jsx b/caravel/assets/javascripts/explore/explore.jsx index 3c4a160ff06a9..47d833b2a05d3 100644 --- a/caravel/assets/javascripts/explore/explore.jsx +++ b/caravel/assets/javascripts/explore/explore.jsx @@ -476,7 +476,7 @@ $(document).ready(function () { initExploreView(); // Dynamically register this visualization - px.registerViz(data.viz_name); + px.registerViz(data.viz_name || 'table'); slice = px.Slice(data); diff --git a/caravel/assets/stylesheets/less/bootswatch.less b/caravel/assets/stylesheets/less/bootswatch.less index 62eb9a60794f8..2223157f26c8e 100644 --- a/caravel/assets/stylesheets/less/bootswatch.less +++ b/caravel/assets/stylesheets/less/bootswatch.less @@ -44,13 +44,18 @@ background-size: 200%; background-position: 50%; + border: 1px solid #AAA; + &:focus { background-color: @bg; + outline:0; } &:hover, &:active:hover { - background-color: darken(@bg, 6%); + background-color: darken(@bg, 12%); + border: 1px solid #888; + .box-shadow(0px 0px 2px rgba(0,0,0,.4)); } &:active { @@ -73,7 +78,7 @@ } .btn { text-transform: uppercase; - .box-shadow(0px 0px 2px rgba(0,0,0,.4)); + border: 1px solid #AAA; .transition(all 0.4s); &-link { @@ -102,7 +107,7 @@ .btn + .btn-group, .btn-group + .btn, .btn-group + .btn-group { - margin-left: 0; + margin-left: -1; } &-vertical { @@ -132,8 +137,9 @@ button { letter-spacing: .1px; } -a { +tbody a { .transition(all 0.2s); + text-decoration: underline; } // Tables ===================================================================== @@ -414,27 +420,33 @@ input[type="checkbox"], .nav-tabs { > li > a, - > li > a:hover + > li > a:hover, > li > a:focus { - margin-right: 0; - background-color: transparent; - border: 1px solid #ccc; + padding: 3px 10px; + background-color: #ddd; + border: 1px solid #aaa; + color: #888; margin-right: 1px; - border-radius: 10px 10px 0px 0px; - color: @navbar-default-link-color; + border-radius: 5px 5px 0px 0px; .transition(all 0.2s); &:hover { - color: @brand-primary; + margin-right: 1px; + border-color: #aaa; + background-color: #eee; + color: black; } } & > li.active > a, - & > li.active > a:hover + & > li.active > a:hover, & > li.active > a:focus { + padding: 3px 10px; border: 1px solid #aaa; - border-bottom: 3px solid black; + border-radius: 5px 5px 0px 0px; + color: @brand-primary; + background-color: #fff; margin-right: 1px; &:hover { color: @brand-primary; diff --git a/caravel/templates/appbuilder/navbar.html b/caravel/templates/appbuilder/navbar.html index fd1d01fb6dcfd..d997b8dbd9cd3 100644 --- a/caravel/templates/appbuilder/navbar.html +++ b/caravel/templates/appbuilder/navbar.html @@ -10,7 +10,7 @@ - +
@@ -172,14 +172,28 @@ {% block messages %}{% endblock %} {% include 'appbuilder/flash.html' %}
- -
{{slice.slice_name}}
- - {% if slice.description %} - - {% endif %} - - + {% if slice %} + +
{{ slice.slice_name }}
+ + {% if slice.description %} + + + {% endif %} + + + {% else %} +
 
+ {% endif %}
cached