Skip to content

Commit

Permalink
Tackling Featured Datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Feb 25, 2016
1 parent 71b1111 commit 30ecfae
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 57 deletions.
45 changes: 45 additions & 0 deletions panoramix/assets/html/featured.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% extends "refactor/basic.html" %}
{% block body %}
<div class="container">
<div class="header">
<h3><i class='fa fa-star'></i> Featured Datasets </h3>
</div>
<hr/>
<table class="table table-hover dataTable table-bordered" id="dataset-table" style="display:None">
<thead>
<tr>
<th>Table</th>
<th>Database</th>
<th>Owner</th>
<th></th>
</tr>
</thead>
<tbody>
{% for dataset in featured_datasets %}
<tr>
<td>
<div class="intable-longtext">
<h4>{{ dataset.table_name }}</h4>
<p>{{ utils.markdown(dataset.description) | safe }}</p>
</div>
</td>
<td class="small_table">{{ dataset.database }}</td>
<td class="small_table">{{ dataset.owner }}</td>
<td class="small_table"><a class="btn btn-default" href="{{ dataset.default_endpoint }}"><i class='fa fa-line-chart'/></a></td>
</tr>
{% endfor %}
</tbody>
</table>
<hr/>
</div>
{% endblock %}

{% block head_css %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="/static/assets/node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css" />
{% endblock %}

{% block tail_js %}
{{ super() }}
<script src="/static/assets/javascripts/dist/featured.entry.js"></script>
{% endblock %}
14 changes: 14 additions & 0 deletions panoramix/assets/javascripts/featured.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var $ = window.$ = require('jquery');
var jQuery = window.jQuery = $;
require('datatables');
require('datatables-bootstrap3-plugin');
require('bootstrap');

$(document).ready(function() {
$('#dataset-table').DataTable({
"bPaginate": false,
"order": [[ 1, "asc" ]]
});
$('#dataset-table_info').remove();
$('#dataset-table').show();
} );
1 change: 1 addition & 0 deletions panoramix/assets/javascripts/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var $ = window.$ = require('jquery');
var jQuery = window.jQuery = $;
require('select2');
require('datatables');
require('bootstrap');

var ace = require('brace');
require('brace/mode/sql');
Expand Down
1 change: 1 addition & 0 deletions panoramix/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"d3-tip": "^0.6.7",
"d3.layout.cloud": "^1.2.0",
"datatables": "^1.10.9",
"datatables-bootstrap3-plugin": "^0.4.0",
"exports-loader": "^0.6.3",
"font-awesome": "^4.5.0",
"gridster": "^0.5.6",
Expand Down
1 change: 1 addition & 0 deletions panoramix/assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var config = {
//dashboard: APP_DIR + '/javascripts/dist/dashboard.js',
explore: APP_DIR + '/javascripts/explore.js',
sql: APP_DIR + '/javascripts/sql.js',
featured: APP_DIR + '/javascripts/featured.js',
},
output: {
path: BUILD_DIR,
Expand Down
54 changes: 0 additions & 54 deletions panoramix/templates/panoramix/featured_datasets.html

This file was deleted.

6 changes: 3 additions & 3 deletions panoramix/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ def show_traceback(self):
art=ascii_art.error), 500

@has_access
@expose("/featured_datasets", methods=['GET'])
def featured_datasets(self):
@expose("/featured", methods=['GET'])
def featured(self):
session = db.session()
datasets_sqla = (
session.query(models.SqlaTable)
Expand All @@ -718,7 +718,7 @@ def featured_datasets(self):
)
featured_datasets = datasets_sqla + datasets_druid
return self.render_template(
'panoramix/featured_datasets.html',
'refactor/featured.html',
featured_datasets=featured_datasets,
utils=utils)

Expand Down

0 comments on commit 30ecfae

Please sign in to comment.