mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2025-03-26 05:37:02 +00:00
Compare commits
3 Commits
42591677e5
...
27387a0dea
Author | SHA1 | Date | |
---|---|---|---|
27387a0dea | |||
b779362412 | |||
42ffbd9c88 |
@ -8,11 +8,17 @@
|
||||
if (!isNormalUser($myUser)) {
|
||||
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>';
|
||||
echo '<td><span class="text-danger">[已隐藏]</span> ' . getBlogLink($blog['id']) . '</td>';
|
||||
} else {
|
||||
echo '<td>' . getBlogLink($blog['id']) . '</td>';
|
||||
}
|
||||
@ -29,8 +35,21 @@
|
||||
EOD;
|
||||
$config = array();
|
||||
$config['table_classes'] = array('table', 'table-hover');
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$config['div_classes'] = array('card', 'my-3');
|
||||
$config['table_classes'] = array('table', 'uoj-table', 'mb-0');
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('blogs')) ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-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">
|
||||
@ -39,6 +58,41 @@ EOD;
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?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">
|
||||
我的博客首页
|
||||
</a>
|
||||
<a href="<?= HTML::blog_url(Auth::id(), '/post/new/write')?>" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-pencil"></i>
|
||||
写新博客
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<h3>博客总览</h3>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?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 if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
</div>
|
||||
|
||||
<aside class="col mt-3 mt-md-0">
|
||||
<?php uojIncludeView('sidebar', array()) ?>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -7,6 +7,10 @@
|
||||
become403Page();
|
||||
}
|
||||
|
||||
if (!isset($_COOKIE['bootstrap4'])) {
|
||||
$REQUIRE_LIB['bootstrap5'] = '';
|
||||
}
|
||||
|
||||
$conds = array();
|
||||
|
||||
$q_problem_id = isset($_GET['problem_id']) && validateUInt($_GET['problem_id']) ? $_GET['problem_id'] : null;
|
||||
@ -50,31 +54,59 @@
|
||||
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('hacks')) ?>
|
||||
|
||||
<h1 class="h2">
|
||||
<?= UOJLocale::get('hacks') ?>
|
||||
</h1>
|
||||
|
||||
<div class="d-none d-sm-block">
|
||||
<?php if ($myUser != null): ?>
|
||||
<div class="float-right">
|
||||
<a href="/hacks?hacker=<?= $myUser['username'] ?>" class="btn btn-success btn-sm"><?= UOJLocale::get('problems::hacks by me') ?></a>
|
||||
<a href="/hacks?owner=<?= $myUser['username'] ?>" class="btn btn-danger btn-sm"><?= UOJLocale::get('problems::hacks to me') ?></a>
|
||||
<?php if (Auth::check()): ?>
|
||||
<div class="float-right
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
btn-group
|
||||
<?php endif ?>">
|
||||
<a href="/hacks?hacker=<?= Auth::id() ?>" class="btn btn-success btn-sm"><?= UOJLocale::get('problems::hacks by me') ?></a>
|
||||
<a href="/hacks?owner=<?= Auth::id() ?>" class="btn btn-danger btn-sm"><?= UOJLocale::get('problems::hacks to me') ?></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<form id="form-search" class="form-inline" role="form">
|
||||
<div id="form-group-submission_id" class="form-group">
|
||||
<div id="form-group-submission_id" class="form-group
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-inline-block
|
||||
<?php endif ?>
|
||||
">
|
||||
<label for="input-submission_id" class="control-label"><?= UOJLocale::get('problems::submission id') ?>:</label>
|
||||
<input type="text" class="form-control input-sm" name="submission_id" id="input-submission_id" value="<?= $q_submission_id ?>" maxlength="6" style="width:5em" />
|
||||
</div>
|
||||
<div id="form-group-problem_id" class="form-group">
|
||||
<div id="form-group-problem_id" class="form-group
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-inline-block
|
||||
<?php endif ?>
|
||||
">
|
||||
<label for="input-problem_id" class="control-label"><?= UOJLocale::get('problems::problem id') ?>:</label>
|
||||
<input type="text" class="form-control input-sm" name="problem_id" id="input-problem_id" value="<?= $q_problem_id ?>" maxlength="4" style="width:4em" />
|
||||
</div>
|
||||
<div id="form-group-hacker" class="form-group">
|
||||
<div id="form-group-hacker" class="form-group
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-inline-block
|
||||
<?php endif ?>
|
||||
">
|
||||
<label for="input-hacker" class="control-label"><?= UOJLocale::get('problems::hacker') ?>:</label>
|
||||
<input type="text" class="form-control input-sm" name="hacker" id="input-hacker" value="<?= $q_hacker ?>" maxlength="100" style="width:10em" />
|
||||
</div>
|
||||
<div id="form-group-owner" class="form-group">
|
||||
<div id="form-group-owner" class="form-group
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-inline-block
|
||||
<?php endif ?>
|
||||
">
|
||||
<label for="input-owner" class="control-label"><?= UOJLocale::get('problems::owner') ?>:</label>
|
||||
<input type="text" class="form-control input-sm" name="owner" id="input-owner" value="<?= $q_owner ?>" maxlength="100" style="width:10em" />
|
||||
</div>
|
||||
<div id="form-group-status" class="form-group">
|
||||
<div id="form-group-status" class="form-group
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
d-inline-block
|
||||
<?php endif ?>
|
||||
">
|
||||
<label for="input-status" class="control-label"><?= UOJLocale::get('problems::result') ?>:</label>
|
||||
<select class="form-control input-sm" id="input-status" name="status">
|
||||
<option value=""<?= $selected_all?>>All</option>
|
||||
@ -101,9 +133,28 @@
|
||||
location.href = url;
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<div class="mt-3"></div>
|
||||
<?php else: ?>
|
||||
<div class="top-buffer-sm"></div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
echoHacksList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser);
|
||||
|
||||
<?php echoHacksList($cond,
|
||||
'order by id desc',
|
||||
array(
|
||||
'judge_time_hidden' => '',
|
||||
'table_config' => (isset($REQUIRE_LIB['bootstrap5'])
|
||||
? array(
|
||||
'div_classes' => array('card', 'mb-3', 'overflow-auto'),
|
||||
'table_classes' => array('table', 'mb-0', 'uoj-table', 'text-center')
|
||||
)
|
||||
: array()
|
||||
),
|
||||
),
|
||||
$myUser);
|
||||
?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -145,9 +145,18 @@ function getContestProblemLink($problem, $contest_id, $problem_title = '!title_o
|
||||
return $result;
|
||||
}
|
||||
function getBlogLink($id) {
|
||||
global $REQUIRE_LIB;
|
||||
|
||||
$result = '';
|
||||
if (validateUInt($id) && $blog = queryBlog($id)) {
|
||||
return '<a href="/blogs/'.$id.'">'.$blog['title'].'</a>';
|
||||
$result = '<a ';
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
$result .= ' class="text-decoration-none" ';
|
||||
}
|
||||
$result .= ' href="/blogs/'.$id.'">'.$blog['title'].'</a>';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
function getClickZanBlock($type, $id, $cnt, $val = null) {
|
||||
if ($val == null) {
|
||||
@ -1063,6 +1072,8 @@ function echoHackDetails($hack_details, $name) {
|
||||
}
|
||||
|
||||
function echoHack($hack, $config, $user) {
|
||||
global $REQUIRE_LIB;
|
||||
|
||||
$problem = queryProblemBrief($hack['problem_id']);
|
||||
echo '<tr>';
|
||||
if (!isset($config['id_hidden'])) {
|
||||
@ -1237,10 +1248,12 @@ function echoHacksList($cond, $tail, $config, $user) {
|
||||
}
|
||||
}
|
||||
|
||||
$table_config = isset($config['table_config']) ? $config['table_config'] : null;
|
||||
|
||||
echoLongTable($col_names, 'hacks', $cond, $tail, $header_row,
|
||||
function($hacks) use ($config, $user) {
|
||||
echoHack($hacks, $config, $user);
|
||||
}, null);
|
||||
}, $table_config);
|
||||
}
|
||||
|
||||
function echoBlog($blog, $config = array()) {
|
||||
|
@ -18,6 +18,7 @@ return [
|
||||
'submissions' => 'Submissions',
|
||||
'hacks' => 'Hack!',
|
||||
'blogs' => 'Blogs',
|
||||
'blogs overview' => 'Blogs Overview',
|
||||
'announcements' => 'Announcements',
|
||||
'all the announcements' => 'All the Announcements……',
|
||||
'solved' => 'Solved',
|
||||
|
@ -18,6 +18,7 @@ return [
|
||||
'submissions' => '提交记录',
|
||||
'hacks' => 'Hack!',
|
||||
'blogs' => '博客',
|
||||
'blogs overview' => '博客总览',
|
||||
'announcements' => '公告',
|
||||
'all the announcements' => '所有公告……',
|
||||
'solved' => 'AC 数',
|
||||
|
@ -93,22 +93,22 @@ label {
|
||||
}
|
||||
|
||||
.card-uoj-accepted > .card-header:hover,
|
||||
.card-uoj-accepted > div > .uoj-status-text {
|
||||
.card-uoj-accepted > div.card-header > div > .uoj-status-text {
|
||||
color: #25ad40;
|
||||
}
|
||||
|
||||
.card-uoj-acceptable-answer > .card-header:hover,
|
||||
.card-uoj-acceptable-answer > div > .uoj-status-text {
|
||||
.card-uoj-acceptable-answer > div.card-header > div > .uoj-status-text {
|
||||
color: #01bab2;
|
||||
}
|
||||
|
||||
.card-uoj-tle > .card-header:hover,
|
||||
.card-uoj-tle > div > .uoj-status-text {
|
||||
.card-uoj-tle > div.card-header > div > .uoj-status-text {
|
||||
color: sandybrown;
|
||||
}
|
||||
|
||||
.card-uoj-wrong > .card-header:hover,
|
||||
.card-uoj-wrong > div > .uoj-status-text {
|
||||
.card-uoj-wrong > div.card-header > div > .uoj-status-text {
|
||||
color: #ff4f4f;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user