Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use homepage_actions() plugin hook #4

Closed
simonw opened this issue Mar 13, 2024 · 1 comment
Closed

Use homepage_actions() plugin hook #4

simonw opened this issue Mar 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Contributor

simonw commented Mar 13, 2024

New in Datasette 1.0a13:

Current workaround:

if view_name == "index":
url = "/-/datasette-metadata-editable/edit?"
return f"""
const editMetadata = document.createElement("a")
editMetadata.textContent = "Edit metadata"
editMetadata.setAttribute('href', {json.dumps(url)})
const metadataElement = document.querySelector('.metadata-description');
if(metadataElement)
metadataElement.appendChild(editMetadata)
else
(document.querySelector('.page-header') || document.querySelector('h1')).after(editMetadata)
"""

@simonw simonw added the enhancement New feature or request label Mar 13, 2024
simonw added a commit that referenced this issue Mar 13, 2024
@simonw
Copy link
Contributor Author

simonw commented Mar 13, 2024

Here's what that looks like:

homepage-actions

simonw added a commit that referenced this issue Apr 9, 2024
@simonw simonw closed this as completed Apr 9, 2024
simonw added a commit that referenced this issue Apr 9, 2024
simonw added a commit that referenced this issue Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant