mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 08:23:20 +00:00
修复代码冲突
This commit is contained in:
parent
f250dec201
commit
7b3c14343b
@ -293,7 +293,8 @@ def contest_list_page(request, page=1):
|
||||
# 筛选我能参加的比赛
|
||||
join = request.GET.get("join", None)
|
||||
if join:
|
||||
contests = Contest.objects.filter(Q(contest_type__in=[1, 2]) | Q(groups__in=request.user.group_set.all()))
|
||||
contests = Contest.objects.filter(Q(contest_type__in=[1, 2]) | Q(groups__in=request.user.group_set.all())).\
|
||||
filter(end_time__gt=datetime.datetime.now(), start_time__lt=datetime.datetime.now())
|
||||
|
||||
paginator = Paginator(contests, 20)
|
||||
try:
|
||||
|
@ -6,36 +6,52 @@
|
||||
@import url("webuploader/webuploader.css");
|
||||
@import url("datetime_picker/bootstrap-datetimepicker.css");
|
||||
@import url("tagEditor/jquery.tag-editor.css");
|
||||
@import url("contest/add_contest.css");
|
||||
|
||||
#loading-gif{
|
||||
#loading-gif {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0; left: 0; bottom: 0; right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.line-chart{
|
||||
min-width:100%;
|
||||
.line-chart {
|
||||
min-width: 100%;
|
||||
max-height: 300px;
|
||||
}
|
||||
|
||||
.pie-chart{
|
||||
min-width:100%;
|
||||
.pie-chart {
|
||||
min-width: 100%;
|
||||
max-height: 300px;
|
||||
}
|
||||
|
||||
.chart-description{
|
||||
.chart-description {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pie-chart-container{
|
||||
.pie-chart-container {
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.tag-editor{
|
||||
.tag-editor {
|
||||
border: 1px solid #d9d9d9;
|
||||
border-top-color: silver;
|
||||
}
|
||||
|
||||
.group-tag {
|
||||
color: #46799b;
|
||||
background: #e0eaf1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border-radius: 2px 0 0 2px;
|
||||
float: left;
|
||||
padding: 0 4px;
|
||||
box-sizing: border-box;
|
||||
list-style-type: none;
|
||||
margin: 5px;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"], function ($, avalon, csrfTokenHeader, bsAlert, editor) {
|
||||
|
||||
avalon.ready(function () {
|
||||
if(avalon.vmodels.contestList){
|
||||
if (avalon.vmodels.contestList) {
|
||||
vm = avalon.vmodels.contestList;
|
||||
vm.editingContest = 0;
|
||||
}
|
||||
@ -58,11 +58,11 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"]
|
||||
vm.editingContestId = 0;
|
||||
else {
|
||||
vm.editingContestId = contestId;
|
||||
vm.editTitle = vm.contestList[contestId-1].title;
|
||||
vm.editEndTime = vm.contestList[contestId-1].end_time;
|
||||
vm.editPassword = vm.contestList[contestId-1].password;
|
||||
vm.editStartTime = vm.contestList[contestId-1].start_time;
|
||||
vm.editMode = vm.contestList[contestId-1].mode;
|
||||
vm.editTitle = vm.contestList[contestId - 1].title;
|
||||
vm.editEndTime = vm.contestList[contestId - 1].end_time;
|
||||
vm.editPassword = vm.contestList[contestId - 1].password;
|
||||
vm.editStartTime = vm.contestList[contestId - 1].start_time;
|
||||
vm.editMode = vm.contestList[contestId - 1].mode;
|
||||
vm.editChoseGroupList = [];
|
||||
//= vm.contestList[contestId-1].group;//
|
||||
/*for (var key in vm.contestList[contestId-1].groups){
|
||||
@ -74,11 +74,11 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"]
|
||||
id:parseInt(vm.contestList[contestId-1].groups)
|
||||
});
|
||||
}*/
|
||||
vm.editShowRank = vm.contestList[contestId-1].show_rank;
|
||||
vm.editShowSubmission = vm.contestList[contestId-1].show_user_submission;
|
||||
vm.editShowRank = vm.contestList[contestId - 1].show_rank;
|
||||
vm.editShowSubmission = vm.contestList[contestId - 1].show_user_submission;
|
||||
//vm.editProblemList = vm.contestList[contestId-1].problems
|
||||
editor("#editor").setValue(vm.contestList[contestId-1].description);
|
||||
vm.editingProblemList = vm.contestList[contestId-1].problemList;
|
||||
editor("#editor").setValue(vm.contestList[contestId - 1].description);
|
||||
vm.editingProblemList = vm.contestList[contestId - 1].problemList;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -133,27 +133,6 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker"]
|
||||
bsAlert(data.data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
beforeSend: csrfTokenHeader,
|
||||
url: url,
|
||||
dataType: "json",
|
||||
method: "get",
|
||||
contentType: "application/json",
|
||||
success: function (data) {
|
||||
if (!data.code) {
|
||||
if (isSuperAdmin)
|
||||
vm.groupList.push({id:0, name:"所有人", chose: false});
|
||||
for (var key in data.data) {
|
||||
data.data[key].chose = false;
|
||||
vm.groupList.push(data.data[key]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
bsAlert(data.data);
|
||||
console.log(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
avalon.scan();
|
||||
|
Loading…
Reference in New Issue
Block a user