2017-10-24 02:56:27 +00:00
{% extends "base.html" %}
2017-11-13 15:20:02 +00:00
{% block title %}{{ metadata.title or "Datasette" }}: {% for database in databases %}{{ database.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% endblock %}
2017-10-24 02:56:27 +00:00
2017-11-30 07:09:54 +00:00
{% block body_class %}index{% endblock %}
2017-10-24 02:56:27 +00:00
{% block content %}
2020-06-08 14:18:37 +00:00
< h1 > {{ metadata.title or "Datasette" }}{% if private %} 🔒{% endif %}< / h1 >
metadata.json support for per-table/per-database metadata
Also added support for descriptions and HTML descriptions.
Here's an example metadata.json file illustrating custom per-database and per-
table metadata:
{
"title": "Overall datasette title",
"description_html": "This is a <em>description with HTML</em>.",
"databases": {
"db1": {
"title": "First database",
"description": "This is a string description & has no HTML",
"license_url": "http://example.com/",
"license": "The example license",
"queries": {
"canned_query": "select * from table1 limit 3;"
},
"tables": {
"table1": {
"title": "Custom title for table1",
"description": "Tables can have descriptions too",
"source": "This has a custom source",
"source_url": "http://example.com/"
}
}
}
}
}
Closes #165, Refs #164
2017-12-07 16:42:54 +00:00
2024-03-12 20:44:07 +00:00
{% set links = homepage_actions %}{% if links %}
< div class = "page-action-menu" >
< details class = "actions-menu-links details-menu" >
< summary >
< div class = "icon-text" >
< svg class = "icon" aria-labelledby = "actions-menu-links-title" role = "img" style = "color: #fff" xmlns = "http://www.w3.org/2000/svg" width = "28" height = "28" viewBox = "0 0 28 28" fill = "none" stroke = "currentColor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" >
< title id = "actions-menu-links-title" > Homepage actions< / title >
< circle cx = "12" cy = "12" r = "3" > < / circle >
< path d = "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" > < / path >
< / svg >
< span > Homepage actions< / span >
< / div >
< / summary >
< div class = "dropdown-menu" >
< div class = "hook" > < / div >
{% if links %}
< ul >
{% for link in links %}
< li > < a href = "{{ link.href }}" > {{ link.label }}
{% if link.description %}
< p class = "dropdown-description" > {{ link.description }}< / p >
{% endif %}< / a >
< / li >
{% endfor %}
< / ul >
{% endif %}
< / div >
< / details >
< / div >
{% endif %}
2024-01-31 03:54:03 +00:00
{{ top_homepage() }}
metadata.json support for per-table/per-database metadata
Also added support for descriptions and HTML descriptions.
Here's an example metadata.json file illustrating custom per-database and per-
table metadata:
{
"title": "Overall datasette title",
"description_html": "This is a <em>description with HTML</em>.",
"databases": {
"db1": {
"title": "First database",
"description": "This is a string description & has no HTML",
"license_url": "http://example.com/",
"license": "The example license",
"queries": {
"canned_query": "select * from table1 limit 3;"
},
"tables": {
"table1": {
"title": "Custom title for table1",
"description": "Tables can have descriptions too",
"source": "This has a custom source",
"source_url": "http://example.com/"
}
}
}
}
}
Closes #165, Refs #164
2017-12-07 16:42:54 +00:00
{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %}
2017-11-13 15:20:02 +00:00
2017-10-27 04:05:13 +00:00
{% for database in databases %}
2020-10-20 00:33:59 +00:00
< h2 style = "padding-left: 10px; border-left: 10px solid #{{ database.color }}" > < a href = "{{ urls.database(database.name) }}" > {{ database.name }}< / a > {% if database.private %} 🔒{% endif %}< / h2 >
2017-11-22 20:12:15 +00:00
< p >
2019-05-16 03:02:33 +00:00
{% if database.show_table_row_counts %}{{ "{:,}".format(database.table_rows_sum) }} rows in {% endif %}{{ database.tables_count }} table{% if database.tables_count != 1 %}s{% endif %}{% if database.tables_count and database.hidden_tables_count %}, {% endif -%}
2019-05-16 00:28:07 +00:00
{% if database.hidden_tables_count -%}
2019-05-16 03:02:33 +00:00
{% if database.show_table_row_counts %}{{ "{:,}".format(database.hidden_table_rows_sum) }} rows in {% endif %}{{ database.hidden_tables_count }} hidden table{% if database.hidden_tables_count != 1 %}s{% endif -%}
2019-05-16 00:28:07 +00:00
{% endif -%}
{% if database.views_count -%}
{% if database.tables_count or database.hidden_tables_count %}, {% endif -%}
2017-11-22 20:12:15 +00:00
{{ "{:,}".format(database.views_count) }} view{% if database.views_count != 1 %}s{% endif %}
{% endif %}
< / p >
2020-10-20 00:33:59 +00:00
< p > {% for table in database.tables_and_views_truncated %}< a href = "{{ urls.table(database.name, table.name) }}" { % if table . count % } title = "{{ table.count }} rows" { % endif % } > {{ table.name }}< / a > {% if table.private %} 🔒{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if database.tables_and_views_more %}, < a href = "{{ urls.database(database.name) }}" > ...< / a > {% endif %}< / p >
2017-10-24 02:00:37 +00:00
{% endfor %}
2017-10-24 02:56:27 +00:00
2017-11-11 20:36:20 +00:00
{% endblock %}