datasette / datasette-write-ui

A Datasette plugin that adds UI elements to edit, insert, or delete rows in SQLite tables
Apache License 2.0
15 stars 2 forks source link

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

Open simonw opened 5 months ago

simonw commented 5 months ago

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

https://github.com/datasette/datasette-write-ui/blob/b8a461fd0a06b5ac47b14b5ff61d682753315593/datasette_write_ui/templates/table.html#L17-L27

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

simonw commented 5 months ago

Right now that plugin only allows content to be inserted at the top of the page, not the bottom. I think that's OK here. We could always shift the button to the bottom of the page using JavaScript if required.