But the Plupload node creation process is almost too darn smooth.

Some way of providing user feedback like "15 Nodes Created" or "15 Images Uploaded" would be handy.

I haven't looked at all into what it would take to do this. I'd like to tackle this, but if someone has already put brain power into this, then great.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

The imagex module shows a view of recently created images underneath the upload widget. If we refresh that after every upload, or just periodically I feel like that's a decent solution. We can make the links in this view open in a new tab for easy editing.

justintime’s picture

I've thought this before as well -- we need some sort of "It Worked!!!(TM)", but haven't started on anything. Go ahead and take a crack at it!

vordude’s picture

Title: Plupload needs some user-facing "Succes Text" » Plupload needs some user-facing "Success Text"
scroogie’s picture

The imagex module shows a view of recently created images underneath the upload widget. If we refresh that after every upload, or just periodically I feel like that's a decent solution.

I hope you don't mean providing such a view in plupload? I think it's overkill. It already provides a list of files with a green check mark if the file was uploaded successfully. The view would basically be a duplication of that. I think a javascript hook hook_plupload_finished() or something would be enough. Everything else could be contrib. Only my personal view though.

justintime’s picture

Whether or not this is implemented, here's an example of how to do it.

pribeh’s picture

subscribing.

greggles’s picture

@scroogie, I think the view is useful. Right after you have uploaded content what are you most likely to do? Edit the content. Providing a view that both indicates success, gives reassurance that all the images you uploaded are there, and lets you easily get to them for editing seems like a great feature.

@pribeh, can you say whether your are in favor or not?

justintime’s picture

Whatever we go with, it should be configurable. It all depends on whether you're using plupload directly, or another module is wrapping it. My case is the latter, and I have plupload on a tab. I use hook_help to tell the user where to go after the upload is complete, and it's another tab labeled "Manage Images". On that tab, the only thing displayed are the last uploaded images, so at least in my case, the view would be redundant information taking up DB query time.

pribeh’s picture

@greggles, I totally support this initiative. I came to the issue que looking for such a solution. I'm already testing this module with users and their first response always is "what now" after they've uploaded the images.

This is a great module and I love the integration but we either need this to work in a node form with multiple imagefields (such as described here http://drupal.org/node/929510) or we need to be able to call a view (or sent to a view) with each imagefields' corresponding node listed so that users can immediately see an impact of their actions and then easily edit these nodes.

pribeh’s picture

@justintime #8 I agree. An option to choose a View is optimal. There's also the possibility that we might be able to get this going by using the code you linked to in #5 in the header of a View's block to refresh a view block. I was trying to use Views Auto-refresh (from views_hacks) with a block of images placed below the plupload form that would refresh every thirty seconds or so. So as a user was uploading images the block would likely refresh in time for them to notice. Unfortunately the ajax here was broken for some reason while the plupload form was on the same page as the refreshing view. My javascript and php skills are limited and I don't have any good php programmers at my disposal for this problem right now.

vordude’s picture

Status: Active » Needs review
FileSize
3.6 KB

This is my first go at adding a file through a patch, so this may fail horribly. :)

This outputs Some simple simple "yay, success!" text through a theme function, and does a pretty Jquery slideUp to "replace" the Plupload header which is not useful to the user after the upload is complete anyway.

Since many users have a different perspective on the "right" thing to see. Let many users choose what they want to see by simply overriding a theme function. This also doesn't create dependencies on other modules, (views, etc.) unless someone wants to put a views_embed_view() in the theme function.

pribeh’s picture

Thanks vordude. I'll test it out right now. I'll see if I can get the theme override to pull a view of my choice.

pribeh’s picture

Hi vordude, I just made the following changes to my theme override to print a View of the photos that we're just uploaded:

function londonfuse_plupload_success() {
  $path = drupal_get_path('module', 'plupload');
  drupal_add_css($path.'/plupload.css');
  //If this is not footer, it gets called before the inline script
  //in plupload_upload_page() And that doesn't work.
  drupal_add_js($path .'/plupload.js', 'module', 'footer');
  
  return views_embed_view('Images_Upload', 'block_1');
}

But I can't figure out how to alter your javascript to get what I'm trying to do. Essentially, I'm just trying to load the View upon successful completion of the photos uploaded instead of the success statement. My javascript skills suck though so any help would be much appreciated.

vordude’s picture

Your theme function still wants to return the "empty" div, since the javascript fills it in later.

function londonfuse_plupload_success() {
  $path = drupal_get_path('module', 'plupload');
  drupal_add_css($path.'/plupload.css');

  drupal_add_js('my-awesome-custom.js', 'module', 'footer');
  
  return '<div id="uploader-success"></div>';

You want your custom javascript to run something like an $.ajax call to fetch the view. and then drop that inside of the div.

(clear as mud?)

pribeh’s picture

Wicked. I'll try to get some help with the javascript. Thanks vordude!

greggles’s picture

Status: Needs review » Needs work

In general this looks fine to me. The comment style isn't perfect, but is close.

I think the js isn't quite right - shouldn't we use behaviors here instead of document.ready?

justintime’s picture

@scroogie created some js for node_gallery that allows us to redirect the user to a new URL after the queue completes, and it uses behaviors.

vordude’s picture

Status: Needs work » Needs review
FileSize
3.51 KB

Here's a re-roll with some improvements.

1. The inline JS to "set up" the uploader is now in behaviors. (Using Drupal.settings to handle the inline PHP vars)
2.The JS for the the success text is in the same behavior.
3. Various other cleanup. (1&2 keep this from doing the stupid footer stuff from before)
4. I hear there are ponies.
5. Proper (?maybe, more proper?) usage of js translation strings.

I tried rolling this off of git. If it doesn't work for you, throw a hammer at me or something.

vordude’s picture

Hmm.. I fear this may break IE8/flash ?

vordude’s picture

Doh!

$output .= theme('plupload_success');
$output = '<div id="uploader">Your browser does not support Nope  HTML5 native or flash upload. Try Firefox 3, Safari 4, or Chrome; or install Flash.</div>

Is going to break every time...

Here is a re-roll fixing that, and splitting the Plupload creation and the Plupload Success Text into separate Drupal.behaviors (Since then they can be overridden on an individual basis).

vordude’s picture

Assigned: Unassigned » vordude
Status: Needs review » Needs work

crap. I left debug code in there. Stand by...

vordude’s picture

Assigned: vordude » Unassigned
Status: Needs work » Needs review
FileSize
3.69 KB

This one for review please.

...finally.

/facepalm

pribeh’s picture

Thanks vordude. I will try this out and report back.

parasox’s picture

Does this patch work on the latest dev? I tried it first without checking what version I was running, and it failed.. So I tried to reverse the patch, which also didn't work it seems, because when I upgraded to latest dev and tried to re-apply the patch, it told me the css and js files existed etc.. Then failed again. I tried uploading an image gallery and it worked, but I didn't see any new features as far as upload completion indicators..

I'll try again today with a fresh install of the dev, it was really late when I tried I was half in the bag. Just trying to help get this tested for you Vordude, thanks for the good work!

vordude’s picture

Hmm, Yes I was able to apply this patch from the module directory with a patch -p0 < /path/to/patch/plupload-954742-22-success-behaviors.patch

Still having issues?

parasox’s picture

Thanks I wasn't using -p0

Tested and works fine for me here, I see the top grey bar change to a success message on upload completion. Thanks!

rjbrown99’s picture

#22 is working for me. Excellent!

brunorios1’s picture

subscribing...

keesee’s picture

#22 worked great. I have a question. I would like to make 2 changes.
-- Redirect 3 seconds after message to the manage images page.
-- Add a link to the message "Success! 1 image uploaded. [Manage your new photos here] <- link to manage page for that gallery
----- in case they don't get forwarded.

--
J.

vordude’s picture

Not sure what you mean by "manage page".

This is only creating nodes. There is no pre-baked manage screen for a gallery, since by itself this module doesn't create galleries.

keesee’s picture

My apologizes. Wrong queue. Using this in conjunction with node gallery.
Thanks for the reply

--
J.

justintime’s picture

Attaching a re-roll against current 6.x-1.x branch. I'd appreciate it if someone could test it and mark this RTBC.

greggles’s picture

Status: Needs review » Needs work

I started reviewing and it seems good.

It looks like there's some cruft in this patch - specifically the entire plupload.module.orig Can you re-roll without that? It will make reviewing much easier.

justintime’s picture

Status: Needs work » Needs review
FileSize
3.66 KB

Whoops, sorry about that.

justintime’s picture

Status: Needs review » Fixed

Merged this into 6.x-1.x. Thanks again Vordude.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.