Skip to content

Instead of custom table.html use the new hook for the "insert row" button #26

@simonw

Description

@simonw

This plugin currently includes a custom table.html template in order to do this:

{% if permission_allowed(request.actor, 'insert-row')
or permission_allowed(request.actor, 'update-row')
or permission_allowed(request.actor, 'delete-row')
%}
{% if permission_allowed(request.actor, 'insert-row') %}
<button id="datasette-write-ui-insert-button">Insert new row</button>
{% endif %}
<script id="datasette-write-ui" type="module" src="{{ urls.static_plugins("datasette_write_ui", "table.min.js") }}"></script>
<link href="{{ urls.static_plugins("datasette_write_ui", "table.css") }}" rel="stylesheet" />

The new top_table plugin hook could do this without needing to ship a custom template - which could otherwise conflict with some other plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions