创建了单个比赛的详情页

This commit is contained in:
virusdefender
2015-08-22 20:46:52 +08:00
parent f86ebd8ba3
commit 1fe35bd6e0
8 changed files with 178 additions and 10 deletions

View File

@@ -0,0 +1,24 @@
require(["jquery", "bsAlert", "csrfToken"], function($, bsAlert, csrfTokenHeader){
$("#contest-password-btn").click(function(){
var password = $("#contest-password").val();
if(!password){
bsAlert("密码不能为空!");
return;
}
$.ajax({
beforeSend: csrfTokenHeader,
url: "/api/contest/password/",
data: {password: password, contest_id: location.href.split("/")[4]},
method: "post",
dataType: "json",
success: function(data){
if(!data.code){
location.reload();
}
else{
bsAlert(data.data);
}
}
})
})
});