From 380c3f0c7559a8137570a525b72b1488fe0854bb Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 4 Apr 2016 16:14:55 -0700 Subject: [PATCH] Using boostrap panels for form fieldsets in explore view --- caravel/assets/javascripts/explore.js | 19 ++++++++++--------- caravel/assets/stylesheets/caravel.css | 23 ----------------------- caravel/templates/caravel/explore.html | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 43 deletions(-) diff --git a/caravel/assets/javascripts/explore.js b/caravel/assets/javascripts/explore.js index 7ad208bfd48f0..81d79f597d8cd 100644 --- a/caravel/assets/javascripts/explore.js +++ b/caravel/assets/javascripts/explore.js @@ -54,7 +54,7 @@ function prepForm() { }); } -function druidify(force, pushState) { +function query(force, pushState) { if (force === undefined) { force = false; } @@ -90,9 +90,9 @@ function initExploreView() { if (parent.hasClass("collapsed")) { if (animation) { - parent.find(".fieldset_content").slideDown(); + parent.find(".panel-body").slideDown(); } else { - parent.find(".fieldset_content").show(); + parent.find(".panel-body").show(); } parent.removeClass("collapsed"); parent.find("span.collapser").text("[-]"); @@ -104,9 +104,9 @@ function initExploreView() { } } else { // not collapsed if (animation) { - parent.find(".fieldset_content").slideUp(); + parent.find(".panel-body").slideUp(); } else { - parent.find(".fieldset_content").hide(); + parent.find(".panel-body").hide(); } parent.addClass("collapsed"); @@ -122,8 +122,9 @@ function initExploreView() { px.initFavStars(); - $('legend').click(function () { + $('form .panel-heading').click(function () { toggle_fieldset($(this), true); + $(this).css('cursor', 'pointer'); }); function copyURLToClipboard(url) { @@ -265,8 +266,8 @@ function initExploreView() { } }); - $(".druidify").click(function () { - druidify(true); + $(".query").click(function () { + query(true); }); function create_choices(term, data) { @@ -330,7 +331,7 @@ $(document).ready(function () { $('.slice').data('slice', slice); // call vis render method, which issues ajax - druidify(false, false); + query(false, false); // make checkbox inputs display as toggles $(':checkbox') diff --git a/caravel/assets/stylesheets/caravel.css b/caravel/assets/stylesheets/caravel.css index 0e6d793ec7d64..ae0cfa344eef3 100644 --- a/caravel/assets/stylesheets/caravel.css +++ b/caravel/assets/stylesheets/caravel.css @@ -116,25 +116,6 @@ span.title-block { font-size: 20px; } -fieldset.fs-style { - font-family: Verdana, Arial, sans-serif; - font-size: small; - font-weight: normal; - border: 1px solid #CCC; - background-color: #F4F4F4; - border-radius: 6px; - padding: 10px; - margin: 0px 0px 10px 0px; -} -legend.legend-style { - font-size: 14px; - padding: 0px 6px; - cursor: pointer; - margin: 0px; - color: #444; - background-color: transparent; - font-weight: bold; -} .nvtooltip { //position: relative !important; z-index: 888; @@ -142,10 +123,6 @@ legend.legend-style { .nvtooltip table td{ font-size: 11px !important; } -legend { - width: auto; - border-bottom: 0px; -} .navbar { -webkit-box-shadow: 0px 3px 3px #AAA; -moz-box-shadow: 0px 3px 3px #AAA; diff --git a/caravel/templates/caravel/explore.html b/caravel/templates/caravel/explore.html index da6cd79b8a090..d9ea3bb89c5ac 100644 --- a/caravel/templates/caravel/explore.html +++ b/caravel/templates/caravel/explore.html @@ -81,7 +81,7 @@
- {% if viz.form_data.slice_id %} @@ -96,9 +96,9 @@

{% for fieldset in form.fieldsets %} -
+
{% if fieldset.label %} - +
{{ fieldset.label }} {% if fieldset.description %} {% endif %} [-] - +
{% endif %} -
+
{% for fieldname in fieldset.fields %} {% if not fieldname %}
@@ -129,17 +129,17 @@ {% endif %} {% endfor %}
-
+
{% endfor %} -
- +
+
Filters [-] - -
+
+
+
{{ form.slice_id() }} {{ form.slice_name() }} {{ form.collapsed_fieldsets() }}