Much tidier design for table view header

Closes #147
pull/168/head
Simon Willison 2017-11-24 14:02:39 -08:00
rodzic a53d09d919
commit 8a37baba14
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: FBB38AFE227189DB
2 zmienionych plików z 16 dodań i 9 usunięć

Wyświetl plik

@ -210,3 +210,10 @@ form input[type=submit] {
margin-top: 0.6em;
}
}
a.not-underlined {
text-decoration: none;
}
.not-underlined .underlined {
text-decoration: underline;
}

Wyświetl plik

@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block title %}{{ database }}: {{ table }}{% endblock %}
{% block title %}{{ database }}: {{ table }}: {% if filtered_table_rows or filtered_table_rows == 0 %}{{ "{:,}".format(filtered_table_rows) }} row{% if filtered_table_rows == 1 %}{% else %}s{% endif %}{% endif %}
{% if human_filter_description %}where {{ human_filter_description }}{% endif %}{% endblock %}
{% block extra_head %}
<style>
@ -17,12 +18,12 @@
<h1 style="padding-left: 10px; border-left: 10px solid #{{ database_hash[:6] }}">{{ table }}{% if is_view %} (view){% endif %}</h1>
{% if table_rows != None %}
<h2>{{ "{:,}".format(table_rows) }} total row{% if table_rows == 1 %}{% else %}s{% endif %} in this table</h2>
{% if filtered_table_rows or human_filter_description %}
<h3>{% if filtered_table_rows or filtered_table_rows == 0 %}{{ "{:,}".format(filtered_table_rows) }} row{% if filtered_table_rows == 1 %}{% else %}s{% endif %}{% endif %}
{% if human_filter_description %}where {{ human_filter_description }}{% endif %}
</h3>
{% endif %}
<p>{{ human_filter_description }}</p>
{% if supports_search %}
<form action="/{{ database }}-{{ database_hash }}/{{ table|quote_plus }}" method="get">
<p><input type="search" name="_search" value="{{ search }}"> <input type="submit" value="Search"></p>
@ -71,13 +72,12 @@
</div>
</form>
<pre>{{ query.sql }}</pre>
{% if query.params %}<pre>params = {{ query.params|tojson(4) }}</pre>{% endif %}
{% if query.sql %}
<p><a class="not-underlined" title="{{ query.sql }}" href="/{{ database }}-{{ database_hash }}?{{ {'sql': query.sql}|urlencode|safe }}{% if query.params %}&amp;{{ query.params|urlencode|safe }}{% endif %}">&#x270e; <span class="underlined">View and edit SQL</span></a></p>
{% endif %}
<p>This data as <a href="{{ url_json }}">.json</a>, <a href="{{ url_jsono }}">.jsono</a></p>
<p>Returned {% if truncated %}more than {% endif %}{{ "{:,}".format(display_rows|length) }} row{% if display_rows|length == 1 %}{% else %}s{% endif %}</p>
{% include "_rows_and_columns.html" %}
{% if next_url %}