chore: remove card wrapping rank list
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-01-17 13:58:07 +08:00
parent 581cc68616
commit dfb317211e
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 35 additions and 19 deletions

View File

@ -134,17 +134,16 @@ UOJGroup::cur()->userCanView(Auth::user(), ['ensure' => true]);
</div>
</div>
<div class="card card-default mb-3">
<div class="card-body">
<h2 class="card-title h3">
<?= UOJLocale::get('top solver') ?>
</h2>
<div class="card mb-3">
<div class="card-header bg-transparent">
<h2 class="h3 mb-0"><?= UOJLocale::get('top solver') ?></h2>
</div>
<?php UOJRanklist::printHTML([
'page_len' => 15,
'group_id' => UOJGroup::info('id'),
'flush' => true,
]) ?>
</div>
</div>
<!-- end left col -->
</div>

View File

@ -60,17 +60,17 @@ $friend_links = DB::selectAll([
</div>
</div>
<?php if (Auth::check()) : ?>
<div class="mt-4 card">
<div class="card-body">
<h4 class="card-title mb-2"><?= UOJLocale::get('top solver') ?></h4>
<?php UOJRanklist::printHTML(['top10' => true]) ?>
<div class="text-center mt-2">
<a href="/solverlist" class="text-decoration-none">
<div class="card mt-4">
<div class="card-header bg-transparent">
<h4 class="mb-0"><?= UOJLocale::get('top solver') ?></h4>
</div>
<?php UOJRanklist::printHTML(['top10' => true, 'flush' => true]) ?>
<div class="card-footer bg-transparent text-center">
<a href="/solverlist">
<?= UOJLocale::get('view all') ?>
</a>
</div>
</div>
</div>
<?php else : ?>
<div class="mt-4 card card-default">
<div class="card-body text-center">

View File

@ -5,10 +5,13 @@ class UOJRanklist {
$cfg += [
'top10' => false,
'card' => false,
'flush' => false,
'group_id' => null,
'page_len' => 50,
];
$cfg['flush'] |= $cfg['card'];
$conds = [];
if ($cfg['group_id']) {
@ -86,6 +89,9 @@ class UOJRanklist {
if ($cfg['card']) {
echo '<div class="card my-3">';
}
if ($cfg['flush']) {
echo '<div class="list-group list-group-flush">';
} else {
echo '<div class="list-group">';
@ -104,7 +110,18 @@ class UOJRanklist {
if ($cfg['card']) {
echo '</div>';
}
if ($pag->n_pages > 1) {
if ($cfg['flush']) {
echo '<div class="list-group-item">';
}
echo $pag->pagination();
if ($cfg['flush']) {
echo '</div>';
}
}
}
/**