Skip to content

Commit

Permalink
Show linked foreign key in table cells
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 23, 2017
1 parent 72e328d commit 38dc1ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datasette/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ async def make_display_rows(self, database, database_hash, table, rows, display_
other_table, label = expanded[(column, value)]
display_value = jinja2.Markup(
# TODO: Escape id/label/etc so no XSS here
'<a href="/{database}-{database_hash}/{table}/{id}">{label}</a>'.format(
'<a href="/{database}-{database_hash}/{table}/{id}">{label}</a> <em>{id}</em>'.format(
database=database,
database_hash=database_hash,
table=escape_sqlite_table_name(other_table),
Expand Down
5 changes: 5 additions & 0 deletions datasette/static/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

1 comment on commit 38dc1ef

@simonw
Copy link
Owner Author

@simonw simonw commented on 38dc1ef Nov 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conventional_power_plants_eu__conventional_power_plants_eu

Please sign in to comment.