Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
daizeyao committed Mar 12, 2024
1 parent b4880a6 commit 344eac3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions web/OJ/template/hznu/study_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@
?>

<style>
.am-modal-hd {
display: flex;
justify-content: center;
align-items: center;
}
</style>

<div class="am-g" style="margin-top: 50px;">
Expand All @@ -94,17 +89,22 @@
</div>
</div>

<div class="am-popup" style="font-size: 20px; height: 30%; border-radius: 20px" tabindex="-1" id="modal-study">
<div class="am-popup-inner">

<div class="am-modal am-modal-no-btn" tabindex="-1" id="modal-study">
<div class="am-modal-dialog" style="font-size: 20px; width:30%; border-radius: 20px" tabindex="-1" id="modal-study">

<div class="am-modal-hd">Solved
<a class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>

<div class="am-modal-bd" id="modal-solved-bd">
<i class="am-icon-spinner am-icon-pulse"></i> Loading...
</div>

<div class="am-modal-hd">Recommended
<a class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>

<div class="am-modal-bd" id="modal-recommend-bd">
<i class="am-icon-spinner am-icon-pulse"></i> Loading...
</div>
Expand Down Expand Up @@ -346,14 +346,24 @@
var solvedLinks = data.solved.map(function(problemId, index) {
return '<a href="/OJ/problem.php?id=' + problemId + '">' + problemId + '</a>';
});
if (solvedLinks.length === 0) {
solvedLinks = ['No Problem Now!'];
}
$('#modal-solved-bd').html(solvedLinks.join(' '));

// 生成未解决问题的链接
var unsolvedLinks = data.unsolved.map(function(problemId, index) {
return '<a href="/OJ/problem.php?id=' + problemId + '">' + problemId + '</a>';
});
if (unsolvedLinks.length === 0) {
unsolvedLinks = ['No Problem Now!'];
}
$('#modal-recommend-bd').html(unsolvedLinks.join(' '));

// 更新弹窗标题
$('.am-modal-hd').eq(0).text('Solved (' + data.solved.length + ')');
$('.am-modal-hd').eq(1).text('Recommended (' + data.unsolved.length + ')');

// 显示弹窗
$('#modal-study').modal();
}
Expand Down

0 comments on commit 344eac3

Please sign in to comment.