donhauser / wagtail-photo-gallery

With this extention you are just a few steps away from a simple photo gallery for your wagtail page.
Apache License 2.0
9 stars 4 forks source link

[+ ADD] image button presents two times a file chooser and doesn't update the thumbnail. #5

Open ChefdeCambuse opened 2 years ago

ChefdeCambuse commented 2 years ago

After saving the album and opening it again, the thumbnail is visible.

Not sure if it is worth looking into that as I would like to use the Wagtail image chooser there anyway, mostly for the D&D functionality there.

donhauser commented 2 years ago

I agree, the procedure for adding an image is not the best user experience..

Technically after choosing an image, the corresponding div.input would need to be populated with the selected image, i.e. <label [..]>Click here to add an image</label> needs to be replaced by <img [...]/>.

Anyhow, drag-and-drop would be much better.

Concerning Wagtail image chooser: I've intended to separate the album images from the remaining website images, because I found wagtails image system not so useful for a large amount of images (several GB). E.g. Wagtail creates a lot of different thumbnail-sizes which would not utilized by the slideshow. For the image-storing and thumbnail generation django-imagekit is used instead. Hence, it will be rather hard to directly integrate wagtails image chooser but maybe it's D&D functionallity can be incorporated.

ChefdeCambuse commented 2 years ago

You're right. In a first step I'll try to add the D&D functionality and then let's see where this leads to.

donhauser commented 1 week ago

[+ ADD] image button presents two times a file chooser and doesn't update the thumbnail

In the new version 0.1.0, the thumbnail is set once the file is loaded. This is done by hooking up on the changed event of <input type='file'>. The chooser is only shown while the open file dialog is open. Canceling the file selection still leaves the chooser. Not sure how to fix this. If somebody finds a good solution, please create a PR.

Technically after choosing an image, the corresponding div.input would need to be populated with the selected image, i.e. <label [..]>Click here to add an image</label> needs to be replaced by <img [...]/>.

This is now implemented to update the thumbnail.

Right now there is still no drag-and-drop possibility, PRs very welcome as well.