Row page now resolves foreign keys

Closes #132
This commit is contained in:
Simon Willison 2017-11-23 13:51:16 -08:00
commit 4b7596ee5c
No known key found for this signature in database
GPG key ID: FBB38AFE227189DB
4 changed files with 98 additions and 108 deletions

View file

@ -0,0 +1,16 @@
<table>
<thead>
<tr>
{% for column in display_columns %}<th scope="col">{{ column }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for row in display_rows %}
<tr>
{% for cell in row %}
<td>{{ cell.value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>

View file

@ -19,22 +19,7 @@
<p>This data as <a href="{{ url_json }}">.json</a>, <a href="{{ url_jsono }}">.jsono</a></p>
<table>
<thead>
<tr>
{% for column in columns %}<th scope="col">{{ column }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
{% for td in row %}
<td>{{ td }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% include "_rows_and_columns.html" %}
{% if foreign_key_tables %}
<h2>Links from other tables</h2>

View file

@ -78,22 +78,7 @@
<p>Returned {% if truncated %}more than {% endif %}{{ "{:,}".format(display_rows|length) }} row{% if display_rows|length == 1 %}{% else %}s{% endif %}</p>
<table>
<thead>
<tr>
{% for column in display_columns %}<th scope="col">{{ column }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for row in display_rows %}
<tr>
{% for cell in row %}
<td>{{ cell.value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% include "_rows_and_columns.html" %}
{% if next_url %}
<p><a href="{{ next_url }}">Next page</a></p>