Revised JSON design a bit

Closes #63
This commit is contained in:
Simon Willison 2017-11-11 14:20:00 -08:00
commit e9e1def4c0
5 changed files with 22 additions and 12 deletions

View file

@ -16,7 +16,7 @@
<div class="ft">
Powered by <a href="https://github.com/simonw/datasette">Datasette</a>
{% if took_ms %}&middot; Query took {{ took_ms|round(3) }}ms{% endif %}
{% if query_ms %}&middot; Query took {{ query_ms|round(3) }}ms{% endif %}
</div>
</body>

View file

@ -6,7 +6,7 @@
<h1>Datasette</h1>
{% for database in databases %}
<h2 style="padding-left: 10px; border-left: 10px solid #{{ database.hash[:6] }}"><a href="{{ database.path }}">{{ database.name }}</a></h2>
<p>{{ "{:,}".format(database.total_rows) }} rows in {{ database.tables_count }} table{% if database.tables_count != 1 %}s{% endif %}</p>
<p>{{ "{:,}".format(database.table_rows) }} rows in {{ database.tables_count }} table{% if database.tables_count != 1 %}s{% endif %}</p>
<p>{% for table, count in database.tables_truncated %}<a href="{{ database.path }}/{{ table }}" title="{{ count }} rows">{{ table }}</a>{% if not loop.last %}, {% endif %}{% endfor %}{% if database.tables_more %}, <a href="{{ database.path }}">...</a>{% endif %}</p>
{% endfor %}

View file

@ -18,8 +18,8 @@
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_hash[:6] }}">{{ table }}</h1>
{% if total_rows != None %}
<h2>{{ "{:,}".format(total_rows) }} total row{% if total_rows == 1 %}{% else %}s{% endif %} in this table</h2>
{% if table_rows != None %}
<h2>{{ "{:,}".format(table_rows) }} total row{% if table_rows == 1 %}{% else %}s{% endif %} in this table</h2>
{% endif %}
<table>