mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 14:08:42 +00:00
feat(web/problems): ac rate tooltip
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
08bad49b58
commit
849baef6d3
@ -466,10 +466,6 @@ $pag = new Paginator($pag_config);
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
|
||||
});
|
||||
|
||||
var copy_url_toast = new bootstrap.Toast('#copy-url-toast', {
|
||||
delay: 2000
|
||||
});
|
||||
|
@ -31,15 +31,28 @@ function getProblemTR($info) {
|
||||
$html .= HTML::tag_end('td');
|
||||
if (isset($_COOKIE['show_submit_mode'])) {
|
||||
$perc = $info['submit_num'] > 0 ? round(100 * $info['ac_num'] / $info['submit_num']) : 0;
|
||||
$html .= '<td><a href="/submissions?problem_id=' . $info['id'] . '&min_score=100&max_score=100">×' . $info['ac_num'] . '</a></td>';
|
||||
$html .= '<td><a href="/submissions?problem_id=' . $info['id'] . '">×' . $info['submit_num'] . '</a></td>';
|
||||
$html .= '<td>';
|
||||
$html .= '<div class="progress bot-buffer-no">';
|
||||
$html .= '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $perc . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $perc . '%; min-width: 20px;">';
|
||||
$html .= $perc . '%';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= '</td>';
|
||||
|
||||
$html .= HTML::tag(
|
||||
'td',
|
||||
[],
|
||||
HTML::tag(
|
||||
'div',
|
||||
[
|
||||
'class' => 'progress',
|
||||
'data-bs-toggle' => 'tooltip',
|
||||
'data-bs-title' => "{$info['ac_num']} / {$info['submit_num']}",
|
||||
'data-bs-placement' => 'bottom',
|
||||
],
|
||||
HTML::tag('div', [
|
||||
'class' => 'progress-bar bg-success',
|
||||
'role' => 'progressbar',
|
||||
'aria-valuenow' => $perc,
|
||||
'aria-valuemin' => 0,
|
||||
'aria-valuemax' => 100,
|
||||
'style' => "width: {$perc}%; min-width: 20px;",
|
||||
], "{$perc}%")
|
||||
)
|
||||
);
|
||||
}
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
$html .= HTML::tag('td', [], $problem->getExtraConfig('difficulty'));
|
||||
@ -53,8 +66,6 @@ $header = '<tr>';
|
||||
$header .= '<th class="text-center" style="width:5em;">ID</th>';
|
||||
$header .= '<th>' . UOJLocale::get('problems::problem') . '</th>';
|
||||
if (isset($_COOKIE['show_submit_mode'])) {
|
||||
$header .= '<th class="text-center" style="width:4em">' . UOJLocale::get('problems::ac') . '</th>';
|
||||
$header .= '<th class="text-center" style="width:4em">' . UOJLocale::get('problems::submit') . '</th>';
|
||||
$header .= '<th class="text-center" style="width:125px;">' . UOJLocale::get('problems::ac ratio') . '</th>';
|
||||
}
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
|
@ -105,15 +105,28 @@ function getProblemTR($info) {
|
||||
$html .= HTML::tag_end('td');
|
||||
if (isset($_COOKIE['show_submit_mode'])) {
|
||||
$perc = $info['submit_num'] > 0 ? round(100 * $info['ac_num'] / $info['submit_num']) : 0;
|
||||
$html .= '<td><a href="/submissions?problem_id=' . $info['id'] . '&min_score=100&max_score=100">×' . $info['ac_num'] . '</a></td>';
|
||||
$html .= '<td><a href="/submissions?problem_id=' . $info['id'] . '">×' . $info['submit_num'] . '</a></td>';
|
||||
$html .= '<td>';
|
||||
$html .= '<div class="progress bot-buffer-no">';
|
||||
$html .= '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $perc . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $perc . '%; min-width: 20px;">';
|
||||
$html .= $perc . '%';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= '</td>';
|
||||
|
||||
$html .= HTML::tag(
|
||||
'td',
|
||||
[],
|
||||
HTML::tag(
|
||||
'div',
|
||||
[
|
||||
'class' => 'progress',
|
||||
'data-bs-toggle' => 'tooltip',
|
||||
'data-bs-title' => "{$info['ac_num']} / {$info['submit_num']}",
|
||||
'data-bs-placement' => 'bottom',
|
||||
],
|
||||
HTML::tag('div', [
|
||||
'class' => 'progress-bar bg-success',
|
||||
'role' => 'progressbar',
|
||||
'aria-valuenow' => $perc,
|
||||
'aria-valuemin' => 0,
|
||||
'aria-valuemax' => 100,
|
||||
'style' => "width: {$perc}%; min-width: 20px;",
|
||||
], "{$perc}%")
|
||||
)
|
||||
);
|
||||
}
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
$html .= HTML::tag('td', [], $problem->getExtraConfig('difficulty'));
|
||||
@ -174,8 +187,6 @@ $header = '<tr>';
|
||||
$header .= '<th class="text-center" style="width:5em;">ID</th>';
|
||||
$header .= '<th>' . UOJLocale::get('problems::problem') . '</th>';
|
||||
if (isset($_COOKIE['show_submit_mode'])) {
|
||||
$header .= '<th class="text-center" style="width:4em;">' . UOJLocale::get('problems::ac') . '</th>';
|
||||
$header .= '<th class="text-center" style="width:4em;">' . UOJLocale::get('problems::submit') . '</th>';
|
||||
$header .= '<th class="text-center" style="width:125px;">' . UOJLocale::get('problems::ac ratio') . '</th>';
|
||||
}
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
|
@ -4,6 +4,11 @@ if (!isset($ShowPageFooter)) {
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
|
||||
});
|
||||
</script>
|
||||
<?php if ($ShowPageFooter) : ?>
|
||||
<?php if (UOJNotice::shouldConstantlyCheckNotice()) : ?>
|
||||
<script type="text/javascript">
|
||||
|
Loading…
Reference in New Issue
Block a user