mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-23 03:51:52 +00:00
feat(web/blog/write): display blog id
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
14094a4d44
commit
ef7c6eb83d
@ -60,6 +60,7 @@
|
||||
} else {
|
||||
insertBlog($data);
|
||||
$blog = array('id' => DB::insert_id(), 'tags' => array());
|
||||
$ret['blog_id'] = $blog['id'];
|
||||
$ret['blog_write_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}/write");
|
||||
$ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}");
|
||||
}
|
||||
@ -77,6 +78,18 @@
|
||||
<?php echoUOJPageHeader('写博客') ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-transparent d-flex justify-content-between">
|
||||
<div class="fw-bold">写博客</div>
|
||||
<div id="div-blog-id"
|
||||
<?php if (!$blog): ?>
|
||||
style="display: none"
|
||||
<?php endif ?>
|
||||
>
|
||||
<?php if ($blog): ?>
|
||||
<small>博客 ID:<b><?= $blog['id'] ?></b></small>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $blog_editor->printHTML() ?>
|
||||
</div>
|
||||
|
@ -212,6 +212,9 @@ function blog_editor_init(name, editor_config) {
|
||||
if (data.blog_url) {
|
||||
$('#a-' + name + '_view_blog').attr('href', data.blog_url).show();
|
||||
}
|
||||
if (data.blog_id) {
|
||||
$('#div-blog-id').html('<small>博客 ID:<b>' + data.blog_id + '</b></small>').show();
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
if (config.need_preview) {
|
||||
|
Loading…
Reference in New Issue
Block a user