Compare commits

...

4 Commits

Author SHA1 Message Date
79d4c3832c
refactor: ranklist with bs5
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-24 11:55:34 +08:00
b25f4cc7f9
fix: table appraisal col width 2022-09-24 11:42:09 +08:00
92cca91cce
feat: countdowns and friend links locale 2022-09-24 11:40:26 +08:00
32859d67f3
fix: footer url 2022-09-24 11:29:05 +08:00
8 changed files with 46 additions and 15 deletions

View File

@ -117,12 +117,14 @@
<div class="card card-default mt-4">
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card-header bg-white">
<b>倒计时</b>
<b><?= UOJLocale::get('countdowns') ?></b>
</div>
<?php endif ?>
<div class="card-body">
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
<h4 class="card-title" style="font-size: 1.25rem">倒计时</h4>
<h4 class="card-title" style="font-size: 1.25rem">
<?= UOJLocale::get('view all') ?>
</h4>
<?php endif ?>
<ul class="
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
@ -138,27 +140,31 @@
?>
<li>
<?php if ($diff > 0): ?>
距离 <b><?= $countdown['title'] ?></b> 还有 <b><?= $diff ?></b> 天。
<?= UOJLocale::get('x days until countdown title', $countdown['title'], $diff) ?>
<?php else: ?>
<b><?= $countdown['title'] ?></b> 已开始。
<?= UOJLocale::get("countdown title has begun", $countdown['title']) ?>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
<?php if (count($countdowns) == 0): ?>
<div class="text-center">(无)</div>
<div class="text-center">
<?= UOJLocale::get('none') ?>
</div>
<?php endif ?>
</div>
</div>
<div class="card card-default mt-4">
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card-header bg-white">
<b>友情链接</b>
<b><?= UOJLocale::get('friend links') ?></b>
</div>
<?php endif ?>
<div class="card-body">
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
<h4 class="card-title" style="font-size: 1.25rem">友情链接</h4>
<h4 class="card-title" style="font-size: 1.25rem">
<?= UOJLocale::get('friend links') ?>
</h4>
<?php endif ?>
<ul class="
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
@ -178,7 +184,9 @@
<?php endforeach ?>
</ul>
<?php if (count($friend_links) == 0): ?>
<div class="text-center">(无)</div>
<div class="text-center">
<?= UOJLocale::get('none') ?>
</div>
<?php endif ?>
</div>
</div>

View File

@ -129,7 +129,7 @@ EOD;
$header .= '<th class="text-center" style="width:5em;">'.UOJLocale::get('problems::submit').'</th>';
$header .= '<th class="text-center" style="width:150px;">'.UOJLocale::get('problems::ac ratio').'</th>';
}
$header .= '<th class="text-center" style="width:180px;">'.UOJLocale::get('appraisal').'</th>';
$header .= '<th class="text-center" style="width:190px;">'.UOJLocale::get('appraisal').'</th>';
$header .= '</tr>';
$tabs_info = array(
@ -154,7 +154,7 @@ EOD;
? array('card', 'mb-3')
: array('table-responsive');
$table_classes = isset($REQUIRE_LIB['bootstrap5'])
? array('table', 'uoj-problem-list-table', 'mb-0')
? array('table', 'uoj-table', 'mb-0')
: array('table', 'table-bordered', 'table-hover', 'table-striped');
?>
<?php echoUOJPageHeader(UOJLocale::get('problems')) ?>

View File

@ -13,7 +13,15 @@
} else {
become404Page();
}
if (!isset($_COOKIE['bootstrap4'])) {
$REQUIRE_LIB['bootstrap5'] = '';
$config['div_classes'] = array('card', 'mb-3');
$config['table_classes'] = array('table', 'uoj-table', 'mb-0', 'text-center');
}
?>
<?php echoUOJPageHeader($title) ?>
<h1 class="h2"><?= $title ?></h1>
<?php echoRanklist($config) ?>
<?php echoUOJPageFooter() ?>

View File

@ -115,7 +115,7 @@ d-inline-block
'table_config' => (isset($REQUIRE_LIB['bootstrap5'])
? array(
'div_classes' => array('card', 'mb-3'),
'table_classes' => array('table', 'mb-0', 'uoj-submissions-table', 'text-center')
'table_classes' => array('table', 'mb-0', 'uoj-table', 'text-center')
)
: array()
),

View File

@ -75,6 +75,14 @@ return [
'refuse to answer' => 'Refuse to answer',
'male' => 'Male',
'female' => 'Female',
'countdowns' => 'Countdowns',
'countdown title has begun' => function($title) {
return "<b>$title</b> has begun.";
},
'x days until countdown title' => function($title, $days) {
return "<b>$days</b> ".($days <= 1 ? 'day' : 'days')." until <b>$title</b>.";
},
'friend links' => 'Friend Links',
'server time' => 'Server Time',
'opensource project' => 'OpenSource Project, modified by S2OJ'
];

View File

@ -75,6 +75,14 @@ return [
'refuse to answer' => '拒绝回答',
'male' => '男',
'female' => '女',
'countdowns' => '倒计时',
'countdown title has begun' => function($title) {
return "<b>$title</b> 已开始。";
},
'x days until countdown title' => function($title, $days) {
return "距离 <b>$title</b> 还有 <b>$days</b>天。";
},
'friend links' => '友情链接',
'server time' => '服务器时间',
'opensource project' => '开源项目S2OJ 魔改版'
];

View File

@ -10,8 +10,8 @@
<div class="container d-lg-flex justify-content-lg-between">
<p>
&copy; <?= date('Y') ?>
<a class="text-decoration-none" href="https://github.com/renbaoshuo/S2OJ<?= UOJConfig::$data['profile']['s2oj-version'] == "dev" ? '' : '/tree/' . UOJConfig::$data['profile']['s2oj-version'] ?>">S2OJ</a>
(build: <?= UOJConfig::$data['profile']['s2oj-version'] ?>)
<a class="text-decoration-none" href="<?= HTML::url('/') ?>">S2OJ</a>
(build: <a class="text-decoration-none" href="https://github.com/renbaoshuo/S2OJ<?= UOJConfig::$data['profile']['s2oj-version'] == "dev" ? '' : '/tree/' . UOJConfig::$data['profile']['s2oj-version'] ?>"><?= UOJConfig::$data['profile']['s2oj-version'] ?></a>)
<?= UOJLocale::get('server time') ?>: <?= UOJTime::$time_now_str ?>
</p>
<p>

View File

@ -43,8 +43,7 @@ label {
float: right;
}
.uoj-problem-list-table > tbody > tr:last-child,
.uoj-submissions-table > tbody > tr:last-child {
.uoj-table > tbody > tr:last-child {
border-bottom-color: transparent;
}