задача 10

This commit is contained in:
Elena 2018-11-23 13:53:20 +04:00
parent fe6e52a19c
commit 51e84e22a6
5 changed files with 40 additions and 32 deletions

Binary file not shown.

View File

@ -1,4 +1,3 @@
#Tue Feb 06 11:48:53 SAMT 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

19
gradlew vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################## ##############################################################################
## ##
@ -154,16 +154,19 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { save () {
JVM_OPTS=("$@") for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
} }
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS APP_ARGS=$(save "$@")
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" cd "$(dirname "$0")"
fi fi
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" exec "$JAVACMD" "$@"

View File

@ -49,17 +49,12 @@ function deletePaper(id, papersElement, paperRowClass) {
}); });
} }
function addPaper(title, status,dateCreate, dateUpdate,deadline, comment, locked, tmpFileName, authors) { function addPaper(title, status, datePublish, dateUpdate, deadline, comment, locked, tmpFileName, authors) {
var paperData = JSON.stringify({ var paperData = JSON.stringify({
"title": title, "title": title,
"status": status, "status": status,
"date-publish":date-publish, "deadlineDate":deadline,
"date-update":date-update, "comment": comment
"deadline":deadline,
"comment": comment,
"locked": locked,
"tmpFileName":tmpFileName,
"authors":authors
}); });
postToRest(urlPapers, paperData, function (data) { postToRest(urlPapers, paperData, function (data) {
alert(data); alert(data);

View File

@ -49,7 +49,7 @@
<div class="form-group"> <div class="form-group">
<label>Дедлайн:</label> <label>Дедлайн:</label>
<input type="date" class="form-control" name="deadline"/> <input type="date" class="form-control" name="deadline" id="deadline"/>
</div> </div>
<div class="form-check"> <div class="form-check">
@ -57,18 +57,18 @@
<label class="form-check-label" for="locked">Заблокирована</label> <label class="form-check-label" for="locked">Заблокирована</label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="loader">Загрузить статью:</label> <label for="loader" id="loader">Загрузить статью:</label>
<div id="loader"> <!--<div id="loader">
</div> </div>-->
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Дата публикации:</label> <label>Дата публикации:</label>
<input type="date" class="form-control" name="date-publish"/> <input type="date" class="form-control" name="date-publish" id="date-publish"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Последнее изменение:</label> <label>Последнее изменение:</label>
<input type="date" class="form-control" name="date-update"/> <input type="date" class="form-control" name="date-update" id="date-update"/>
</div> </div>
<p><a href="#myModal1" class="btn btn-primary" data-toggle="modal">Редактировать авторов <p><a href="#myModal1" class="btn btn-primary" data-toggle="modal">Редактировать авторов
статьи</a></p> статьи</a></p>
@ -149,8 +149,7 @@
<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="button" onclick="return addPaper(name,status,date-publish,date-update, type="button" onclick="savePaper();" >
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">
@ -184,8 +183,20 @@
fillSelect($("#status"), response); fillSelect($("#status"), response);
}); });
addPaper(name,status,date-publish,date-update,deadline,comment,locked,loader,myInput);
}); });
function savePaper(){
var title = document.getElementById("name").value;
var status = document.getElementById("status").value;
var datePublish = document.getElementById("date-publish").value;
var dateUpdate = document.getElementById("date-update").value;
var deadline = document.getElementById("deadline").value;
var comment = document.getElementById("comment").value;
var locked = document.getElementById("locked").value;
var tmpFileName = document.getElementById("loader").value;
var authors = document.getElementById("myInput").value;
addPaper(title,status,datePublish,dateUpdate,deadline,comment,locked,tmpFileName,authors);
}
/*]]>*/ /*]]>*/
</script> </script>
</div> </div>