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

View File

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

View File

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