-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from mistercrunch/featured_datasets
Featured datasets
- Loading branch information
Showing
5 changed files
with
123 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""is_featured | ||
Revision ID: 12d55656cbca | ||
Revises: 55179c7f25c7 | ||
Create Date: 2015-12-14 13:37:17.374852 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '12d55656cbca' | ||
down_revision = '55179c7f25c7' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.add_column('tables', sa.Column('is_featured', sa.Boolean(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('tables', 'is_featured') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""user_id | ||
Revision ID: 2591d77e9831 | ||
Revises: 12d55656cbca | ||
Create Date: 2015-12-15 17:02:45.128709 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '2591d77e9831' | ||
down_revision = '12d55656cbca' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table('tables') as batch_op: | ||
batch_op.add_column(sa.Column('user_id', sa.Integer())) | ||
batch_op.create_foreign_key('user_id', 'ab_user', ['user_id'], ['id']) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table('tables') as batch_op: | ||
batch_op.drop_constraint('user_id', type_='foreignkey') | ||
batch_op.drop_column('user_id') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% extends "panoramix/base.html" %} | ||
{% block content %} | ||
<h1><i class='fa fa-star'></i> Featured Datasets </h1> | ||
<hr/> | ||
<table class="table table-hover dataTable" 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> | ||
<h4>{{ dataset.table_name }}</h4> | ||
<p>{{ dataset.description }}</p> | ||
</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> | ||
{% endblock %} | ||
|
||
{% block head_css %} | ||
{{ super() }} | ||
<link rel="stylesheet" type="text/css" href="/static/lib/dataTables/dataTables.bootstrap.css" /> | ||
{% endblock %} | ||
|
||
{% block tail_js %} | ||
{{ super() }} | ||
<script src="/static/lib/dataTables/jquery.dataTables.min.js"></script> | ||
<script src="/static/lib/dataTables/dataTables.bootstrap.js"></script> | ||
<script> | ||
$(document).ready(function() { | ||
$('#dataset-table').DataTable({ | ||
"bPaginate": false, | ||
"order": [[ 1, "asc" ]] | ||
}); | ||
$('#dataset-table').show(); | ||
} ); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters