Course Times Standards CSV v1 working
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
@@ -71,13 +71,13 @@
|
||||
if (!formdatasetok) {
|
||||
$("#id_dropregion").remove();
|
||||
}
|
||||
|
||||
|
||||
if (formdatasetok) {
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
|
||||
console.log("CSRF token",csrftoken);
|
||||
|
||||
|
||||
function csrfSafeMethod(method) {
|
||||
// these HTTP methods do not require CSRF protection
|
||||
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
|
||||
@@ -95,11 +95,11 @@
|
||||
$(window).on('dragenter', function() {
|
||||
$("#id_drop-files").css("background-color","#E9E9E4");
|
||||
$("#id_dropregion").addClass("watermark").removeClass("invisible");})
|
||||
|
||||
|
||||
$(window).on('dragleave', function() {
|
||||
$("#id_drop-files").css("background-color","#FFFFFF");
|
||||
$("#id_dropregion").removeClass("watermark").addClass("invisible");})
|
||||
|
||||
|
||||
var frm = $("#file_form");
|
||||
|
||||
if( window.FormData === undefined ) {
|
||||
@@ -108,7 +108,7 @@
|
||||
} else {
|
||||
console.log('we have formdata');
|
||||
}
|
||||
|
||||
|
||||
var data = new FormData(frm[0]);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$('input').each(function( i ) {
|
||||
$(this).change(function() {
|
||||
@@ -159,7 +159,14 @@
|
||||
console.log($(this).attr('name'),$(this).val());
|
||||
};
|
||||
});});
|
||||
|
||||
|
||||
$('textarea').each(function( i ) {
|
||||
$(this).change(function() {
|
||||
data.set($(this).attr('name'),$(this).val());
|
||||
console.log($(this).attr('name'),$(this).val());
|
||||
});
|
||||
});
|
||||
|
||||
$('select').each(function( i ) {
|
||||
console.log($(this).attr('name'),$(this).val());
|
||||
$(this).change(function() {
|
||||
@@ -200,7 +207,7 @@
|
||||
console.log(result," reloading");
|
||||
location.reload();
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
@@ -236,7 +243,7 @@
|
||||
$("#id_file").value = 0;
|
||||
return false;
|
||||
}
|
||||
data.set("file",f);
|
||||
data.set("file",f);
|
||||
// data.append("file",f);
|
||||
|
||||
$("#id_file").replaceWith('<div id="id_file">'+files[0].name+' <a class="remove" href="javascript:void(0);"><b><font color="red">X</font></b></a></div>');
|
||||
|
||||
Reference in New Issue
Block a user