refactor(problem/solutions): add_solution_form layout

This commit is contained in:
Baoshuo Ren 2023-02-02 11:39:22 +08:00
parent fe5e9b17e5
commit 8bc961fb3c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -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'))) {
$add_new_solution_form = new UOJForm('add_new_solution');
$add_new_solution_form->addInput(
'blog_id_2',
[
$add_new_solution_form->addInput('blog_id_2', [
'div_class' => 'flex-grow-1',
'placeholder' => '博客 ID',
'validator_php' => function ($blog_id, &$vdata) {
$blog = UOJBlog::query($blog_id);
@ -89,10 +88,10 @@ if (UOJProblem::cur()->userCanManage(Auth::user()) || UOJProblem::cur()->userPer
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']['class'] = 'btn btn-secondary';
$add_new_solution_form->handle = function (&$vdata) {
DB::insert([
"insert into problems_solutions",