From 38dc1ef73b13e5ae9f05ca5e7c86fa3eb639e628 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 22 Nov 2017 20:43:27 -0800 Subject: [PATCH] Show linked foreign key in table cells --- datasette/app.py | 2 +- datasette/static/app.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/datasette/app.py b/datasette/app.py index c71968fc..3ff5267e 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -626,7 +626,7 @@ class TableView(BaseView): other_table, label = expanded[(column, value)] display_value = jinja2.Markup( # TODO: Escape id/label/etc so no XSS here - '{label}'.format( + '{label} {id}'.format( database=database, database_hash=database_hash, table=escape_sqlite_table_name(other_table), diff --git a/datasette/static/app.css b/datasette/static/app.css index a3685c65..386fe81a 100644 --- a/datasette/static/app.css +++ b/datasette/static/app.css @@ -18,6 +18,11 @@ td { padding: 4px; vertical-align: top; } +td em { + font-style: normal; + font-size: 0.8em; + color: #aaa; +} th { padding-right: 1em; }