refactor(web/contest/backstage): use card
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-18 18:42:57 +08:00
parent 8d6c000c09
commit ea4cfd8376
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 33 additions and 27 deletions

View File

@ -197,7 +197,7 @@ EOD;
} elseif ($cur_tab == 'backstage') {
if (isSuperUser(Auth::user())) {
$post_notice = new UOJForm('post_notice');
$post_notice->addInput('title', 'text', '标题', '',
$post_notice->addVInput('title', 'text', '标题', '',
function($title) {
if (!$title) {
return '标题不能为空';
@ -206,7 +206,7 @@ EOD;
},
null
);
$post_notice->addTextArea('content', '正文', '',
$post_notice->addVTextArea('content', '正文', '',
function($content) {
if (!$content) {
return '公告不能为空';

View File

@ -1,28 +1,29 @@
<ul class="nav nav-pills float-right" role="tablist">
<li class="nav-item"><a class="nav-link active" href="#tab-question" role="tab" data-bs-toggle="tab" data-bs-target="#tab-question">提问</a></li>
<?php if ($post_notice): ?>
<li class="nav-item"><a class="nav-link" href="#tab-notice" role="tab" data-bs-toggle="tab" data-bs-target="#tab-notice">公告</a></li>
<?php endif ?>
<?php if ($standings_data): ?>
<li class="nav-item"><a class="nav-link" href="#tab-standings" role="tab" data-bs-toggle="tab" data-bs-target="#tab-standings">终榜</a></li>
<?php endif ?>
</ul>
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs" role="tablist">
<li class="nav-item"><a class="nav-link active" href="#tab-question" role="tab" data-bs-toggle="tab" data-bs-target="#tab-question">提问</a></li>
<?php if ($post_notice): ?>
<li class="nav-item"><a class="nav-link" href="#tab-notice" role="tab" data-bs-toggle="tab" data-bs-target="#tab-notice">公告</a></li>
<?php endif ?>
<?php if ($standings_data): ?>
<li class="nav-item"><a class="nav-link" href="#tab-standings" role="tab" data-bs-toggle="tab" data-bs-target="#tab-standings">终榜</a></li>
<?php endif ?>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="tab-question">
<h3>提问</h3>
<?php uojIncludeView('contest-question-table', ['pag' => $questions_pag, 'can_reply' => true, 'reply_question' => $reply_question]) ?>
<div class="tab-pane card-body active" id="tab-question">
<?php uojIncludeView('contest-question-table', ['pag' => $questions_pag, 'can_reply' => true, 'reply_question' => $reply_question, 'no_bs5_card' => '']) ?>
</div>
<?php if ($post_notice): ?>
<div class="tab-pane" id="tab-notice">
<h3>发布比赛公告</h3>
<div class="tab-pane card-body" id="tab-notice">
<h4>发布比赛公告</h4>
<?php $post_notice->printHTML() ?>
</div>
<?php endif ?>
<?php if ($standings_data): ?>
<div class="tab-pane" id="tab-standings">
<h3>终榜</h3>
<?php uojIncludeView('contest-standings', $standings_data) ?>
<div class="tab-pane card-body" id="tab-standings">
<?php uojIncludeView('contest-standings', array_merge($standings_data, ['no_bs5_card' => ''])) ?>
</div>
<?php endif ?>
</div>
</div>

View File

@ -7,8 +7,14 @@ if (!isset($can_reply)) {
?>
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card card-default table-responsive mb-3">
<table class="table uoj-table text-center mb-0">
<div class="table-responsive mb-3
<?php if (!isset($no_bs5_card)): ?>
card card-default
<?php endif ?>">
<table class="table text-center mb-0
<?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">

View File

@ -1,8 +1,7 @@
<div class="card card-default" id="standings"></div>
<div class="table-responsive">
<table id="standings-table" class="table table-bordered table-striped table-text-center table-vertical-middle"></table>
</div>
<div id="standings" class="
<?php if (!isset($no_bs5_card)): ?>
card card-default
<?php endif ?>"></div>
<script type="text/javascript">
standings_version=<?=$contest['extra_config']['standings_version']?>;