mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2025-02-16 23:46:41 +00:00
refactor(problem/solutions): add_solution_form layout
This commit is contained in:
parent
fe5e9b17e5
commit
8bc961fb3c
@ -54,9 +54,8 @@ if (UOJRequest::post('submit-remove_solution') === 'remove_solution') {
|
|||||||
|
|
||||||
if (UOJProblem::cur()->userCanManage(Auth::user()) || UOJProblem::cur()->userPermissionCodeCheck(Auth::user(), UOJProblem::cur()->getExtraConfig('submit_solution_type'))) {
|
if (UOJProblem::cur()->userCanManage(Auth::user()) || UOJProblem::cur()->userPermissionCodeCheck(Auth::user(), UOJProblem::cur()->getExtraConfig('submit_solution_type'))) {
|
||||||
$add_new_solution_form = new UOJForm('add_new_solution');
|
$add_new_solution_form = new UOJForm('add_new_solution');
|
||||||
$add_new_solution_form->addInput(
|
$add_new_solution_form->addInput('blog_id_2', [
|
||||||
'blog_id_2',
|
'div_class' => 'flex-grow-1',
|
||||||
[
|
|
||||||
'placeholder' => '博客 ID',
|
'placeholder' => '博客 ID',
|
||||||
'validator_php' => function ($blog_id, &$vdata) {
|
'validator_php' => function ($blog_id, &$vdata) {
|
||||||
$blog = UOJBlog::query($blog_id);
|
$blog = UOJBlog::query($blog_id);
|
||||||
@ -89,10 +88,10 @@ if (UOJProblem::cur()->userCanManage(Auth::user()) || UOJProblem::cur()->userPer
|
|||||||
|
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
]
|
]);
|
||||||
);
|
$add_new_solution_form->config['form']['class'] = 'd-flex';
|
||||||
|
$add_new_solution_form->config['submit_container']['class'] = 'ms-2';
|
||||||
$add_new_solution_form->config['submit_button']['text'] = '发布';
|
$add_new_solution_form->config['submit_button']['text'] = '发布';
|
||||||
$add_new_solution_form->config['submit_button']['class'] = 'btn btn-secondary';
|
|
||||||
$add_new_solution_form->handle = function (&$vdata) {
|
$add_new_solution_form->handle = function (&$vdata) {
|
||||||
DB::insert([
|
DB::insert([
|
||||||
"insert into problems_solutions",
|
"insert into problems_solutions",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user