feat(submission): display contest

This commit is contained in:
Baoshuo Ren 2023-02-23 11:16:15 +08:00
parent 513cf6c290
commit 571d5cddc3
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 20 additions and 3 deletions

View File

@ -265,7 +265,11 @@ if (isset($hack_form)) {
<div class="row mt-3 submission-layout d-md-grid">
<div class="submission-right-col">
<?php UOJSubmission::cur()->echoStatusCard(['show_actual_score' => $perm['score'], 'id_hidden' => true], Auth::user()) ?>
<?php UOJSubmission::cur()->echoStatusCard([
'show_actual_score' => $perm['score'],
'contest_problem_letter' => true,
'id_hidden' => true,
], Auth::user()) ?>
</div>
<div class="submission-left-col">

View File

@ -621,9 +621,10 @@ class UOJSubmission {
}
$rows = [
'id' => 'ID',
'submitter' => UOJLocale::get('problems::submitter'),
'id' => 'ID',
'problem' => UOJLocale::get('problems::problem'),
'contest' => UOJLocale::get('contests::contest'),
'result' => UOJLocale::get('problems::result'),
'used_time' => UOJLocale::get('problems::used time'),
'used_memory' => UOJLocale::get('problems::used memory'),

View File

@ -256,6 +256,8 @@ trait UOJSubmissionLikeTrait {
'time_format' => 'normal',
'time_font_size' => 'small',
'unknown_char' => '/',
'contest_problem_letter' => false,
'problem_title' => [],
];
switch ($name) {
@ -264,11 +266,21 @@ trait UOJSubmissionLikeTrait {
break;
case 'problem':
if ($this->problem) {
echo $this->problem->getLink(isset($cfg['problem_title']) ? $cfg['problem_title'] : []);
if ($cfg['contest_problem_letter']) {
echo $this->problem->getLink($cfg['problem_title'] + ['with' => 'letter', 'simplify' => true]);
} else {
echo $this->problem->getLink($cfg['problem_title']);
}
} else {
echo '<span class="text-danger">?</span>';
}
break;
case 'contest':
if ($this->problem && $this->problem->contest) {
echo $this->problem->contest->getLink();
} else {
echo '<span class="text-danger">?</span>';
}
case 'submitter':
case 'owner':
case 'hacker':