diff --git a/static/src/js/app/admin/contest/contest_list.js b/static/src/js/app/admin/contest/contest_list.js index 823179e..ceafce1 100644 --- a/static/src/js/app/admin/contest/contest_list.js +++ b/static/src/js/app/admin/contest/contest_list.js @@ -14,8 +14,9 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"] page: 1, totalPage: 1, keyword: "", - editingContestId: 0, - editTitle: "", + editingContestId: 0, + editTitle: "", + editingProblemList: [], getNext: function () { if (!vm.nextPage) return; @@ -38,13 +39,14 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"] getPageData(page_index); }, showEditContestArea: function (contestId) { - if (contestId == vm.editingContestId) - vm.editingContestId = 0; - else { - vm.editingContestId = contestId; - vm.editTitle = vm.contestList[contestId-1].title; - editor("#editor").setValue(vm.contestList[contestId-1].description); - } + if (contestId == vm.editingContestId) + vm.editingContestId = 0; + else { + vm.editingContestId = contestId; + vm.editTitle = vm.contestList[contestId-1].title; + editor("#editor").setValue(vm.contestList[contestId-1].description); + vm.editingProblemList = vm.contestList[contestId-1].problemList; + } } }); @@ -74,7 +76,12 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"] } }); */ - vm.contestList =[{id: 1, title:"The first contest", created_by: {username:"owen"}, description:"

this contest is just for

fun

"}]; + vm.contestList =[{ + id: 1, title:"The first contest", + created_by: {username:"owen"}, + description:"

this contest is just for

fun

", + problemList:[{title:"A+B problem", id:1, testCaseList:[1,2], samples:[1,2]}] + }]; vm.totalPage = 1; vm.previousPage = false; vm.nextPage = false; diff --git a/template/admin/contest/contest_list.html b/template/admin/contest/contest_list.html index 0df7ba3..9fd4874 100644 --- a/template/admin/contest/contest_list.html +++ b/template/admin/contest/contest_list.html @@ -52,32 +52,32 @@ 请填写比赛描述 -
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -86,10 +86,31 @@
- +
+ +
+
+ + + + + + + + + + + + + +
编号题目测试数据
题目{{ $index+1 }}{{ el.title }}{{ el.testCaseList.length }}组 + 编辑 + 删除 +
+