mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 14:48:41 +00:00
This commit is contained in:
parent
236a152f51
commit
277e69f507
@ -7,10 +7,7 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
function echoBlogCell($blog) {
|
||||
@ -45,22 +42,16 @@
|
||||
</tr>
|
||||
EOD;
|
||||
$config = [
|
||||
'table_classes' => ['table', 'table-hover'],
|
||||
'page_len' => 40
|
||||
'page_len' => 40,
|
||||
'div_classes' => ['card', 'my-3'],
|
||||
'table_classes' => ['table', 'uoj-table', 'mb-0'],
|
||||
];
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$config['div_classes'] = ['card', 'my-3'];
|
||||
$config['table_classes'] = ['table', 'uoj-table', 'mb-0'];
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('announcements')) ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row">
|
||||
<!-- left col -->
|
||||
<div class="col-lg-9">
|
||||
<?php endif ?>
|
||||
|
||||
<h1 class="h2">
|
||||
<?= UOJLocale::get('announcements') ?>
|
||||
@ -68,7 +59,6 @@ EOD;
|
||||
|
||||
<?php echoLongTable(array('blogs.id', 'poster', 'title', 'post_time', 'zan', 'level'), 'important_blogs, blogs', 'is_hidden = 0 and important_blogs.blog_id = blogs.id', 'order by level desc, important_blogs.blog_id desc', $header, 'echoBlogCell', $config); ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<!-- end left col -->
|
||||
|
||||
@ -79,6 +69,5 @@ EOD;
|
||||
<!-- end right col -->
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -8,62 +9,21 @@
|
||||
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
|
||||
become403Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
function echoBlogCell($blog) {
|
||||
global $REQUIRE_LIB;
|
||||
|
||||
echo '<tr>';
|
||||
if ($blog['is_hidden']) {
|
||||
echo '<td><span class="text-danger">[已隐藏]</span> ' . getBlogLink($blog['id']) . '</td>';
|
||||
} else {
|
||||
echo '<td>' . getBlogLink($blog['id']) . '</td>';
|
||||
}
|
||||
echo '<td>' . getUserLink($blog['poster']) . '</td>';
|
||||
echo '<td>' . $blog['post_time'] . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
$header = <<<EOD
|
||||
<tr>
|
||||
<th width="60%">标题</th>
|
||||
<th width="20%">发表者</th>
|
||||
<th width="20%">发表日期</th>
|
||||
</tr>
|
||||
EOD;
|
||||
$config = array();
|
||||
$config['table_classes'] = array('table', 'table-hover');
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$config['div_classes'] = array('card', 'my-3', 'table-responsive');
|
||||
$config['table_classes'] = array('table', 'uoj-table', 'mb-0');
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('blogs')) ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row">
|
||||
|
||||
<!-- left col -->
|
||||
<div class="col-lg-9">
|
||||
<div class="d-flex flex-wrap justify-content-between">
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<?php if (Auth::check()): ?>
|
||||
<div class="float-right">
|
||||
<div class="btn-group">
|
||||
<a href="<?= HTML::blog_url(Auth::id(), '/') ?>" class="btn btn-secondary btn-sm">我的博客首页</a>
|
||||
<a href="<?= HTML::blog_url(Auth::id(), '/post/new/write')?>" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-edit"></span> 写新博客</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<!-- title container -->
|
||||
<div class="d-flex flex-wrap justify-content-between align-items-center">
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<h1 class="h2">
|
||||
<?= UOJLocale::get("blogs overview") ?>
|
||||
</h1>
|
||||
|
||||
<div class="text-end">
|
||||
<div class="btn-group">
|
||||
<a href="<?= HTML::blog_url(Auth::id(), '/') ?>" class="btn btn-secondary btn-sm">
|
||||
@ -75,24 +35,50 @@ EOD;
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<h3>博客总览</h3>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<!-- end title container -->
|
||||
|
||||
<?php echoLongTable(array('id', 'poster', 'title', 'post_time', 'zan', 'is_hidden'), 'blogs', isSuperUser($myUser) ? "1" : "is_hidden = 0 or poster = '{$myUser['username']}'", 'order by post_time desc', $header, 'echoBlogCell', $config); ?>
|
||||
<?php
|
||||
echoLongTable(
|
||||
['id', 'poster', 'title', 'post_time', 'zan', 'is_hidden'],
|
||||
'blogs',
|
||||
isSuperUser($myUser) ? "1" : "is_hidden = 0 or poster = '{$myUser['username']}'",
|
||||
'order by post_time desc',
|
||||
<<<EOD
|
||||
<tr>
|
||||
<th width="60%">标题</th>
|
||||
<th width="20%">发表者</th>
|
||||
<th width="20%">发表日期</th>
|
||||
</tr>
|
||||
EOD,
|
||||
function($blog) {
|
||||
echo '<tr>';
|
||||
echo '<td>';
|
||||
echo getBlogLink($blog['id']);
|
||||
if ($blog['is_hidden']) {
|
||||
echo ' <span class="badge text-bg-danger"><i class="bi bi-eye-slash-fill"></i> ', UOJLocale::get('hidden'), '</span> ';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td>' . getUserLink($blog['poster']) . '</td>';
|
||||
echo '<td>' . $blog['post_time'] . '</td>';
|
||||
echo '</tr>';
|
||||
},
|
||||
[
|
||||
'page_len' => 10,
|
||||
'div_classes' => ['card', 'my-3', 'table-responsive'],
|
||||
'table_classes' => ['table', 'uoj-table', 'mb-0'],
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
|
||||
<!-- right col -->
|
||||
<aside class="col-lg-3 mt-3 mt-lg-0">
|
||||
<?php uojIncludeView('sidebar', array()) ?>
|
||||
<?php uojIncludeView('sidebar') ?>
|
||||
</aside>
|
||||
<!-- end right col -->
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('mathjax');
|
||||
requirePHPLib('form');
|
||||
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
$REQUIRE_LIB['mathjax'] = '';
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
redirectToLogin();
|
||||
}
|
||||
@ -354,7 +353,7 @@ EOD;
|
||||
}
|
||||
|
||||
function echoDashboard() {
|
||||
global $contest, $post_notice, $post_question, $reply_question, $REQUIRE_LIB;
|
||||
global $contest, $post_notice, $post_question, $reply_question;
|
||||
|
||||
$myname = Auth::id();
|
||||
$contest_problems = DB::selectAll("select contests_problems.problem_id, best_ac_submissions.submission_id from contests_problems left join best_ac_submissions on contests_problems.problem_id = best_ac_submissions.problem_id and submitter = '{$myname}' where contest_id = {$contest['id']} order by contests_problems.dfn, contests_problems.problem_id");
|
||||
@ -389,7 +388,6 @@ EOD;
|
||||
'post_question' => $post_question,
|
||||
'my_questions_pag' => $my_questions_pag,
|
||||
'others_questions_pag' => $others_questions_pag,
|
||||
'REQUIRE_LIB' => $REQUIRE_LIB,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -13,10 +14,6 @@
|
||||
become404Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
genMoreContestInfo($contest);
|
||||
|
||||
if (isSuperUser($myUser)) {
|
||||
@ -178,26 +175,24 @@
|
||||
?>
|
||||
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . UOJLocale::get('contests::contest registrants')) ?>
|
||||
|
||||
<h1 class="h2 text-center"><?= $contest['name'] ?></h1>
|
||||
<h1 class="h2 text-center">
|
||||
<?= $contest['name'] ?>
|
||||
</h1>
|
||||
|
||||
<?php if ($contest['cur_progress'] == CONTEST_NOT_STARTED): ?>
|
||||
<?php if ($iHasRegistered): ?>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<a style="color:green">已报名</a>
|
||||
</div>
|
||||
<div class="col-6
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-end
|
||||
<?php else: ?>
|
||||
text-right
|
||||
<?php endif ?>">
|
||||
<div class="col-6 text-end">
|
||||
<?php $unregister_form->printHTML(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div>当前尚未报名,您可以<a style="color:red" href="/contest/<?= $contest['id'] ?>/register">报名</a>。</div>
|
||||
<div>当前尚未报名,您可以 <a class="text-decoration-none text-danger" href="/contest/<?= $contest['id'] ?>/register">报名</a>。</div>
|
||||
<?php endif ?>
|
||||
<div class="top-buffer-sm"></div>
|
||||
<div class="mt-2"></div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
@ -220,14 +215,45 @@
|
||||
}
|
||||
$header_row .= '</tr>';
|
||||
|
||||
$config = array('page_len' => 100,
|
||||
'get_row_index' => '',
|
||||
'print_after_table' => function() {
|
||||
global $add_new_contestant_form,
|
||||
$add_group_to_contest_form,
|
||||
$remove_user_from_contest_form,
|
||||
$force_set_user_participated_form;
|
||||
echoLongTable(
|
||||
['*'],
|
||||
'contests_registrants',
|
||||
"contest_id = {$contest['id']}",
|
||||
'order by username desc',
|
||||
$header_row,
|
||||
function($contestant, $num) use ($myUser, $has_contest_permission, $show_ip, $ip_owner, $has_participated) {
|
||||
$user = queryUser($contestant['username']);
|
||||
|
||||
if (!$show_ip) {
|
||||
echo '<tr>';
|
||||
} else {
|
||||
if ($ip_owner[$user['remote_addr']] != $user['username'] || $forwarded_ip_owner[$user['http_x_forwarded_for']] != $user['username']) {
|
||||
echo '<tr class="table-danger">';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
}
|
||||
}
|
||||
echo '<td>'.$num.'</td>';
|
||||
echo '<td>'.getUserLink($contestant['username']).'</td>';
|
||||
if ($show_ip) {
|
||||
echo '<td>'.$user['remote_addr'].'</td>';
|
||||
echo '<td>'.$user['http_x_forwarded_for'].'</td>';
|
||||
}
|
||||
if ($has_contest_permission) {
|
||||
echo '<td>'.($contestant['has_participated'] ? 'Yes' : 'No').'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
},
|
||||
[
|
||||
'page_len' => 50,
|
||||
'get_row_index' => '',
|
||||
'div_classes' => ['table-responsive', 'card', 'mb-3'],
|
||||
'table_classes' => ['table', 'uoj-table', 'mb-0', 'text-center'],
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($add_new_contestant_form)) {
|
||||
$add_new_contestant_form->printHTML();
|
||||
}
|
||||
@ -240,43 +266,5 @@
|
||||
if (isset($force_set_user_participated_form)) {
|
||||
$force_set_user_participated_form->printHTML();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$config['div_classes'] = array('card', 'mb-3');
|
||||
$config['table_classes'] = array('table', 'uoj-table', 'mb-0', 'text-center');
|
||||
}
|
||||
|
||||
echoLongTable(array('*'), 'contests_registrants', "contest_id = {$contest['id']}", 'order by username desc',
|
||||
$header_row,
|
||||
function($contest, $num) {
|
||||
global $myUser;
|
||||
global $has_contest_permission, $show_ip, $ip_owner, $has_participated;
|
||||
|
||||
$user = queryUser($contest['username']);
|
||||
$user_link = getUserLink($contest['username']);
|
||||
if (!$show_ip) {
|
||||
echo '<tr>';
|
||||
} else {
|
||||
if ($ip_owner[$user['remote_addr']] != $user['username'] || $forwarded_ip_owner[$user['http_x_forwarded_for']] != $user['username']) {
|
||||
echo '<tr class="danger">';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
}
|
||||
}
|
||||
echo '<td>'.$num.'</td>';
|
||||
echo '<td>'.$user_link.'</td>';
|
||||
if ($show_ip) {
|
||||
echo '<td>'.$user['remote_addr'].'</td>';
|
||||
echo '<td>'.$user['http_x_forwarded_for'].'</td>';
|
||||
}
|
||||
if ($has_contest_permission) {
|
||||
echo '<td>'.($has_participated[$user['username']] ? 'Yes' : 'No').'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
},
|
||||
$config
|
||||
);
|
||||
?>
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -1,28 +1,19 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
redirectToLogin();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$upcoming_contest_name = null;
|
||||
$upcoming_contest_href = null;
|
||||
$rest_second = 1000000;
|
||||
function echoContest($contest) {
|
||||
global $myUser, $upcoming_contest_name, $upcoming_contest_href, $rest_second, $REQUIRE_LIB;
|
||||
|
||||
$a_class = ' ';
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$a_class = ' class="text-decoration-none" ';
|
||||
}
|
||||
global $myUser, $upcoming_contest_name, $upcoming_contest_href, $rest_second;
|
||||
|
||||
$contest_name_link = <<<EOD
|
||||
<a $a_class href="/contest/{$contest['id']}">{$contest['name']}</a>
|
||||
<a class="text-decoration-none" href="/contest/{$contest['id']}">{$contest['name']}</a>
|
||||
EOD;
|
||||
genMoreContestInfo($contest);
|
||||
if ($contest['cur_progress'] == CONTEST_NOT_STARTED) {
|
||||
@ -33,18 +24,18 @@ EOD;
|
||||
$rest_second = $cur_rest_second;
|
||||
}
|
||||
if ($myUser != null && hasRegistered($myUser, $contest)) {
|
||||
$contest_name_link .= '<sup><a '.$a_class.' style="color:green">'.UOJLocale::get('contests::registered').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:green">'.UOJLocale::get('contests::registered').'</a></sup>';
|
||||
} else {
|
||||
$contest_name_link .= '<sup><a '.$a_class.' style="color:red" href="/contest/'.$contest['id'].'/register">'.UOJLocale::get('contests::register').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:red" href="/contest/'.$contest['id'].'/register">'.UOJLocale::get('contests::register').'</a></sup>';
|
||||
}
|
||||
} elseif ($contest['cur_progress'] == CONTEST_IN_PROGRESS) {
|
||||
$contest_name_link .= '<sup><a '.$a_class.' style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::in progress').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::in progress').'</a></sup>';
|
||||
} elseif ($contest['cur_progress'] == CONTEST_PENDING_FINAL_TEST) {
|
||||
$contest_name_link .= '<sup><a '.$a_class.' style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::pending final test').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::pending final test').'</a></sup>';
|
||||
} elseif ($contest['cur_progress'] == CONTEST_TESTING) {
|
||||
$contest_name_link .= '<sup><a '.$a_class.' style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::final testing').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:blue" href="/contest/'.$contest['id'].'">'.UOJLocale::get('contests::final testing').'</a></sup>';
|
||||
} elseif ($contest['cur_progress'] == CONTEST_FINISHED) {
|
||||
$contest_name_link .= '<sup><a '.$a_class.'style="color:grey" href="/contest/'.$contest['id'].'/standings">'.UOJLocale::get('contests::ended').'</a></sup>';
|
||||
$contest_name_link .= '<sup><a class="text-decoration-none" style="color:grey" href="/contest/'.$contest['id'].'/standings">'.UOJLocale::get('contests::ended').'</a></sup>';
|
||||
}
|
||||
|
||||
$last_hour = round($contest['last_min'] / 60, 2);
|
||||
@ -52,44 +43,33 @@ EOD;
|
||||
$click_zan_block = getClickZanBlock('C', $contest['id'], $contest['zan']);
|
||||
echo '<tr>';
|
||||
echo '<td>', $contest_name_link, '</td>';
|
||||
echo '<td>', '<a'.$a_class.'href="'.HTML::timeanddate_url($contest['start_time'], array('duration' => $contest['last_min'])).'">'.$contest['start_time_str'].'</a>', '</td>';
|
||||
echo '<td>', '<a class="text-decoration-none" href="'.HTML::timeanddate_url($contest['start_time'], array('duration' => $contest['last_min'])).'">'.$contest['start_time_str'].'</a>', '</td>';
|
||||
echo '<td>', UOJLocale::get('hours', $last_hour), '</td>';
|
||||
echo '<td>', '<a'.$a_class.'href="/contest/'.$contest['id'].'/registrants">';
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
echo '<i class="bi bi-person-fill"></i>';
|
||||
} else {
|
||||
echo '<span class="glyphicon glyphicon-user"></span>';
|
||||
}
|
||||
|
||||
echo ' ×'.$contest['player_num'].'</a>', '</td>';
|
||||
echo '<td>', '<a class="text-decoration-none" href="/contest/'.$contest['id'].'/registrants">', '<i class="bi bi-person-fill"></i>', ' ×'.$contest['player_num'].'</a>', '</td>';
|
||||
echo '<td>', '<div class="text-left">'.$click_zan_block.'</div>', '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('contests')) ?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
|
||||
<!-- title container -->
|
||||
<div class="d-flex justify-content-between">
|
||||
<?php endif ?>
|
||||
<h1 class="h2">
|
||||
<?= UOJLocale::get('contests') ?>
|
||||
</h1>
|
||||
<?php
|
||||
if (isSuperUser($myUser)) {
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
echo '<div class="text-end">';
|
||||
} else {
|
||||
echo '<div class="text-right">';
|
||||
}
|
||||
echo '<a href="/contest/new" class="btn btn-primary">'.UOJLocale::get('contests::add new contest').'</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<?php if (isSuperUser($myUser)): ?>
|
||||
<div class="text-end">
|
||||
<a href="/contest/new" class="btn btn-primary"><?= UOJLocale::get('contests::add new contest') ?></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<h4><?= UOJLocale::get('contests::current or upcoming contests') ?></h4>
|
||||
|
||||
</div>
|
||||
<!-- end title container -->
|
||||
|
||||
<h2 class="h4">
|
||||
<?= UOJLocale::get('contests::current or upcoming contests') ?>
|
||||
</h2>
|
||||
<?php
|
||||
$table_header = '';
|
||||
$table_header .= '<tr>';
|
||||
@ -100,12 +80,18 @@ if (isSuperUser($myUser)) {
|
||||
$table_header .= '<th style="width:180px;">'.UOJLocale::get('appraisal').'</th>';
|
||||
$table_header .= '</tr>';
|
||||
|
||||
$table_config = array('page_len' => 40);
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$table_config['div_classes'] = array('card', 'mb-3');
|
||||
$table_config['table_classes'] = array('table', 'uoj-table', 'mb-0', 'text-center');
|
||||
}
|
||||
echoLongTable(array('*'), 'contests', "status != 'finished'", 'order by start_time asc, id asc', $table_header,
|
||||
$table_config = [
|
||||
'page_len' => 40,
|
||||
'div_classes' => ['card', 'mb-3'],
|
||||
'table_classes' => ['table', 'uoj-table', 'mb-0', 'text-center'],
|
||||
];
|
||||
|
||||
echoLongTable(
|
||||
['*'],
|
||||
'contests',
|
||||
"status != 'finished'",
|
||||
'order by start_time asc, id asc',
|
||||
$table_header,
|
||||
echoContest,
|
||||
$table_config
|
||||
);
|
||||
@ -128,9 +114,16 @@ EOD;
|
||||
}
|
||||
?>
|
||||
|
||||
<h4><?= UOJLocale::get('contests::ended contests') ?></h4>
|
||||
<h2 class="h4">
|
||||
<?= UOJLocale::get('contests::ended contests') ?>
|
||||
</h2>
|
||||
<?php
|
||||
echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by start_time desc, id desc', $table_header,
|
||||
echoLongTable(
|
||||
['*'],
|
||||
'contests',
|
||||
"status = 'finished'",
|
||||
'order by start_time desc, id desc',
|
||||
$table_header,
|
||||
echoContest,
|
||||
$table_config
|
||||
);
|
||||
|
@ -3,28 +3,20 @@
|
||||
$countdowns = DB::selectAll("select * from countdowns order by end_time asc");
|
||||
$friend_links = DB::selectAll("select * from friend_links order by level desc, id asc");
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
requireLib('bootstrap5');
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJConfig::$data['profile']['oj-name-short']) ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="card card-default">
|
||||
<div class="card-body">
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<h4 class="card-title">
|
||||
<?= UOJLocale::get('announcements') ?>
|
||||
</h4>
|
||||
<?php endif ?>
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:60%">
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<?= UOJLocale::get('announcements') ?>
|
||||
<?php endif ?>
|
||||
</th>
|
||||
<th style="width:60%"></th>
|
||||
<th style="width:20%"></th>
|
||||
<th style="width:20%"></th>
|
||||
</tr>
|
||||
@ -41,11 +33,7 @@
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/blogs/<?= $blog['id'] ?>"
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
class="text-decoration-none"
|
||||
<?php endif ?>
|
||||
><?= $blog['title'] ?></a>
|
||||
<a href="/blogs/<?= $blog['id'] ?>" class="text-decoration-none"><?= $blog['title'] ?></a>
|
||||
<?= $new_tag ?>
|
||||
</td>
|
||||
<td>by <?= getUserLink($blog['poster']) ?></td>
|
||||
@ -55,51 +43,33 @@
|
||||
<?php for ($i = $now_cnt + 1; $i <= 5; $i++): ?>
|
||||
<tr><td colspan="233"> </td></tr>
|
||||
<?php endfor ?>
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<tr><td class="text-right" colspan="233"><a href="/announcements"><?= UOJLocale::get('all the announcements') ?></a></td></tr>
|
||||
<?php endif ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="text-end">
|
||||
<a class="text-decoration-none" href="/announcements"><?= UOJLocale::get('all the announcements') ?></a>
|
||||
<a class="text-decoration-none" href="/announcements">
|
||||
<?= UOJLocale::get('all the announcements') ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!UOJConfig::$data['switch']['force-login'] || Auth::check()): ?>
|
||||
<?php if (!UOJConfig::$data['switch']['force-login'] || isNormalUser($myUser)): ?>
|
||||
|
||||
<div class="mt-4
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
card
|
||||
<?php endif ?>
|
||||
">
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="mt-4 card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title"><?= UOJLocale::get('top solver') ?></h4>
|
||||
<?php else: ?>
|
||||
<h3><?= UOJLocale::get('top solver') ?></h3>
|
||||
<?php endif ?>
|
||||
<?php echoRanklist(array(
|
||||
<?php echoRanklist([
|
||||
'echo_full' => true,
|
||||
'top10' => true,
|
||||
'by_accepted' => true,
|
||||
'table_classes' => isset($REQUIRE_LIB['bootstrap5'])
|
||||
? array('table', 'text-center')
|
||||
: array('table', 'table-bordered', 'table-hover', 'table-striped', 'table-text-center'),
|
||||
)) ?>
|
||||
'table_classes' => ['table', 'text-center'],
|
||||
]) ?>
|
||||
<div class="text-center">
|
||||
<a href="/solverlist"
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
class="text-decoration-none"
|
||||
<?php endif ?>
|
||||
><?= UOJLocale::get('view all') ?></a>
|
||||
<a href="/solverlist" class="text-decoration-none">
|
||||
<?= UOJLocale::get('view all') ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
@ -115,23 +85,11 @@
|
||||
<img class="media-object img-thumbnail" src="/images/logo.png" alt="Logo" />
|
||||
</div>
|
||||
<div class="card card-default mb-2">
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card-header bg-white">
|
||||
<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">
|
||||
<?= UOJLocale::get('countdowns') ?>
|
||||
</h4>
|
||||
<?php endif ?>
|
||||
<ul class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
list-unstyled
|
||||
<?php else: ?>
|
||||
pl-4
|
||||
<?php endif ?> mb-0">
|
||||
<ul class="list-unstyled mb-0">
|
||||
<?php foreach ($countdowns as $countdown): ?>
|
||||
<?php
|
||||
$enddate = strtotime($countdown['end_time']);
|
||||
@ -156,37 +114,20 @@
|
||||
</div>
|
||||
|
||||
<?php if (Auth::check()): ?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<?php uojIncludeView('sidebar', ['assignments_hidden' => '', 'groups_hidden' => '']) ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="card card-default mb-2">
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card-header bg-white">
|
||||
<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">
|
||||
<?= UOJLocale::get('friend links') ?>
|
||||
</h4>
|
||||
<?php endif ?>
|
||||
<ul class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
ps-3
|
||||
<?php else: ?>
|
||||
pl-4
|
||||
<?php endif ?>
|
||||
mb-0">
|
||||
<ul class="ps-3 mb-0">
|
||||
<?php foreach ($friend_links as $friend_link): ?>
|
||||
<li>
|
||||
<a
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
class="text-decoration-none"
|
||||
<?php endif ?>
|
||||
href="<?= $friend_link['url'] ?>" target="_blank"><?= $friend_link['title'] ?></a>
|
||||
<a class="text-decoration-none" href="<?= $friend_link['url'] ?>" target="_blank">
|
||||
<?= $friend_link['title'] ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
@ -2,6 +2,9 @@
|
||||
use Gregwar\Captcha\PhraseBuilder;
|
||||
use Gregwar\Captcha\CaptchaBuilder;
|
||||
|
||||
requireLib('md5');
|
||||
requireLib('bootstrap5');
|
||||
|
||||
if (Auth::check()) {
|
||||
redirectTo('/');
|
||||
}
|
||||
@ -50,10 +53,6 @@
|
||||
die();
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
$REQUIRE_LIB['md5'] = '';
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('login')) ?>
|
||||
|
||||
<style>
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('hljs');
|
||||
requireLib('mathjax');
|
||||
requirePHPLib('form');
|
||||
requirePHPLib('judger');
|
||||
|
||||
@ -10,10 +13,6 @@
|
||||
become404Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$problem_content = queryProblemContent($problem['id']);
|
||||
|
||||
$contest = validateUInt($_GET['contest_id']) ? queryContest($_GET['contest_id']) : null;
|
||||
@ -220,16 +219,6 @@ EOD
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
requireLib('mathjax');
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
requireLib('hljs');
|
||||
} else {
|
||||
$REQUIRE_LIB['shjs'] = '';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::problem')) ?>
|
||||
<?php
|
||||
$limit = getUOJConf("/var/uoj_data/{$problem['id']}/problem.conf");
|
||||
@ -239,14 +228,12 @@ EOD
|
||||
$problem_uploader = $problem['uploader'];
|
||||
?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row">
|
||||
|
||||
<!-- Left col -->
|
||||
<div class="col-lg-9">
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5']) && $contest): ?>
|
||||
<?php if ($contest): ?>
|
||||
<!-- 比赛导航 -->
|
||||
<?php
|
||||
$tabs_info = array(
|
||||
@ -287,65 +274,17 @@ EOD
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row d-flex justify-content-center">
|
||||
<span class="badge badge-secondary mr-1">时间限制:<?=$time_limit!=null?"$time_limit s":"N/A"?></span>
|
||||
<span class="badge badge-secondary mr-1">空间限制:<?=$memory_limit!=null?"$memory_limit MB":"N/A"?></span>
|
||||
<span class="badge badge-secondary mr-1">上传者:<?= $problem_uploader ?: "root" ?></span>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<?= getClickZanBlock('P', $problem['id'], $problem['zan']) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card card-default mb-2">
|
||||
<div class="card-body">
|
||||
<?php endif ?>
|
||||
|
||||
<h1 class="h2 card-title text-center">
|
||||
<?php if ($contest): ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<h1 class="h2 card-title text-center">
|
||||
<?= $problem_letter ?>. <?= $problem['title'] ?>
|
||||
</h1>
|
||||
<?php else: ?>
|
||||
<div class="page-header row">
|
||||
<h1 class="col-md-3 text-left"><small><?= $contest['name'] ?></small></h1>
|
||||
<h1 class="col-md-7 text-center"><?= $problem_letter ?>. <?= $problem['title'] ?></h1>
|
||||
<div class="col-md-2 text-right" id="contest-countdown"></div>
|
||||
</div>
|
||||
<div class="btn-group float-right" role="group">
|
||||
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=attachment&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-download-alt"></span> 附件下载</a>
|
||||
<a role="button" class="btn btn-info" href="/contest/<?= $contest['id'] ?>/problem/<?= $problem['id'] ?>/statistics"><span class="glyphicon glyphicon-stats"></span> <?= UOJLocale::get('problems::statistics') ?></a>
|
||||
</div>
|
||||
<?php if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||
<script type="text/javascript">
|
||||
$('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJTime::$time_now->getTimestamp() ?>);
|
||||
</script>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<h1 class="h2 card-title text-center">
|
||||
<?php else: ?>
|
||||
<h1 class="page-header text-center">
|
||||
<?php endif ?>
|
||||
#<?= $problem['id']?>. <?= $problem['title'] ?>
|
||||
<?php endif ?>
|
||||
</h1>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="btn-group float-right" role="group">
|
||||
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=problem&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-tasks"></span> 测试数据</a>
|
||||
<a role="button" class="btn btn-primary" href="<?= HTML::url("/download.php?type=attachment&id={$problem['id']}") ?>"><span class="glyphicon glyphicon-download-alt"></span> 附件下载</a>
|
||||
<a role="button" class="btn btn-info" href="/problem/<?= $problem['id'] ?>/statistics"><span class="glyphicon glyphicon-stats"></span> <?= UOJLocale::get('problems::statistics') ?></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="text-center small">
|
||||
时间限制: <?= $time_limit != null ? "$time_limit s" : "N/A" ?>
|
||||
 
|
||||
@ -355,34 +294,12 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item"><a class="nav-link active" href="#statement" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-book"></span> <?= UOJLocale::get('problems::statement') ?></a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#submit" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-upload"></span> <?= UOJLocale::get('problems::submit') ?></a></li>
|
||||
<?php if ($custom_test_requirement): ?>
|
||||
<li class="nav-item"><a class="nav-link" href="#custom-test" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-console"></span> <?= UOJLocale::get('problems::custom test') ?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if (!$contest || $contest['cur_progress'] >= CONTEST_FINISHED): ?>
|
||||
<li class="nav-item"><a class="nav-link" href="/problem/<?= $problem['id'] ?>/solutions" role="tab"><?= UOJLocale::get('problems::solutions') ?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if (hasProblemPermission($myUser, $problem)): ?>
|
||||
<li class="nav-item"><a class="nav-link" href="/problem/<?= $problem['id'] ?>/manage/statement" role="tab"><?= UOJLocale::get('problems::manage') ?></a></li>
|
||||
<?php endif ?>
|
||||
<?php if ($contest): ?>
|
||||
<li class="nav-item"><a class="nav-link" href="/contest/<?= $contest['id'] ?>" role="tab"><?= UOJLocale::get('contests::back to the contest') ?></a></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?= HTML::url('/css/markdown.css') ?>">
|
||||
<?php endif ?>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="statement">
|
||||
<article class="mt-3 markdown-body"><?= $problem_content['statement'] ?></article>
|
||||
<article class="mt-3 markdown-body">
|
||||
<?= $problem_content['statement'] ?>
|
||||
</article>
|
||||
</div>
|
||||
<div class="tab-pane" id="submit">
|
||||
<div class="top-buffer-sm"></div>
|
||||
@ -401,13 +318,9 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<!-- End left col -->
|
||||
|
||||
@ -547,7 +460,6 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($contest && $contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||
<script type="text/javascript">
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -12,10 +13,6 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$managers_form = newAddDelCmdForm('managers',
|
||||
function($username) {
|
||||
if (!validateUsername($username) || !queryUser($username)) {
|
||||
@ -67,25 +64,15 @@
|
||||
?>
|
||||
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 管理者 - 题目管理') ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row">
|
||||
<!-- left col -->
|
||||
<div class="col-lg-9">
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<h1 class="h2">
|
||||
<?php else: ?>
|
||||
<h1 class="page-header text-center">
|
||||
<?php endif ?>
|
||||
#<?= $problem['id'] ?>. <?= $problem['title'] ?> 管理
|
||||
</h1>
|
||||
|
||||
<ul class="nav
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
nav-pills my-3
|
||||
<?php else: ?>
|
||||
nav-tabs
|
||||
<?php endif ?>" role="tablist">
|
||||
<ul class="nav nav-pills my-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/problem/<?= $problem['id'] ?>/manage/statement" role="tab">
|
||||
题面
|
||||
@ -101,25 +88,12 @@
|
||||
数据
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/problem/<?=$problem['id']?>" role="tab">
|
||||
返回
|
||||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card card-default">
|
||||
<div class="card-body">
|
||||
<?php endif ?>
|
||||
|
||||
<table class="table
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
table-hover
|
||||
<?php endif ?>">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
@ -146,12 +120,9 @@ table-hover
|
||||
<?php $update_uploader_form->printHTML(); ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<!-- end left col -->
|
||||
</div>
|
||||
|
||||
@ -192,8 +163,8 @@ table-hover
|
||||
|
||||
<?php uojIncludeView('sidebar', array()) ?>
|
||||
</aside>
|
||||
<!-- end right col -->
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('hljs');
|
||||
requireLib('mathjax');
|
||||
requirePHPLib('form');
|
||||
requirePHPLib('judger');
|
||||
|
||||
@ -161,10 +163,6 @@ EOD;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$REQUIRE_LIB['mathjax'] = '';
|
||||
$REQUIRE_LIB['hljs'] = '';
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(UOJLocale::get('problems::solutions') . ' - ' . HTML::stripTags($problem['title'])) ?>
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('calendar_heatmap');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -8,9 +10,6 @@
|
||||
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
|
||||
become403Page();
|
||||
}
|
||||
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
$REQUIRE_LIB['calendar_heatmap'] = '';
|
||||
?>
|
||||
<?php echoUOJPageHeader('关于我') ?>
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('mathjax');
|
||||
requireLib('hljs');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -9,8 +12,6 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
|
||||
$blogs_cond = "poster = '".UOJContext::userid()."'";
|
||||
if (!UOJContext::hasBlogPermission()) {
|
||||
$blogs_cond .= " and is_hidden = false";
|
||||
@ -34,9 +35,6 @@
|
||||
));
|
||||
|
||||
$all_tags = DB::selectAll("select distinct tag from blogs_tags where blog_id in (select id from blogs where $blogs_cond)");
|
||||
|
||||
requireLib('mathjax');
|
||||
requireLib('hljs');
|
||||
?>
|
||||
<?php echoUOJPageHeader('日志') ?>
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('mathjax');
|
||||
requireLib('hljs');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -27,10 +30,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$comment_form = new UOJForm('comment');
|
||||
$comment_form->addVTextArea('comment', '内容', '',
|
||||
function($comment) {
|
||||
@ -161,23 +160,11 @@
|
||||
'page_len' => 20
|
||||
));
|
||||
?>
|
||||
<?php
|
||||
$REQUIRE_LIB['mathjax'] = '';
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$REQUIRE_LIB['hljs'] = '';
|
||||
} else {
|
||||
$REQUIRE_LIB['shjs'] = '';
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(HTML::stripTags($blog['title']) . ' - 博客') ?>
|
||||
<?php echoBlog($blog, array('show_title_only' => isset($_GET['page']) && $_GET['page'] != 1)) ?>
|
||||
<h2>
|
||||
评论
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<i class="bi bi-chat-fill"></i>
|
||||
<?php else: ?>
|
||||
<span class="glyphicon glyphicon-comment"></span>
|
||||
<?php endif ?>
|
||||
</h2>
|
||||
<div class="list-group">
|
||||
<?php if ($comments_pag->isEmpty()): ?>
|
||||
@ -195,59 +182,26 @@
|
||||
$replies_json = json_encode($replies);
|
||||
?>
|
||||
<div id="comment-<?= $comment['id'] ?>" class="list-group-item">
|
||||
<div class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-flex
|
||||
<?php else: ?>
|
||||
media
|
||||
<?php endif ?>
|
||||
">
|
||||
<div class="comtposterbox mr-3
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
flex-shrink-0
|
||||
<?php else: ?>
|
||||
media-left
|
||||
<?php endif ?>">
|
||||
<a href="<?= HTML::url('/user/'.$poster['username']) ?>" class="d-none d-sm-block
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-decoration-none
|
||||
<?php endif ?>">
|
||||
<div class="d-flex">
|
||||
<div class="comtposterbox mr-3 flex-shrink-0">
|
||||
<a href="<?= HTML::url('/user/'.$poster['username']) ?>" class="d-none d-sm-block text-decoration-none">
|
||||
<img class="media-object img-rounded" src="<?= $asrc ?>" alt="avatar" />
|
||||
</a>
|
||||
</div>
|
||||
<div id="comment-body-<?= $comment['id'] ?>" class="comtbox
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
flex-grow-1 ms-3
|
||||
<?php else: ?>
|
||||
media-body
|
||||
<?php endif ?>">
|
||||
<div id="comment-body-<?= $comment['id'] ?>" class="comtbox flex-grow-1 ms-3">
|
||||
<div class="row">
|
||||
<div class="col-sm-6"><?= getUserLink($poster['username']) ?></div>
|
||||
<div class="col-sm-6
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-end
|
||||
<?php else: ?>
|
||||
text-right
|
||||
<?php endif ?>"><?= getClickZanBlock('BC', $comment['id'], $comment['zan']) ?></div>
|
||||
<div class="col-sm-6 text-end"><?= getClickZanBlock('BC', $comment['id'], $comment['zan']) ?></div>
|
||||
</div>
|
||||
<div class="comtbox1"><?= $comment['content'] ?></div>
|
||||
<ul class="list-inline bot-buffer-no
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-end
|
||||
<?php else: ?>
|
||||
text-right
|
||||
<?php endif ?>">
|
||||
<ul class="list-inline mb-0 text-end">
|
||||
<li>
|
||||
<small class="text-muted">
|
||||
<?= $comment['post_time'] ?>
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-decoration-none
|
||||
<?php endif ?>"
|
||||
id="reply-to-<?= $comment['id'] ?>" href="#">
|
||||
<a class="text-decoration-none" id="reply-to-<?= $comment['id'] ?>" href="#">
|
||||
回复
|
||||
</a>
|
||||
</li>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -9,8 +10,6 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
|
||||
if (!UOJContext::hasBlogPermission()) {
|
||||
become403Page();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
@ -18,8 +19,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
requireLib('bootstrap5');
|
||||
|
||||
$blog_editor = new UOJBlogEditor();
|
||||
$blog_editor->name = 'blog';
|
||||
if ($blog) {
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('hljs');
|
||||
requireLib('mathjax');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
redirectToLogin();
|
||||
}
|
||||
@ -7,10 +11,6 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$blogs_pag = new Paginator(array(
|
||||
'col_names' => array('*'),
|
||||
'table_name' => 'blogs',
|
||||
@ -20,24 +20,11 @@
|
||||
));
|
||||
|
||||
$all_tags = DB::selectAll("select distinct tag from blogs_tags where blog_id in (select id from blogs where $blogs_cond)");
|
||||
|
||||
$REQUIRE_LIB['mathjax'] = '';
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
requireLib('hljs');
|
||||
} else {
|
||||
$REQUIRE_LIB['shjs'] = '';
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJContext::user()['username'] . '的博客') ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
col-lg-9
|
||||
<?php else: ?>
|
||||
col-md-9
|
||||
<?php endif ?>
|
||||
">
|
||||
<div class="col-lg-9">
|
||||
<?php if ($blogs_pag->isEmpty()): ?>
|
||||
<div class="text-muted">此人很懒,什么博客也没留下。</div>
|
||||
<?php else: ?>
|
||||
@ -49,39 +36,21 @@
|
||||
<?= $blogs_pag->pagination(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
col-lg-3
|
||||
<?php else: ?>
|
||||
col-md-3
|
||||
<?php endif ?>">
|
||||
<div class="col-lg-3">
|
||||
<img class="media-object img-thumbnail center-block" alt="<?= UOJContext::user()['username'] ?> Avatar" src="<?= HTML::avatar_addr(UOJContext::user(), 512) ?>" />
|
||||
<?php if (UOJContext::hasBlogPermission()): ?>
|
||||
<div class="btn-group d-flex mt-3">
|
||||
<a href="<?= HTML::blog_url(UOJContext::userid(), '/post/new/write') ?>" class="btn btn-primary">
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<i class="bi bi-pencil-square"></i>
|
||||
<?php else: ?>
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
<?php endif ?>
|
||||
写新博客
|
||||
</a>
|
||||
<a href="<?= HTML::blog_url(UOJContext::userid(), '/slide/new/write') ?>" class="btn btn-primary">
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<i class="bi bi-file-earmark-slides"></i>
|
||||
<?php else: ?>
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
<?php endif ?>
|
||||
写新幻灯片
|
||||
</a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="card border-info
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
mt-3
|
||||
<?php else: ?>
|
||||
top-buffer-sm
|
||||
<?php endif ?>">
|
||||
<div class="card border-info mt-3">
|
||||
<div class="card-header bg-info">标签</div>
|
||||
<div class="card-body">
|
||||
<?php if ($all_tags): ?>
|
||||
|
@ -7,12 +7,11 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
requireLib('bootstrap5');
|
||||
requireLib('mathjax');
|
||||
requirePHPLib('form');
|
||||
|
||||
$username = UOJContext::userid();
|
||||
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
$REQUIRE_LIB['mathjax'] = '';
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(UOJLocale::get('contests::contest self reviews')) ?>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
requirePHPLib('form');
|
||||
requireLib('bootstrap5');
|
||||
|
||||
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
||||
redirectToLogin();
|
||||
@ -18,10 +19,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$blog_editor = new UOJBlogEditor();
|
||||
$blog_editor->type = 'slide';
|
||||
$blog_editor->name = 'blog';
|
||||
@ -78,17 +75,8 @@
|
||||
$blog_editor->runAtServer();
|
||||
?>
|
||||
<?php echoUOJPageHeader('写幻灯片') ?>
|
||||
<div class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-end
|
||||
<?php else: ?>
|
||||
text-right
|
||||
<?php endif ?>">
|
||||
<a class="
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
text-decoration-none
|
||||
<?php endif ?>
|
||||
" href="http://uoj.ac/blog/75">这玩意儿怎么用?</a>
|
||||
<div class="text-end">
|
||||
<a class="text-decoration-none" href="http://uoj.ac/blog/75">这玩意儿怎么用?</a>
|
||||
</div>
|
||||
<?php $blog_editor->printHTML() ?>
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requireLib('hljs');
|
||||
requirePHPLib('form');
|
||||
requirePHPLib('judger');
|
||||
|
||||
@ -10,10 +12,6 @@
|
||||
become404Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$submission_result = json_decode($submission['result'], true);
|
||||
|
||||
$problem = queryProblemBrief($submission['problem_id']);
|
||||
@ -139,13 +137,6 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$REQUIRE_LIB['hljs'] = '';
|
||||
} else {
|
||||
$REQUIRE_LIB['shjs'] = '';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
var problem_id = parseInt('<?= $submission['problem_id'] ?>');
|
||||
</script>
|
||||
@ -182,10 +173,6 @@
|
||||
<h4 class="card-title"><?= UOJLocale::get('details') ?></h4>
|
||||
</div>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card-body">
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoJudgementDetails($submission_result['details'], $styler, 'details') ?>
|
||||
<?php if ($should_show_details_to_me): ?>
|
||||
<?php if (isset($submission_result['final_result'])): ?>
|
||||
@ -197,32 +184,19 @@
|
||||
<?php echoSubmissionDetails($submission_result['details'], 'final_details') ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($rejudge_form)): ?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="text-end">
|
||||
<?php endif ?>
|
||||
<?php $rejudge_form->printHTML() ?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($delete_form)): ?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="text-end">
|
||||
<?php endif ?>
|
||||
<div class="top-buffer-sm">
|
||||
<?php $delete_form->printHTML() ?>
|
||||
</div>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -103,16 +103,13 @@
|
||||
<?php
|
||||
echoSubmissionsList($cond,
|
||||
'order by id desc',
|
||||
array(
|
||||
[
|
||||
'judge_time_hidden' => '',
|
||||
'table_config' => (isset($REQUIRE_LIB['bootstrap5'])
|
||||
? array(
|
||||
'div_classes' => array('card', 'mb-3', 'table-responsive'),
|
||||
'table_classes' => array('table', 'mb-0', 'uoj-table', 'text-center')
|
||||
)
|
||||
: array()
|
||||
),
|
||||
),
|
||||
'table_config' => [
|
||||
'div_classes' => ['card', 'mb-3', 'table-responsive'],
|
||||
'table_classes' => ['table', 'mb-0', 'uoj-table', 'text-center'],
|
||||
]
|
||||
],
|
||||
$myUser);
|
||||
?>
|
||||
|
||||
|
@ -263,8 +263,7 @@ EOD;
|
||||
}
|
||||
public function addCKEditor($name, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
global $REQUIRE_LIB;
|
||||
$REQUIRE_LIB['ckeditor'] = '';
|
||||
$GLOBALS['REQUIRE_LIB']['ckeditor'] = '';
|
||||
|
||||
$this->is_big = true;
|
||||
|
||||
@ -279,8 +278,7 @@ EOD;
|
||||
}
|
||||
|
||||
public function addBlogEditor(UOJBlogEditor $editor) {
|
||||
global $REQUIRE_LIB;
|
||||
$REQUIRE_LIB['blog-editor'] = '';
|
||||
$GLOBALS['REQUIRE_LIB']['blog-editor'] = '';
|
||||
|
||||
$this->is_big = true;
|
||||
|
||||
@ -325,9 +323,8 @@ EOD
|
||||
};
|
||||
}
|
||||
public function addSlideEditor($name, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$GLOBALS['REQUIRE_LIB']['slide-editor'] = '';
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
global $REQUIRE_LIB;
|
||||
$REQUIRE_LIB['slide-editor'] = '';
|
||||
|
||||
$this->is_big = true;
|
||||
|
||||
|
@ -62,9 +62,7 @@ function becomeMsgPage($msg, $title = '消息') {
|
||||
if (UOJContext::isAjax()) {
|
||||
die($msg);
|
||||
} else {
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
echoUOJPageHeader($title);
|
||||
echo $msg;
|
||||
|
@ -1,10 +1,5 @@
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card card-default table-responsive mb-3">
|
||||
<table class="table uoj-table text-center mb-0">
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-striped table-text-center">
|
||||
<?php endif ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:5em">#</th>
|
||||
@ -27,13 +22,8 @@
|
||||
</div>
|
||||
|
||||
<h3><?= UOJLocale::get('contests::contest notice') ?></h3>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="card card-default table-responsive mb-3">
|
||||
<table class="table uoj-table text-center mb-0">
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-vertical-middle table-text-center">
|
||||
<?php endif ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:10em"><?= UOJLocale::get('title') ?></th>
|
||||
|
@ -6,7 +6,6 @@ if (!isset($can_reply)) {
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="table-responsive mb-3
|
||||
<?php if (!isset($no_bs5_card)): ?>
|
||||
card card-default
|
||||
@ -15,10 +14,6 @@ if (!isset($can_reply)) {
|
||||
<?php if (!isset($no_bs5_card)): ?>
|
||||
uoj-table
|
||||
<?php endif ?>">
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-vertical-middle table-text-center">
|
||||
<?php endif ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:10em">提问者</th>
|
||||
|
Loading…
Reference in New Issue
Block a user