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

added ajaxy image uploading #1739

Closed
wants to merge 8 commits into from
Closed

Conversation

jipiboily
Copy link

Here is the handling of image uploading with an ajaxy touch. It will upload files one by one instead of a single batch. This will prevent timeouts on say, Heroku.

It was asked by @robyurkowski here https://github.com/resolve/refinerycms/issues/1329#issuecomment-4862916. It was previously handled by https://github.com/jipiboily/refinerycms-imajax.

There is only one problem I see is the handling of I18n on the client side. I used the same method as you use in core, but it proved to be inefficient while I tested that. All the output will be in english even if there is a french translation. How would you want to support that?

Hope it's up to what you expected, if not, do not hesitate to comment or make suggestions. Friendly bashing accepted! ;)

@travisbot
Copy link

This pull request passes (merged 8a76e35 into 10337cb).

@@ -5,6 +6,24 @@
:object => @image,
:include_object_name => false %>

<% unless @image.errors.any? %>
Copy link
Member

Choose a reason for hiding this comment

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

<% if @image.errors.empty? %>

Copy link
Author

Choose a reason for hiding this comment

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

Will modify

@travisbot
Copy link

This pull request fails (merged cbc514f9 into 10337cb).

@travisbot
Copy link

This pull request passes (merged a41ad9e into 290fd4e).

@travisbot
Copy link

This pull request passes (merged 81f63d8 into 290fd4e).

@travisbot
Copy link

This pull request fails (merged 9dbeccf into 290fd4e).

@ugisozols
Copy link
Member

I would like for the dialog to close after I upload images because currently it just stays open showing success message and you have to close it yourself.

Refinery CMS Image upload

@jipiboily
Copy link
Author

@ugisozols should it be closed right away and the flash message should then be showed where it was before?

@ugisozols
Copy link
Member

@jipiboily yes.

@parndt
Copy link
Member

parndt commented Jul 6, 2012

I'm guessing the last request added somewhat of a challenge?

@jipiboily
Copy link
Author

@parndt things in my personal life kept me away from coding...I will do that really soon. I might have to play with the flash header to append all file names to the message...

@parndt
Copy link
Member

parndt commented Jul 12, 2012

@jipiboily I believe so yes! :-)

@jipiboily
Copy link
Author

I finally removed the flash, it felt too hacky.

It will automatically close the dialog after a successful upload and will show that: http://cl.ly/1f0h2W2g1V450w3M3L0T

Is that what you imagined?

@travisbot
Copy link

This pull request passes (merged 0e3037d into c3c3dd7).

@ugisozols
Copy link
Member

@jipiboily yes.

@robyurkowski
Copy link
Contributor

@jipiboily What does it show when you upload multiple while inserting?

@jipiboily
Copy link
Author

@robyurkowski not sure to understand what you mean. You mean during the process? You want me to shoot a video of the process? :)

@robyurkowski
Copy link
Contributor

Like if I'm uploading while inserting into a page. What is the behaviour then?

@jipiboily
Copy link
Author

Hum, it is closing the dialog now...which is unexpected in this specific use case, and unwanted.

@jipiboily
Copy link
Author

Two choices guys from here. Or we don't close the dialog automatically in neither of the situations, or we don't close it when inserting an image into a page. What would you prefer?

@ugisozols
Copy link
Member

@jipiboily can you make it behave the same as it is now? Thanks.

@jipiboily
Copy link
Author

Sure, I'll do!

@travisbot
Copy link

This pull request passes (merged c4873b1 into 765174c).

@jipiboily
Copy link
Author

Hi guys! I made it working mostly like it is now as far as I know. If I missed something (I didn't use Refinery that much), do not hesitate to tell me!

Cheers

@travisbot
Copy link

This pull request fails (merged 4b3a41d into 765174c).

@ugisozols
Copy link
Member

Hey @jipiboily,

Just tried out this and it works great! Can you do 2 more things?

  • Remove flash message from the dialog window - while you upload images it shows status and after the upload is complete it shows flash message in the same window. Right after that it closes window and redisplays flash message in the main page which is enough.
  • Add changelog entry

Thanks!

@parndt
Copy link
Member

parndt commented Aug 20, 2012

I would love to get this merged soon as it's a nice feature. @ugisozols @robyurkowski maybe we could implement the last couple of items?

@ugisozols ugisozols mentioned this pull request Aug 27, 2012
@ugisozols
Copy link
Member

I did the changes I wanted and pushed to a new branch because I couldn't open a PR against @jipiboily repo.

Please review.

@ugisozols ugisozols closed this Aug 27, 2012
ugisozols added a commit that referenced this pull request Aug 27, 2012
@jipiboily
Copy link
Author

I just got back from 3 weeks of vacations. Thanks for putting the last touch @ugisozols!

@jokklan
Copy link
Contributor

jokklan commented Oct 1, 2012

Is someone currently working on this?

@ugisozols
Copy link
Member

Nope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants