Задача №10

This commit is contained in:
Elena 2018-11-09 15:43:25 +04:00
parent 0f9bbc13cc
commit 2db572f284
2 changed files with 9 additions and 7 deletions

View File

@ -17,16 +17,17 @@ function showPapers(papersElement) {
}); });
} }
function addPaper(title, status, comment, locked, deadline, file, dateCreate, dateUpdate) { function addPaper(title, status,dateCreate, dateUpdate,deadline, comment, locked, tmpFileName, authors) {
var paperData = JSON.stringify({ var paperData = JSON.stringify({
"title": title, "title": title,
"status": status, "status": status,
"comment": comment, "date-publish":date-publish,
"date-update":date-update,
"deadline":deadline, "deadline":deadline,
"comment": comment,
"locked": locked, "locked": locked,
"file":file, "tmpFileName":tmpFileName,
"dateCreate":dateUpdate, "authors":authors
"dateUpdate":dateUpdate
}); });
postToRest(urlPapers, paperData, function (data) { postToRest(urlPapers, paperData, function (data) {
alert(data); alert(data);

View File

@ -149,7 +149,8 @@
<div class="col-lg-12"> <div class="col-lg-12">
<div class="form-group"> <div class="form-group">
<button id="sendMessageButton" class="btn btn-success text-uppercase" <button id="sendMessageButton" class="btn btn-success text-uppercase"
type="submit" onclick="return addPaper()" > type="button" onclick="return addPaper(name,status,date-publish,date-update,
deadline,comment,locked,loader,myInput)" >
Сохранить Сохранить
</button> </button>
<button id="cancelButton" class="btn btn-default text-uppercase" type="button"> <button id="cancelButton" class="btn btn-default text-uppercase" type="button">
@ -183,7 +184,7 @@
fillSelect($("#status"), response); fillSelect($("#status"), response);
}); });
addPaper("название", "DRAFT", "comment", false); addPaper(name,status,date-publish,date-update,deadline,comment,locked,loader,myInput);
}); });
/*]]>*/ /*]]>*/
</script> </script>