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

Limit cover image file type. #8797

Conversation

rebecca-shoptaw
Copy link
Collaborator

Closes #8762.

Feature/refactor. Uses HTML accept attribute to specify acceptable cover image file types (jpg/png/gif) so that no other file types can be submitted.

Technical

Super simple! Ended up just adding the single attribute to the HTML in covers/add.html.

Testing

  1. Go to a book page, select "Add Cover" or "Manage Covers"
  2. Try to upload an incorrect file type (like a PDF) -- the file should be greyed out and not selectable.

Screenshot

Image upload UI screenshot

Stakeholders

@cdrini

@cdrini cdrini self-assigned this Feb 7, 2024
@cdrini cdrini added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Feb 7, 2024
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm! Tested on testing!

@cdrini cdrini merged commit f0796d7 into internetarchive:master Feb 7, 2024
3 checks passed
@jimchamp jimchamp removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants