fix(web/blog/slide): replace state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-08 17:16:00 +08:00
parent b6cb61d046
commit bbcd51e7c6
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -18,6 +18,10 @@
} }
} }
if (!isset($_COOKIE['bootstrap4'])) {
$REQUIRE_LIB['bootstrap5'] = '';
}
$blog_editor = new UOJBlogEditor(); $blog_editor = new UOJBlogEditor();
$blog_editor->type = 'slide'; $blog_editor->type = 'slide';
$blog_editor->name = 'blog'; $blog_editor->name = 'blog';
@ -59,6 +63,8 @@
} else { } else {
insertSlide($data); insertSlide($data);
$blog = array('id' => DB::insert_id(), 'tags' => array()); $blog = array('id' => DB::insert_id(), 'tags' => array());
$ret['blog_write_url'] = HTML::blog_url(UOJContext::user()['username'], "/slide/{$blog['id']}/write");
$ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/slide/{$blog['id']}");
} }
if ($data['tags'] !== $blog['tags']) { if ($data['tags'] !== $blog['tags']) {
DB::delete("delete from blogs_tags where blog_id = {$blog['id']}"); DB::delete("delete from blogs_tags where blog_id = {$blog['id']}");
@ -72,8 +78,17 @@
$blog_editor->runAtServer(); $blog_editor->runAtServer();
?> ?>
<?php echoUOJPageHeader('写幻灯片') ?> <?php echoUOJPageHeader('写幻灯片') ?>
<div class="text-right"> <div class="
<a href="http://uoj.ac/blog/75">这玩意儿怎么用?</a> <?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> </div>
<?php $blog_editor->printHTML() ?> <?php $blog_editor->printHTML() ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>