mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-26 05:08:41 +00:00
refactor: contest problem page with bs5
This commit is contained in:
parent
67a1c80696
commit
315626200c
@ -10,6 +10,10 @@
|
|||||||
become404Page();
|
become404Page();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($_COOKIE['bootstrap4'])) {
|
||||||
|
$REQUIRE_LIB['bootstrap5'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$problem_content = queryProblemContent($problem['id']);
|
$problem_content = queryProblemContent($problem['id']);
|
||||||
|
|
||||||
$contest = validateUInt($_GET['contest_id']) ? queryContest($_GET['contest_id']) : null;
|
$contest = validateUInt($_GET['contest_id']) ? queryContest($_GET['contest_id']) : null;
|
||||||
@ -55,10 +59,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($_COOKIE['bootstrap4']) && !$contest) {
|
|
||||||
$REQUIRE_LIB['bootstrap5'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$submission_requirement = json_decode($problem['submission_requirement'], true);
|
$submission_requirement = json_decode($problem['submission_requirement'], true);
|
||||||
$problem_extra_config = getProblemExtraConfig($problem);
|
$problem_extra_config = getProblemExtraConfig($problem);
|
||||||
$custom_test_requirement = getProblemCustomTestRequirement($problem);
|
$custom_test_requirement = getProblemCustomTestRequirement($problem);
|
||||||
@ -254,6 +254,12 @@ EOD
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($contest): ?>
|
<?php if ($contest): ?>
|
||||||
|
|
||||||
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||||
|
<h1 class="h2 card-title text-center">
|
||||||
|
<?= $problem_letter ?>. <?= $problem['title'] ?>
|
||||||
|
</h1>
|
||||||
|
<?php else: ?>
|
||||||
<div class="page-header row">
|
<div class="page-header row">
|
||||||
<h1 class="col-md-3 text-left"><small><?= $contest['name'] ?></small></h1>
|
<h1 class="col-md-3 text-left"><small><?= $contest['name'] ?></small></h1>
|
||||||
<h1 class="col-md-7 text-center"><?= $problem_letter ?>. <?= $problem['title'] ?></h1>
|
<h1 class="col-md-7 text-center"><?= $problem_letter ?>. <?= $problem['title'] ?></h1>
|
||||||
@ -265,10 +271,11 @@ EOD
|
|||||||
</div>
|
</div>
|
||||||
<?php if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
<?php if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
checkContestNotice(<?= $contest['id'] ?>, '<?= UOJTime::$time_now_str ?>');
|
|
||||||
$('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJTime::$time_now->getTimestamp() ?>);
|
$('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJTime::$time_now->getTimestamp() ?>);
|
||||||
</script>
|
</script>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
||||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||||
@ -279,6 +286,15 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
#<?= $problem['id']?>. <?= $problem['title'] ?>
|
#<?= $problem['id']?>. <?= $problem['title'] ?>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||||
|
<div class="btn-group float-right" role="group">
|
||||||
|
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=problem&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-tasks"></span> 测试数据</a>
|
||||||
|
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=attachment&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-download-alt"></span> 附件下载</a>
|
||||||
|
<a role="button" class="btn btn-info" href="/problem/<?= $problem['id'] ?>/statistics"><span class="glyphicon glyphicon-stats"></span> <?= UOJLocale::get('problems::statistics') ?></a>
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||||
<div class="text-center small">
|
<div class="text-center small">
|
||||||
时间限制: <?= $time_limit != null ? "$time_limit s" : "N/A" ?>
|
时间限制: <?= $time_limit != null ? "$time_limit s" : "N/A" ?>
|
||||||
@ -291,15 +307,6 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
<hr>
|
<hr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
||||||
<div class="btn-group float-right" role="group">
|
|
||||||
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=problem&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-tasks"></span> 测试数据</a>
|
|
||||||
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=attachment&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-download-alt"></span> 附件下载</a>
|
|
||||||
<a role="button" class="btn btn-info" href="/problem/<?= $problem['id'] ?>/statistics"><span class="glyphicon glyphicon-stats"></span> <?= UOJLocale::get('problems::statistics') ?></a>
|
|
||||||
</div>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
<li class="nav-item"><a class="nav-link active" href="#tab-statement" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-book"></span> <?= UOJLocale::get('problems::statement') ?></a></li>
|
<li class="nav-item"><a class="nav-link active" href="#tab-statement" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-book"></span> <?= UOJLocale::get('problems::statement') ?></a></li>
|
||||||
@ -351,6 +358,34 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<aside class="col mt-3 mt-lg-0">
|
<aside class="col mt-3 mt-lg-0">
|
||||||
|
|
||||||
|
<?php if ($contest): ?>
|
||||||
|
<div class="card card-default mb-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<h3 class="h5 card-title text-center">
|
||||||
|
<a class="text-decoration-none text-body" href="/contest/<?= $contest['id'] ?>">
|
||||||
|
<?= $contest['name'] ?>
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
<div class="card-text text-center text-muted">
|
||||||
|
<?php if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||||
|
<span id="contest-countdown"></span>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= UOJLocale::get('contests::contest ended') ?>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer bg-transparent">
|
||||||
|
比赛评价:<?= getClickZanBlock('C', $contest['id'], $contest['zan']) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJTime::$time_now->getTimestamp() ?>, function(){}, '1.75rem', false);
|
||||||
|
</script>
|
||||||
|
<?php endif ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<div class="card card-default mb-2">
|
<div class="card card-default mb-2">
|
||||||
<ul class="nav nav-pills nav-fill flex-column" role="tablist">
|
<ul class="nav nav-pills nav-fill flex-column" role="tablist">
|
||||||
<li class="nav-item text-start">
|
<li class="nav-item text-start">
|
||||||
@ -382,7 +417,7 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php if ($contest): ?>
|
<?php if ($contest): ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item text-start">
|
||||||
<a class="nav-link" href="/contest/<?= $contest['id'] ?>" role="tab">
|
<a class="nav-link" href="/contest/<?= $contest['id'] ?>" role="tab">
|
||||||
<i class="bi bi-arrow-90deg-left"></i>
|
<i class="bi bi-arrow-90deg-left"></i>
|
||||||
<?= UOJLocale::get('contests::back to the contest') ?>
|
<?= UOJLocale::get('contests::back to the contest') ?>
|
||||||
@ -415,7 +450,13 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php uojIncludeView('sidebar', array()); ?>
|
<?php
|
||||||
|
$sidebar_config = array();
|
||||||
|
if ($contest && $contest['cur_progress'] <= CONTEST_IN_PROGRESS) {
|
||||||
|
$sidebar_config['upcoming_contests_hidden'] = '';
|
||||||
|
}
|
||||||
|
uojIncludeView('sidebar', $sidebar_config);
|
||||||
|
?>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -430,4 +471,10 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
|||||||
</script>
|
</script>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
<?php if ($contest && $contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
checkContestNotice(<?= $contest['id'] ?>, '<?= UOJTime::$time_now_str ?>');
|
||||||
|
</script>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<?php echoUOJPageFooter() ?>
|
<?php echoUOJPageFooter() ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user