userCanView(Auth::user(), ['ensure' => true]); function getProblemTR($info) { $problem = new UOJProblem($info); $html = HTML::tag_begin('tr', ['class' => 'text-center']); $html .= HTML::tag('td', ['class' => $info['submission_id'] ? 'table-success' : ''], "#{$info['id']}"); $html .= HTML::tag_begin('td', ['class' => 'text-start align-middle']); $html .= $problem->getLink(['with' => 'none']); if ($problem->isUserOwnProblem(Auth::user())) { $html .= ' ' . UOJLocale::get('problems::my problem') . ' '; } if ($info['type'] == 'remote') { $html .= ' ' . HTML::tag('a', ['class' => 'badge text-bg-success align-middle', 'href' => '/problems/remote'], '远端评测题'); } if ($info['is_hidden']) { $html .= ' ' . UOJLocale::get('hidden') . ' '; } if (isset($_COOKIE['show_tags_mode'])) { $html .= HTML::tag_begin('span', ['class' => 'float-end']); foreach ($problem->queryTags() as $tag) { $html .= ' ' . '' . HTML::escape($tag) . '' . ' '; } $html .= HTML::tag_end('span'); } $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 .= HTML::tag( 'td', [ 'class' => 'align-middle', ], HTML::tag( 'div', [ 'class' => 'progress h-100', '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}%") ) ); } $html .= HTML::tag('td', [], $problem->getDifficultyHTML()); $html .= HTML::tag('td', [], ClickZans::getCntBlock($problem->info['zan'])); $html .= HTML::tag_end('tr'); return $html; } $header = '