Databases now get distinct colours

A left border based on their content hash.

Closes #31
pull/81/head
Simon Willison 2017-11-09 06:12:42 -08:00
rodzic abb591d832
commit b2dee11fcd
4 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -3,7 +3,7 @@
{% block title %}{{ database }}{% endblock %}
{% block content %}
<h1>{{ database }}</h1>
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_hash[:6] }}">{{ database }}</h1>
<p><a href="/{{ database }}-{{ database_hash }}.db">download {{ database }}.db</a></p>

Wyświetl plik

@ -5,7 +5,7 @@
{% block content %}
<h1>Database{% if databases|length != 1 %}s{% endif %}</h1>
{% for database in databases %}
<h2><a href="{{ database.path }}">{{ database.name }}</a></h2>
<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>{% 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 %}

Wyświetl plik

@ -3,7 +3,7 @@
{% block title %}{{ database }}: {{ table }}{% endblock %}
{% block content %}
<h1><a href="/{{ database }}-{{ database_hash }}">{{ database }}</a></h1>
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_hash[:6] }}"><a href="/{{ database }}-{{ database_hash }}">{{ database }}</a></h1>
<h2><a href="/{{ database }}-{{ database_hash }}/{{ table }}">{{ table }}</a></h2>

Wyświetl plik

@ -3,7 +3,7 @@
{% block title %}{{ database }}: {{ table }}{% endblock %}
{% block content %}
<h1><a href="/{{ database }}-{{ database_hash }}">{{ database }}</a></h1>
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_hash[:6] }}"><a href="/{{ database }}-{{ database_hash }}">{{ database }}</a></h1>
<h2>{{ table }}{% if total_rows != None %} ({{ "{:,}".format(total_rows) }} total row{% if total_rows == 1 %}{% else %}s{% endif %} in this table){% endif %}</h2>