mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
49 lines
1.5 KiB
HTML
49 lines
1.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ database }}: {{ table }}{% endblock %}
|
|
|
|
{% block extra_head %}
|
|
<style>
|
|
@media only screen and (max-width: 576px) {
|
|
td:nth-of-type(1):before { content: "{% if use_rowid %}rowid{% else %}Link{% endif %}"; }
|
|
{% for column in display_columns %}
|
|
td:nth-of-type({{ loop.index + 1 }}):before { content: "{{ column|escape_css_string }}"; }
|
|
{% endfor %}
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="hd"><a href="/">home</a> / <a href="/{{ database }}-{{ database_hash }}">{{ database }}</a></div>
|
|
|
|
<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>
|
|
{% endif %}
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">{% if use_rowid %}rowid{% else %}Link{% endif %}</th>
|
|
{% for column in display_columns %}<th scope="col">{{ column }}</th>{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr>
|
|
<td><a href="/{{ database }}-{{ database_hash }}/{{ table }}/{{ row_link(row) }}">{{ row_link(row) }}</a></td>
|
|
{% for td in row %}
|
|
{% if not use_rowid or (use_rowid and not loop.first) %}
|
|
<td>{{ td or " " }}</td>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% if after_link %}
|
|
<p><a href="{{ after_link }}">Next page</a></p>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|