mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
7b19492070
commit
d6257e3a7b
3 changed files with 60 additions and 65 deletions
16
datasette/templates/_close_open_menus.html
Normal file
16
datasette/templates/_close_open_menus.html
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script>
|
||||||
|
document.body.addEventListener('click', (ev) => {
|
||||||
|
/* Close any open details elements that this click is outside of */
|
||||||
|
var target = ev.target;
|
||||||
|
var detailsClickedWithin = null;
|
||||||
|
while (target && target.tagName != 'DETAILS') {
|
||||||
|
target = target.parentNode;
|
||||||
|
}
|
||||||
|
if (target && target.tagName == 'DETAILS') {
|
||||||
|
detailsClickedWithin = target;
|
||||||
|
}
|
||||||
|
Array.from(document.getElementsByTagName('details')).filter(
|
||||||
|
(details) => details.open && details != detailsClickedWithin
|
||||||
|
).forEach(details => details.open = false);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -59,22 +59,8 @@
|
||||||
|
|
||||||
<footer class="ft">{% block footer %}{% include "_footer.html" %}{% endblock %}</footer>
|
<footer class="ft">{% block footer %}{% include "_footer.html" %}{% endblock %}</footer>
|
||||||
|
|
||||||
<script>
|
{% include "_close_open_menus.html" %}
|
||||||
document.body.addEventListener('click', (ev) => {
|
|
||||||
/* Close any open details elements that this click is outside of */
|
|
||||||
var target = ev.target;
|
|
||||||
var detailsClickedWithin = null;
|
|
||||||
while (target && target.tagName != 'DETAILS') {
|
|
||||||
target = target.parentNode;
|
|
||||||
}
|
|
||||||
if (target && target.tagName == 'DETAILS') {
|
|
||||||
detailsClickedWithin = target;
|
|
||||||
}
|
|
||||||
Array.from(document.getElementsByTagName('details')).filter(
|
|
||||||
(details) => details.open && details != detailsClickedWithin
|
|
||||||
).forEach(details => details.open = false);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% for body_script in body_scripts %}
|
{% for body_script in body_scripts %}
|
||||||
<script>{{ body_script }}</script>
|
<script>{{ body_script }}</script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -62,15 +62,6 @@
|
||||||
<p class="message-warning">Example message</p>
|
<p class="message-warning">Example message</p>
|
||||||
<p class="message-error">Example message</p>
|
<p class="message-error">Example message</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="pattern-heading">.bd for /</h2>
|
<h2 class="pattern-heading">.bd for /</h2>
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<h1>Datasette Fixtures</h1>
|
<h1>Datasette Fixtures</h1>
|
||||||
|
|
@ -101,15 +92,27 @@
|
||||||
<p><a href="/data/names" title="6 rows">names</a>, <a href="/data/foo">foo</a></p>
|
<p><a href="/data/names" title="6 rows">names</a>, <a href="/data/foo">foo</a></p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="pattern-heading">.bd for /database</h2>
|
<h2 class="pattern-heading">.bd for /database</h2>
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<h1 style="padding-left: 10px; border-left: 10px solid #ff0000">fixtures</h1>
|
<div class="page-header" style="border-color: #ff0000">
|
||||||
|
<h1>fixtures</h1>
|
||||||
|
<details class="actions-menu-links">
|
||||||
|
<summary><svg aria-labelledby="actions-menu-links-title" role="img"
|
||||||
|
style="color: #666" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="28" height="28" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<title id="actions-menu-links-title">Table 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></summary>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#">Database action</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="metadata-description">
|
<div class="metadata-description">
|
||||||
Test tables description
|
Test tables description
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -150,14 +153,28 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="pattern-heading">.bd for /database/table</h2>
|
<h2 class="pattern-heading">.bd for /database/table</h2>
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<h1 style="padding-left: 10px; border-left: 10px solid #ff0000">roadside_attraction_characteristics</h1>
|
<div class="page-header" style="border-color: #ff0000">
|
||||||
|
<h1>roadside_attraction_characteristics</h1>
|
||||||
|
<details class="actions-menu-links">
|
||||||
|
<summary><svg aria-labelledby="actions-menu-links-title" role="img"
|
||||||
|
style="color: #666" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="28" height="28" viewBox="0 0 24 24" fill="none"
|
||||||
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<title id="actions-menu-links-title">Table 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></summary>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#">Table action</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Data license:
|
Data license:
|
||||||
<a href="https://github.com/simonw/datasette/blob/master/LICENSE">Apache License 2.0</a>
|
<a href="https://github.com/simonw/datasette/blob/master/LICENSE">Apache License 2.0</a>
|
||||||
|
|
@ -257,7 +274,6 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<div class="extra-wheres">
|
<div class="extra-wheres">
|
||||||
<h3>2 extra where clauses</h3>
|
<h3>2 extra where clauses</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -269,7 +285,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p><a class="not-underlined" title="select rowid, attraction_id, characteristic_id from roadside_attraction_characteristics where "characteristic_id" = :p0 order by rowid limit 101" href="/fixtures?sql=select+rowid%2C+attraction_id%2C+characteristic_id+from+roadside_attraction_characteristics+where+%22characteristic_id%22+%3D+%3Ap0+order+by+rowid+limit+101&p0=2">✎ <span class="underlined">View and edit SQL</span></a></p>
|
<p><a class="not-underlined" title="select rowid, attraction_id, characteristic_id from roadside_attraction_characteristics where "characteristic_id" = :p0 order by rowid limit 101" href="/fixtures?sql=select+rowid%2C+attraction_id%2C+characteristic_id+from+roadside_attraction_characteristics+where+%22characteristic_id%22+%3D+%3Ap0+order+by+rowid+limit+101&p0=2">✎ <span class="underlined">View and edit SQL</span></a></p>
|
||||||
|
|
||||||
<p class="export-links">This data as <a href="/fixtures/roadside_attraction_characteristics.json?characteristic_id=2&_labels=on">json</a>, <a href="/fixtures/roadside_attraction_characteristics.csv?characteristic_id=2&_labels=on&_size=max">CSV</a> (<a href="#export">advanced</a>)</p>
|
<p class="export-links">This data as <a href="/fixtures/roadside_attraction_characteristics.json?characteristic_id=2&_labels=on">json</a>, <a href="/fixtures/roadside_attraction_characteristics.csv?characteristic_id=2&_labels=on&_size=max">CSV</a> (<a href="#export">advanced</a>)</p>
|
||||||
|
|
@ -278,11 +293,6 @@
|
||||||
Suggested facets: <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet=tags#facet-tags">tags</a>, <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet_date=created#facet-created">created</a> (date), <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet_array=tags#facet-tags">tags</a> (array)
|
Suggested facets: <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet=tags#facet-tags">tags</a>, <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet_date=created#facet-created">created</a> (date), <a href="http://latest.datasette.io/fixtures/facetable?_where=planet_int%3D1&_where=state%3D%27CA%27&_facet=city_id&_facet=created&_facet=complex_array&_facet_array=tags#facet-tags">tags</a> (array)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="facet-results">
|
<div class="facet-results">
|
||||||
|
|
||||||
<div class="facet-info facet-fixtures-facetable-tags" id="facet-tags">
|
<div class="facet-info facet-fixtures-facetable-tags" id="facet-tags">
|
||||||
|
|
@ -420,16 +430,6 @@
|
||||||
);</pre>
|
);</pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="pattern-heading">.bd for /database/table/row</h2>
|
<h2 class="pattern-heading">.bd for /database/table/row</h2>
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<h1 style="padding-left: 10px; border-left: 10px solid #ff0000">roadside_attractions: 2</h1>
|
<h1 style="padding-left: 10px; border-left: 10px solid #ff0000">roadside_attractions: 2</h1>
|
||||||
|
|
@ -474,16 +474,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="pattern-heading">.ft</h2>
|
<h2 class="pattern-heading">.ft</h2>
|
||||||
|
|
||||||
<footer class="ft">Powered by <a href="https://github.com/simonw/datasette" title="Datasette v0+unknown">Datasette</a>
|
<footer class="ft">Powered by <a href="https://github.com/simonw/datasette" title="Datasette v0+unknown">Datasette</a>
|
||||||
|
|
@ -498,5 +488,8 @@
|
||||||
<a href="https://github.com/simonw/datasette">
|
<a href="https://github.com/simonw/datasette">
|
||||||
About Datasette</a>
|
About Datasette</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
{% include "_close_open_menus.html" %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue