mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 14:08:42 +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'))) {
|
||||
$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",
|
||||
|
Loading…
Reference in New Issue
Block a user