feat(problem): show start_time of contests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-16 11:47:20 +08:00
parent 0f3c934adc
commit 27a4f1a8f1
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -315,9 +315,13 @@ if (UOJContest::cur()) {
<div class="alert alert-light"> <div class="alert alert-light">
<h5 class="alert-heading"><?= UOJLocale::get('problems::the problem was used in the following contest') ?>:</h5> <h5 class="alert-heading"><?= UOJLocale::get('problems::the problem was used in the following contest') ?>:</h5>
<ul class="mb-0"> <ul class="mb-0">
<?php usort($contest_problems, fn ($a, $b) => $a->contest->info['start_time'] < $b->contest->info['start_time']); ?>
<?php foreach ($contest_problems as $cp) : ?> <?php foreach ($contest_problems as $cp) : ?>
<?php if ($cp->userCanView(Auth::user())) : ?> <?php if ($cp->userCanView(Auth::user())) : ?>
<li><?= $cp->contest->getLink(['class' => 'alert-link text-decoration-underline']) ?></li> <li>
<?= $cp->contest->getLink(['class' => 'alert-link text-decoration-underline']) ?>
<small>(<?= $cp->contest->info['start_time_str'] ?>)</small>
</li>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>