From 3b1def57541dbfed7c27a77a3c239fa8d9b8ac67 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 15 Jan 2023 08:04:25 +0800 Subject: [PATCH] refactor(contest): start_test_form & publish_result_form --- web/app/controllers/contest_inside.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/web/app/controllers/contest_inside.php b/web/app/controllers/contest_inside.php index 3b47fe4..e40edc0 100644 --- a/web/app/controllers/contest_inside.php +++ b/web/app/controllers/contest_inside.php @@ -55,24 +55,25 @@ isset($tabs_info[$cur_tab]) || UOJResponse::page404(); if (UOJContest::cur()->userCanStartFinalTest(Auth::user())) { if (CONTEST_PENDING_FINAL_TEST <= $contest['cur_progress']) { - $start_test_form = new UOJBs4Form('start_test'); + $start_test_form = new UOJForm('start_test'); $start_test_form->handle = function () { UOJContest::finalTest(); }; - $start_test_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100'; - $start_test_form->submit_button_config['smart_confirm'] = ''; - $start_test_form->submit_button_config['text'] = UOJContest::cur()->labelForFinalTest(); + $start_test_form->config['submit_container']['class'] = 'mt-2'; + $start_test_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100'; + $start_test_form->config['submit_button']['text'] = UOJContest::cur()->labelForFinalTest(); + $start_test_form->config['confirm']['smart'] = true; $start_test_form->runAtServer(); } if ($contest['cur_progress'] >= CONTEST_TESTING) { - $publish_result_form = new UOJBs4Form('publish_result'); + $publish_result_form = new UOJForm('publish_result'); $publish_result_form->handle = function () { UOJContest::announceOfficialResults(); }; - $publish_result_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100'; - $publish_result_form->submit_button_config['smart_confirm'] = ''; - $publish_result_form->submit_button_config['text'] = '公布成绩'; - + $publish_result_form->config['submit_container']['class'] = 'mt-2'; + $publish_result_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100'; + $publish_result_form->config['submit_button']['text'] = '公布成绩'; + $publish_result_form->config['confirm']['smart'] = true; $publish_result_form->runAtServer(); } }