Source

ekkli-maps / templates / add_story_dialog.html

Diff from to

templates/add_story_dialog.html

         $( "#id_schedule_date" ).datepicker({ "dateFormat": 'yy-mm-dd' }).datepicker('setDate', new Date(date));
     });
 
+    function indicate_upload() {
+        $("#preview").attr("src", "/static/img/indicator.gif");
+        return true;
+    }
+
+
     function handle_image_upload(image_url) {
         $("#id_image_url").val(image_url);
         $("#preview").attr("src", image_url);
     }
+
 </script>
     <table width="80%" border="0" cellpadding="5">
         <tr>
                 {% trans "Image" %}:<br/>
                 {{ form.image_url }}<br/>
 
-                <form action="{{ upload_url}}" method="POST" enctype="multipart/form-data" target="upload_iframe">
+                <form action="{{ upload_url}}" onsubmit="return indicate_upload()" method="POST" enctype="multipart/form-data" target="upload_iframe">
                      {% csrf_token %}
                      {% render_upload_data upload_data %}
                      {{ upload_form.as_p }}<input type="submit" value="{% trans "Upload" %}">