Refactor templates for better top nav customization, refs #540

This commit is contained in:
Simon Willison 2019-07-05 13:34:41 -07:00
commit a18e0964ec
7 changed files with 69 additions and 29 deletions

View file

@ -14,33 +14,15 @@
</head>
<body class="{% block body_class %}{% endblock %}">
<nav class="hd">{% block nav %}{% endblock %}</nav>
<div class="bd">
{% block content %}
{% endblock %}
<div class="ft">
Powered by <a href="https://github.com/simonw/datasette" title="Datasette v{{ datasette_version }}">Datasette</a>
{% if query_ms %}&middot; Query took {{ query_ms|round(3) }}ms{% endif %}
{% if metadata %}
{% if metadata.license or metadata.license_url %}&middot; Data license:
{% if metadata.license_url %}
<a href="{{ metadata.license_url }}">{{ metadata.license or metadata.license_url }}</a>
{% else %}
{{ metadata.license }}
{% endif %}
{% endif %}
{% if metadata.source or metadata.source_url %}&middot;
Data source: {% if metadata.source_url %}
<a href="{{ metadata.source_url }}">
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
{% endif %}
{% if metadata.about or metadata.about_url %}&middot;
About: {% if metadata.about_url %}
<a href="{{ metadata.about_url }}">
{% endif %}{{ metadata.about or metadata.about_url }}{% if metadata.about_url %}</a>{% endif %}
{% endif %}
{% endif %}
</div>
<div class="ft">{% block footer %}{% include "_footer.html" %}{% endblock %}</div>
{% for body_script in body_scripts %}
<script>{{ body_script }}</script>
{% endfor %}