mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 21:28:41 +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 {
|
} else {
|
||||||
insertBlog($data);
|
insertBlog($data);
|
||||||
$blog = array('id' => DB::insert_id(), 'tags' => array());
|
$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_write_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}/write");
|
||||||
$ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}");
|
$ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}");
|
||||||
}
|
}
|
||||||
@ -77,6 +78,18 @@
|
|||||||
<?php echoUOJPageHeader('写博客') ?>
|
<?php echoUOJPageHeader('写博客') ?>
|
||||||
|
|
||||||
<div class="card">
|
<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">
|
<div class="card-body">
|
||||||
<?php $blog_editor->printHTML() ?>
|
<?php $blog_editor->printHTML() ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -212,6 +212,9 @@ function blog_editor_init(name, editor_config) {
|
|||||||
if (data.blog_url) {
|
if (data.blog_url) {
|
||||||
$('#a-' + name + '_view_blog').attr('href', data.blog_url).show();
|
$('#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() {
|
}).fail(function() {
|
||||||
if (config.need_preview) {
|
if (config.need_preview) {
|
||||||
|
Loading…
Reference in New Issue
Block a user