对后台比赛管理页面的修改,对有密码的小组赛的支持

This commit is contained in:
sxw
2015-12-05 15:49:54 +08:00
parent f7f2a327ea
commit bbf3b42edc
4 changed files with 37 additions and 13 deletions

View File

@@ -22,6 +22,10 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "date
selectedGroups.push(vm.allGroups[i].id); selectedGroups.push(vm.allGroups[i].id);
} }
} }
if (vm.password) {
ajaxData.password = vm.password;
ajaxData.contest_type = 3;
}
ajaxData.groups = selectedGroups; ajaxData.groups = selectedGroups;
} }
else { else {

View File

@@ -23,6 +23,10 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "date
selectedGroups.push(vm.allGroups[i].id); selectedGroups.push(vm.allGroups[i].id);
} }
} }
if (vm.password) {
ajaxData.password = vm.password;
ajaxData.contest_type = 3;
}
ajaxData.groups = selectedGroups; ajaxData.groups = selectedGroups;
} }
else { else {
@@ -131,7 +135,7 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert", "csrfToken", "date
vm.startTime = contest.start_time.substring(0, 16).replace("T", " "); vm.startTime = contest.start_time.substring(0, 16).replace("T", " ");
vm.endTime = contest.end_time.substring(0, 16).replace("T", " "); vm.endTime = contest.end_time.substring(0, 16).replace("T", " ");
vm.password = contest.password; vm.password = contest.password;
if (contest.contest_type == 0) { //contest_type == 0, 小组内比赛 if (contest.contest_type == 0 || contest.contest_type == 3) { //contest_type == 0, 小组内比赛
vm.isGlobal = false; vm.isGlobal = false;
for (var i = 0; i < vm.allGroups.length; i++) { for (var i = 0; i < vm.allGroups.length; i++) {
vm.allGroups[i].isSelected = false; vm.allGroups[i].isSelected = false;

View File

@@ -46,13 +46,13 @@
<div> <div>
<span ms-if="showGlobalViewRadio"> <span ms-if="showGlobalViewRadio">
<label> <label>
<small><input type="radio" value="true" name="isGlobal" ms-duplex-boolean="isGlobal">全局可见 <small><input type="radio" value="true" name="isGlobal" ms-duplex-boolean="isGlobal">公开赛
</small> </small>
</label> </label>
</span> </span>
<span> <span>
<label> <label>
<small><input type="radio" value="false" name="isGlobal" ms-duplex-boolean="isGlobal">小组内可见 <small><input type="radio" value="false" name="isGlobal" ms-duplex-boolean="isGlobal">小组
</small> </small>
</label> </label>
</span> </span>
@@ -60,10 +60,18 @@
</div> </div>
</div> </div>
<div class="col-md-6" ms-visible="isGlobal"> <div class="col-md-6" >
<label>密码保护</label> <div ms-visible="isGlobal">
<div class="form-group"> <label>密码保护</label>
<input type="text" class="form-control" name="password" placeholder="留空就是公开赛" ms-duplex="password"> <div class="form-group">
<input type="text" class="form-control" name="password" placeholder="留空就是公开赛" ms-duplex="password">
</div>
</div>
<div ms-visible="!isGlobal">
<label>邀请密码</label>
<div class="form-group">
<input type="text" class="form-control" name="password" placeholder="留空则只有小组内可以参加" ms-duplex="password">
</div>
</div> </div>
</div> </div>
<div class="form-group col-md-12" ms-visible="!isGlobal"> <div class="form-group col-md-12" ms-visible="!isGlobal">

View File

@@ -55,13 +55,13 @@
<div> <div>
<span ms-if="showGlobalViewRadio"> <span ms-if="showGlobalViewRadio">
<label> <label>
<small><input type="radio" value="true" name="isGlobal" ms-duplex-boolean="isGlobal">全局可见 <small><input type="radio" value="true" name="isGlobal" ms-duplex-boolean="isGlobal">公开赛
</small> </small>
</label> </label>
</span> </span>
<span> <span>
<label> <label>
<small><input type="radio" value="false" name="isGlobal" ms-duplex-boolean="isGlobal">小组内可见 <small><input type="radio" value="false" name="isGlobal" ms-duplex-boolean="isGlobal">小组
</small> </small>
</label> </label>
</span> </span>
@@ -69,11 +69,19 @@
</div> </div>
</div> </div>
<div class="col-md-6" ms-visible="isGlobal"> <div class="col-md-6">
<label>密码保护</label> <div ms-visible="isGlobal">
<label>密码保护</label>
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" name="password" placeholder="留空就是公开赛" ms-duplex="password"> <input type="text" class="form-control" name="password" placeholder="留空就是公开赛" ms-duplex="password">
</div>
</div>
<div ms-visible="!isGlobal">
<label>邀请密码</label>
<div class="form-group">
<input type="text" class="form-control" name="password" placeholder="留空则只有小组内可以参加" ms-duplex="password">
</div>
</div> </div>
</div> </div>
<div class="form-group col-md-12" ms-visible="!isGlobal"> <div class="form-group col-md-12" ms-visible="!isGlobal">