refactor(problems/new): uoj_form_v2

This commit is contained in:
Baoshuo Ren 2023-01-15 21:53:26 +08:00
parent 13eeb37c19
commit e218f58521
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -55,7 +55,7 @@ if (UOJProblem::userCanCreateProblem(Auth::user())) {
如有,在此处填写其他于题意或数据相关的说明。 如有,在此处填写其他于题意或数据相关的说明。
EOD; EOD;
$new_problem_form = new UOJBs4Form('new_problem'); $new_problem_form = new UOJForm('new_problem');
$new_problem_form->handle = function () use ($default_statement) { $new_problem_form->handle = function () use ($default_statement) {
DB::insert([ DB::insert([
"insert into problems", "insert into problems",
@ -77,11 +77,10 @@ EOD;
redirectTo("/problem/{$id}/manage/statement"); redirectTo("/problem/{$id}/manage/statement");
die(); die();
}; };
$new_problem_form->submit_button_config['align'] = 'right'; $new_problem_form->config['submit_container']['class'] = 'text-end';
$new_problem_form->submit_button_config['class_str'] = 'btn btn-primary'; $new_problem_form->config['submit_button']['class'] = 'btn btn-primary';
$new_problem_form->submit_button_config['text'] = UOJLocale::get('problems::add new'); $new_problem_form->config['submit_button']['text'] = UOJLocale::get('problems::add new');
$new_problem_form->submit_button_config['smart_confirm'] = ''; $new_problem_form->config['confirm']['smart'] = true;
$new_problem_form->runAtServer(); $new_problem_form->runAtServer();
} }