diff --git a/.ebextensions/nginx.config b/.ebextensions/nginx.config index 2de57bf..1da0d28 100644 --- a/.ebextensions/nginx.config +++ b/.ebextensions/nginx.config @@ -23,11 +23,9 @@ files: text/csv attachment; } - include mime.types; types { application/x-font-ttf ttc ttf; text/csv csv; - text/plain txt; } server { @@ -39,7 +37,7 @@ files: gzip on; gzip_comp_level 4; - gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript text/csv; if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") { set $year $1; diff --git a/requirements.txt b/requirements.txt index 42ad3b6..3ad407d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -e git+https://github.com/simonw/csvs-to-sqlite.git@2830a5850cdd018c11247cde08a199aff1255205#egg=csvs_to_sqlite --e git+https://github.com/simonw/datasette.git@0.14#egg=datasette +-e git+https://github.com/simonw/datasette.git@0.19#egg=datasette aiofiles==0.3.2 click-default-group==1.2 click==6.7 @@ -9,6 +9,8 @@ Jinja2==2.10 MarkupSafe==1.0 numpy==1.14.0 pandas==0.20.3 +Pint==0.8.1 +pluggy==0.6.0 py-lru-cache==0.1.4 python-dateutil==2.6.1 pytz==2017.3 diff --git a/static/css/app.v2.css b/static/css/app.v2.css index 9268619..2263859 100644 --- a/static/css/app.v2.css +++ b/static/css/app.v2.css @@ -535,21 +535,30 @@ hr { text-align: center; } .rangeselector, -.dbsearch, .back-btn, a.back-btn { - position: relative; - display: inline-block; - width: 260px; - height: auto; - padding: 15px; - margin: 10px; - font-size: 16px; - border-radius: 8px; +.dbsearch, +.back-btn, +a.back-btn { background-color: #3c9076; + border-radius: 8px; color: white; + display: inline-block; + font-size: 16px; font-weight: bold; - vertical-align: top; + height: auto; + margin: 10px; + padding: 15px; + position: relative; text-align: center; + vertical-align: top; + width: 260px; } + +.back-btn:hover, +a.back-btn:hover { + background-color: #9ee6d0; + text-decoration: none; +} + .roundcaveat { color: #9ee6d0; } diff --git a/templates/error.html b/templates/500.html similarity index 50% rename from templates/error.html rename to templates/500.html index 8e661f8..0e9958a 100644 --- a/templates/error.html +++ b/templates/500.html @@ -13,14 +13,16 @@
{{ error }}
{% endif %} -
-

Custom SQL query

+{% if database %} + +

Custom SQL query

-

+

-

-
+

+ -{% include "_codemirror_foot.html" %} + {% include "_codemirror_foot.html" %} +{% endif %} {% endblock %} diff --git a/templates/_rows_and_columns.html b/templates/_rows_and_columns.html index ba04b4a..b8514f6 100644 --- a/templates/_rows_and_columns.html +++ b/templates/_rows_and_columns.html @@ -6,8 +6,17 @@ {% for column in display_columns %} - - {{ col_name[column] | default(column) }} + {% set name = col_name[column.name] | default(column.name) %} + + {% if not column.sortable %} + {{ name }} + {% else %} + {% if column.name == sort %} + {{ name }} ▲ + {% else %} + {{ name }}{% if column.name == sort_desc %} ▼{% endif %} + {% endif %} + {% endif %} {% endfor %} diff --git a/templates/base.html b/templates/base.html index d40ce43..a187bf9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -106,7 +106,7 @@ General Assembly Public universities State police - Top Earners + Top Earners
diff --git a/templates/database.html b/templates/database.html index c079688..20c530c 100644 --- a/templates/database.html +++ b/templates/database.html @@ -13,7 +13,7 @@

Custom SQL query

Note: Database uses SQLite syntax.

-

+

diff --git a/templates/query.html b/templates/query.html index 48f0e05..f4304af 100644 --- a/templates/query.html +++ b/templates/query.html @@ -52,7 +52,7 @@

{{ canned_query.replace("-", " ") }}

Custom SQL query{% if rows %} returning {% if truncated %}more than {% endif %}{{ "{:,}".format(rows|length) }} row{% if rows|length == 1 %}{% else %}s{% endif %}{% endif %}

{% if editable %} -

+

{% else %}
{% if query %}{{ query.sql }}{% endif %}
{% endif %} diff --git a/templates/table.html b/templates/table.html index 7c76b9e..de46d19 100644 --- a/templates/table.html +++ b/templates/table.html @@ -40,7 +40,6 @@ {% endfor %}
- Filter:
-
+ + {% if is_sortable %} +
+ Sort by: +
+ +
+ +
+ {% endif %} + + Back to main search