Improved thank you message #304
authorCharles Connell <charles@connells.org>
Fri, 24 Jan 2014 14:58:51 +0000 (09:58 -0500)
committerCharles Connell <charles@connells.org>
Fri, 24 Jan 2014 17:16:55 +0000 (12:16 -0500)
karmaworld/templates/partial/filepicker.html

index 61ca95fec229f98bb4b227060b92a66f8330109a..6edf2494ed0c633373d632e7920fa6c9161eede8 100644 (file)
         <ul id="uploaded_files">
         </ul>
         {% if not request.user.is_authenticated %}
-          <p>We'd love to have you sign up so you can claim the notes you just uploaded, and
-          build a reputation for uploading great notes.</p>
+          <p>It will take a minute for your notes to appear.
+            We'd love to have you sign up so you can <strong>claim the <span id="thank-points"></span> karma points
+            you just got.</strong> With a KarmaNotes account,
+            you can build a reputation by continuing to upload great notes.
+            <a href="">Want to share again?</a></p>
           <div class="socialaccount_ballot">
             <ul class="socialaccount_providers">
               {% include "socialaccount/snippets/provider_list.html" with process="login" %}
             </ul>
             <a href="{{ signup_url }}">Sign up for a traditional account</a>
           </div>
+        {% else %}
+          <p>It will take a minute for your notes to appear.
+            You'll be awarded <strong><span id="thank-points"></span> karma points.</strong>
+            <a href="">Want to share again?</a></p>
         {% endif %}
       </div>
     </div>
@@ -73,7 +80,7 @@
   </div>
   <div class="small-8 small-offset-3 columns large-2">
     <div id="save-btn" class="hide">
-      <i class="fa fa-save"></i> Save
+      <i id="save-btn-icon" class="fa fa-save"></i> Save
     </div>
   </div>
 
         _form.id = null; // clear the unique id
         // save the FP url to the form
         $(_form.children[0].children[3].children[0]).val(upFile.url);
-        console.log(upFile);
         // save the mimetype to the form
         $(_form.children[0].children[3].children[1]).val(upFile.mimetype);
 
 
         $('.remove').on('click', function(e){
             e.stopPropagation();
-            console.log($(this).parent().parent());
             $(this).parent().parent().remove();
         });
 
 
       $('#save-btn').on('click', function(e){
         e.stopPropagation();
+        $(this).unbind('click');
+        $(this).addClass('disabled');
+
+        var saveIcon = $('#save-btn-icon');
+        saveIcon.removeClass('fa-save');
+        saveIcon.addClass('fa-spinner fa-spin');
+
         $('#forms_container .inline-form').each(function(i,el){
-            console.log("inline form " + i + "el: " + el);
             var name, tags, fpurl, course;
             name = $(el).find('.intext').val();
             fp_file = $(el).find('.fpurl').val();
                 for (var i=0; i < uploaded_files.length; i++) {
                   $('#uploaded_files').append($('<li>', {text: uploaded_files[i]}));
                 }
+                $('#thank-points').html(uploaded_files.length*5);
                 $('#success').show();
                 $('#save-btn').hide();
                 $('#filepicker_row').hide();
                 $('#forms_container .inline-form').remove();
+                $('#forms_container').hide();
                 if (document.location.host === 'www.karmanotes.org' ||
                   document.location.host === 'karmanotes.org') {
                   _gat._getTracker()._trackEvent('upload', 'upload form submitted');