diff --git a/datasette/app.py b/datasette/app.py index 2b82c70f..82ea26fe 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -528,12 +528,14 @@ class TableView(RowTableShared): fts_table = fts_rows[0][0] search = special_args.get('_search') + search_description = None if search and fts_table: where_clauses.append( 'rowid in (select rowid from [{fts_table}] where [{fts_table}] match :search)'.format( fts_table=fts_table ) ) + search_description = 'search matches "{}"'.format(search) params['search'] = search next = special_args.get('_next') @@ -642,10 +644,13 @@ class TableView(RowTableShared): # Almost certainly hit the timeout pass + # human_filter_description combines filters AND search, if provided + human_description = filters.human_description(extra=search_description) + async def extra_template(): return { 'database_hash': hash, - 'human_filter_description': filters.human_description(), + 'human_filter_description': human_description, 'supports_search': bool(fts_table), 'search': search or '', 'use_rowid': use_rowid, diff --git a/datasette/static/app.css b/datasette/static/app.css index d3625b96..13ea503f 100644 --- a/datasette/static/app.css +++ b/datasette/static/app.css @@ -1,4 +1,3 @@ - body { margin: 0 1em; font-family: "Helvetica Neue", sans-serif; @@ -107,11 +106,12 @@ form label { form input[type=text], form input[type=search] { border: 1px solid #ccc; + border-radius: 3px; width: 60%; padding: 9px 4px; - font-family: monospace; display: inline-block; - font-size: 1.1em; + font-size: 1em; + font-family: Helvetica, sans-serif; } @media only screen and (max-width: 576px) { form.sql textarea { @@ -137,6 +137,16 @@ form input[type=submit] { .filter-row { margin-bottom: 0.6em; } +.search-row { + margin-bottom: 1.8em; +} + +.search-row label { + font-size: 1.2em; + padding-right: 0.5em; + display: inline-block; + width: 80px; +} .select-wrapper { border: 1px solid #ccc; diff --git a/datasette/templates/table.html b/datasette/templates/table.html index 572a8819..77d4d8b6 100644 --- a/datasette/templates/table.html +++ b/datasette/templates/table.html @@ -24,13 +24,10 @@ {% endif %} -{% if supports_search %} -
-{% endif %} -