feat(submissions): submission status detail display
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-19 08:02:28 +08:00
parent ab4dff592c
commit d824955ebe
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 18 additions and 2 deletions

View File

@ -56,8 +56,13 @@ function echoSubmissionItem($info) {
'unknown_char' => '?', 'unknown_char' => '?',
'result_badge' => true, 'result_badge' => true,
]; ];
$show_status_details = $submission->viewerCanSeeStatusDetailsHTML(Auth::user());
if ($show_status_details) {
echo '<div class="list-group-item bg-warning bg-opacity-25">';
} else {
echo '<div class="list-group-item">'; echo '<div class="list-group-item">';
}
echo '<div class="row gy-2 align-items-center">'; echo '<div class="row gy-2 align-items-center">';
echo '<div class="col-lg-3 col-sm-8 d-flex gap-2">'; echo '<div class="col-lg-3 col-sm-8 d-flex gap-2">';
@ -98,6 +103,17 @@ function echoSubmissionItem($info) {
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
if ($show_status_details) {
echo '<div class="list-group-item">';
echo '<table class="w-100">';
echo '<tr id="status_details_' . $submission->info['id'] . '">';
echo $submission->getStatusDetailsHTML();
echo '</tr>';
echo '<script>update_judgement_status_details(' . $submission->info['id'] . ')</script>';
echo '</table>';
echo '</div>';
}
} }
$pag = new Paginator([ $pag = new Paginator([

View File

@ -532,7 +532,7 @@ class UOJSubmission {
} }
} else { } else {
if ($cfg['result_badge']) { if ($cfg['result_badge']) {
echo $tag_st, ' class="fs-5"><span class="badge text-bg-primary">', $this->publicStatus(), '</span>', $tag_ed; echo $tag_st, ' class="fs-5"><span class="badge text-white bg-primary">', $this->publicStatus(), '</span>', $tag_ed;
} else { } else {
echo $tag_st, ' class="small text-decoration-none">', $this->publicStatus(), $tag_ed; echo $tag_st, ' class="small text-decoration-none">', $this->publicStatus(), $tag_ed;
} }