More datasette.urls usage, refs #1025

This commit is contained in:
Simon Willison 2020-10-19 21:24:47 -07:00
commit 0d1763fb2f
6 changed files with 26 additions and 10 deletions

View file

@ -35,7 +35,7 @@ p.message-warning {
<p>Use this tool to try out different actor and allow combinations. See <a href="https://docs.datasette.io/en/stable/authentication.html#defining-permissions-with-allow-blocks">Defining permissions with "allow" blocks</a> for documentation.</p>
<form action="/-/allow-debug" method="get">
<form action="{{ urls.path('-/allow-debug') }}" method="get">
<div class="two-col">
<p><label>Allow block</label></p>
<textarea name="allow">{{ allow_input }}</textarea>

View file

@ -2,7 +2,7 @@
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="{{ base_url }}-/static/app.css?{{ app_css_hash }}">
<link rel="stylesheet" href="{{ urls.static('app.css') }}?{{ app_css_hash }}">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% for url in extra_css_urls %}
<link rel="stylesheet" href="{{ url.url }}"{% if url.sri %} integrity="{{ url.sri }}" crossorigin="anonymous"{% endif %}>
@ -18,7 +18,7 @@
{% if actor %}
<div class="logout">
<strong>{{ display_actor(actor) }}</strong>{% if show_logout %} &middot;
<form action="/-/logout" method="post">
<form action="{{ urls.logout() }}" method="post">
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
<button class="button-as-link">Log out</button>
</form>{% endif %}

View file

@ -4,7 +4,7 @@
{% block nav %}
<p class="crumbs">
<a href="/">home</a>
<a href="{{ urls.instance() }}">home</a>
</p>
{{ super() }}
{% endblock %}