diff --git a/caravel/assets/images/favicon.png b/caravel/assets/images/favicon.png index 77fd477de..264be6930 100644 Binary files a/caravel/assets/images/favicon.png and b/caravel/assets/images/favicon.png differ diff --git a/caravel/assets/javascripts/welcome.js b/caravel/assets/javascripts/welcome.js index 90841313a..d4d518f6f 100644 --- a/caravel/assets/javascripts/welcome.js +++ b/caravel/assets/javascripts/welcome.js @@ -4,12 +4,13 @@ var jQuery = window.jQuery = $; require('../stylesheets/caravel.css'); require('../stylesheets/welcome.css'); require('bootstrap'); -require('datatables'); +require('datatables.net-bs'); +require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'); require('../node_modules/cal-heatmap/cal-heatmap.css'); var CalHeatMap = require('cal-heatmap'); -function modelViewTable(selector, modelEndpoint, ordering) { +function modelViewTable(selector, modelEndpoint) { // Builds a dataTable from a flask appbuilder api endpoint $.getJSON(modelEndpoint + '/api/read', function (data) { var tableData = jQuery.map(data.result, function (el, i) { @@ -21,13 +22,24 @@ function modelViewTable(selector, modelEndpoint, ordering) { var cols = jQuery.map(data.list_columns, function (col, i) { return { sTitle: data.label_columns[col] }; }); + var panel = $(selector).parents('.panel'); + panel.find("img.loading").remove(); $(selector).DataTable({ aaData: tableData, aoColumns: cols, - bPaginate: false, - order: ordering, - searching: false + bPaginate: true, + pageLength: 10, + bLengthChange: false, + aaSorting: [], + searching: true }); + + var search = panel.find(".dataTables_filter input"); + search.addClass('form-control').detach(); + search.appendTo(panel.find(".search")); + panel.find('.dataTables_filter').remove(); + + $(selector).slideDown(); $('[data-toggle="tooltip"]').tooltip({ container: 'body' }); }); } diff --git a/caravel/assets/package.json b/caravel/assets/package.json index fb5c5e68c..ccebcdb79 100644 --- a/caravel/assets/package.json +++ b/caravel/assets/package.json @@ -51,7 +51,7 @@ "d3-tip": "^0.6.7", "datamaps": "^0.4.4", "datatables-bootstrap3-plugin": "^0.4.0", - "datatables.net": "^1.10.11", + "datatables.net-bs": "^1.10.11", "exports-loader": "^0.6.3", "font-awesome": "^4.5.0", "gridster": "^0.5.6", diff --git a/caravel/assets/stylesheets/welcome.css b/caravel/assets/stylesheets/welcome.css index d8760f694..54c2a21d9 100644 --- a/caravel/assets/stylesheets/welcome.css +++ b/caravel/assets/stylesheets/welcome.css @@ -1,21 +1,17 @@ -.welcome .widget{ - border-radius: 0; - border: 1px solid #ccc; - box-shadow: 2px 1px 5px -2px #aaa; - background-color: #fff; -} - -.welcome .widget .header { - background-color: #f1f1f1; - text-align: center; -} - -.welcome .widget>div { - padding: 3px; - overflow: auto; - max-height: 500px; -} - .table i { padding-top: 6px; } + +img.loading { + width: 25px; +} + +.welcome table { + display: none; + width: 100%; +} + +input { + margin-left: 5px; + margin-top: 8px; +} diff --git a/caravel/assets/visualizations/pivot_table.js b/caravel/assets/visualizations/pivot_table.js index 795adbb29..655895c8e 100644 --- a/caravel/assets/visualizations/pivot_table.js +++ b/caravel/assets/visualizations/pivot_table.js @@ -1,7 +1,7 @@ var $ = window.$ = require('jquery'); var jQuery = window.jQuery = $; -require('datatables'); +require('datatables.net-bs'); require('./pivot_table.css'); require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'); diff --git a/caravel/assets/visualizations/table.js b/caravel/assets/visualizations/table.js index d819fc3f5..ea3e9a0ed 100644 --- a/caravel/assets/visualizations/table.js +++ b/caravel/assets/visualizations/table.js @@ -3,7 +3,7 @@ var jQuery = window.jQuery = $; var d3 = require('d3'); require('./table.css'); -require('datatables'); +require('datatables.net-bs'); require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'); function tableVis(slice) { diff --git a/caravel/templates/caravel/base.html b/caravel/templates/caravel/base.html index bab571bbc..2dacdffce 100644 --- a/caravel/templates/caravel/base.html +++ b/caravel/templates/caravel/base.html @@ -1,7 +1,7 @@ {% extends "appbuilder/baselayout.html" %} {% block head_css %} - + {{super()}} {% endblock %} diff --git a/caravel/templates/caravel/basic.html b/caravel/templates/caravel/basic.html index 39e6734c0..d210298cf 100644 --- a/caravel/templates/caravel/basic.html +++ b/caravel/templates/caravel/basic.html @@ -8,7 +8,7 @@ {% block head_meta %}{% endblock %} {% block head_css %} - + {% endblock %} {% block head_js %} diff --git a/caravel/templates/caravel/welcome.html b/caravel/templates/caravel/welcome.html index 42bb6556c..4d614a2c0 100644 --- a/caravel/templates/caravel/welcome.html +++ b/caravel/templates/caravel/welcome.html @@ -17,18 +17,44 @@
-
-

Dashboards

-
-
+
+
+
+
+ +
Dashboards
+
+ + +
+
+
+
+
+
+ +
-
-

Slices

-
-
+
+
+
+
+ +
Slices
+
+ + +
+
+
+
+
+
+ +
diff --git a/caravel/views.py b/caravel/views.py index d58473921..34b8284aa 100644 --- a/caravel/views.py +++ b/caravel/views.py @@ -248,6 +248,9 @@ class SliceAsync(SliceModelView): # noqa 'created_by_', 'modified', 'icons'] label_columns = { 'icons': ' ', + 'created_by_': 'Creator', + 'viz_type': 'Type', + 'slice_link': 'Slice', } appbuilder.add_view_no_menu(SliceAsync) @@ -298,6 +301,10 @@ appbuilder.add_view( class DashboardModelViewAsync(DashboardModelView): # noqa list_columns = ['dashboard_link', 'created_by_', 'modified'] + label_columns = { + 'created_by_': 'Creator', + 'dashboard_link': 'Dashboard', + } appbuilder.add_view_no_menu(DashboardModelViewAsync)