{% extends "base.html" %}

{% block title %}Import a table from another Datasette instance{% endblock %}

{% block extra_head %}

{% endblock %}

{% block nav %}
    <p class="crumbs">
        <a href="/">home</a>
    </p>
    {{ super() }}
{% endblock %}

{% block content %}
<h1>Import a table from another Datasette instance</h1>

{% if error %}
    <p class="message-error">{{ error }}</p>
{% endif %}

<form action="/-/import-table" method="post">
    <p>
        <input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
        <label style="width: auto; display: inline-block; width: 60%">Table URL: <input style="width: 60%" type="text" name="url" value=""></label>
        <input type="submit" value="Import table">
    </p>
    {% if databases|length > 1 %}
    <p><label style="width: auto">Database to create table in: <select>
        {% for database in databases %}
            <option>{{ database }}</option>
        {% endfor %}
    </select></label></p>
{% endif %}
</form>

{% endblock %}
