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

View File

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

View File

@ -7,8 +7,14 @@ if (!isset($can_reply)) {
?> ?>
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card card-default table-responsive mb-3"> <div class="table-responsive mb-3
<table class="table uoj-table text-center mb-0"> <?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: ?> <?php else: ?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-hover table-vertical-middle table-text-center"> <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 id="standings" class="
<?php if (!isset($no_bs5_card)): ?>
<div class="table-responsive"> card card-default
<table id="standings-table" class="table table-bordered table-striped table-text-center table-vertical-middle"></table> <?php endif ?>"></div>
</div>
<script type="text/javascript"> <script type="text/javascript">
standings_version=<?=$contest['extra_config']['standings_version']?>; standings_version=<?=$contest['extra_config']['standings_version']?>;