-
diff --git a/web/app/controllers/contest_inside.php b/web/app/controllers/contest_inside.php
index c4fa823..a66ea91 100644
--- a/web/app/controllers/contest_inside.php
+++ b/web/app/controllers/contest_inside.php
@@ -1,9 +1,8 @@
$post_question,
'my_questions_pag' => $my_questions_pag,
'others_questions_pag' => $others_questions_pag,
- 'REQUIRE_LIB' => $REQUIRE_LIB,
]);
}
diff --git a/web/app/controllers/contest_members.php b/web/app/controllers/contest_members.php
index 031a910..e8d4e09 100644
--- a/web/app/controllers/contest_members.php
+++ b/web/app/controllers/contest_members.php
@@ -1,4 +1,5 @@
-
-
-
+
-
+
';
- $config = array('page_len' => 100,
- 'get_row_index' => '',
- 'print_after_table' => function() {
- global $add_new_contestant_form,
- $add_group_to_contest_form,
- $remove_user_from_contest_form,
- $force_set_user_participated_form;
-
- if (isset($add_new_contestant_form)) {
- $add_new_contestant_form->printHTML();
- }
- if (isset($add_group_to_contest_form)) {
- $add_group_to_contest_form->printHTML();
- }
- if (isset($remove_user_from_contest_form)) {
- $remove_user_from_contest_form->printHTML();
- }
- if (isset($force_set_user_participated_form)) {
- $force_set_user_participated_form->printHTML();
- }
- }
- );
-
- if (isset($REQUIRE_LIB['bootstrap5'])) {
- $config['div_classes'] = array('card', 'mb-3');
- $config['table_classes'] = array('table', 'uoj-table', 'mb-0', 'text-center');
- }
-
- echoLongTable(array('*'), 'contests_registrants', "contest_id = {$contest['id']}", 'order by username desc',
+ echoLongTable(
+ ['*'],
+ 'contests_registrants',
+ "contest_id = {$contest['id']}",
+ 'order by username desc',
$header_row,
- function($contest, $num) {
- global $myUser;
- global $has_contest_permission, $show_ip, $ip_owner, $has_participated;
-
- $user = queryUser($contest['username']);
- $user_link = getUserLink($contest['username']);
+ function($contestant, $num) use ($myUser, $has_contest_permission, $show_ip, $ip_owner, $has_participated) {
+ $user = queryUser($contestant['username']);
+
if (!$show_ip) {
echo '
';
} else {
if ($ip_owner[$user['remote_addr']] != $user['username'] || $forwarded_ip_owner[$user['http_x_forwarded_for']] != $user['username']) {
- echo '
';
+ echo '
';
} else {
echo '
';
}
}
echo ''.$num.' | ';
- echo ''.$user_link.' | ';
+ echo ''.getUserLink($contestant['username']).' | ';
if ($show_ip) {
echo ''.$user['remote_addr'].' | ';
echo ''.$user['http_x_forwarded_for'].' | ';
}
if ($has_contest_permission) {
- echo ''.($has_participated[$user['username']] ? 'Yes' : 'No').' | ';
+ echo ''.($contestant['has_participated'] ? 'Yes' : 'No').' | ';
}
echo '
';
},
- $config
+ [
+ 'page_len' => 50,
+ 'get_row_index' => '',
+ 'div_classes' => ['table-responsive', 'card', 'mb-3'],
+ 'table_classes' => ['table', 'uoj-table', 'mb-0', 'text-center'],
+ ]
);
?>
+
+printHTML();
+ }
+ if (isset($add_group_to_contest_form)) {
+ $add_group_to_contest_form->printHTML();
+ }
+ if (isset($remove_user_from_contest_form)) {
+ $remove_user_from_contest_form->printHTML();
+ }
+ if (isset($force_set_user_participated_form)) {
+ $force_set_user_participated_form->printHTML();
+ }
+ ?>
diff --git a/web/app/controllers/contests.php b/web/app/controllers/contests.php
index 94397d3..cd80ef5 100644
--- a/web/app/controllers/contests.php
+++ b/web/app/controllers/contests.php
@@ -1,28 +1,19 @@
{$contest['name']}
+
{$contest['name']}
EOD;
genMoreContestInfo($contest);
if ($contest['cur_progress'] == CONTEST_NOT_STARTED) {
@@ -33,18 +24,18 @@ EOD;
$rest_second = $cur_rest_second;
}
if ($myUser != null && hasRegistered($myUser, $contest)) {
- $contest_name_link .= '
'.UOJLocale::get('contests::registered').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::registered').'';
} else {
- $contest_name_link .= '
'.UOJLocale::get('contests::register').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::register').'';
}
} elseif ($contest['cur_progress'] == CONTEST_IN_PROGRESS) {
- $contest_name_link .= '
'.UOJLocale::get('contests::in progress').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::in progress').'';
} elseif ($contest['cur_progress'] == CONTEST_PENDING_FINAL_TEST) {
- $contest_name_link .= '
'.UOJLocale::get('contests::pending final test').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::pending final test').'';
} elseif ($contest['cur_progress'] == CONTEST_TESTING) {
- $contest_name_link .= '
'.UOJLocale::get('contests::final testing').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::final testing').'';
} elseif ($contest['cur_progress'] == CONTEST_FINISHED) {
- $contest_name_link .= '
'.UOJLocale::get('contests::ended').'';
+ $contest_name_link .= '
'.UOJLocale::get('contests::ended').'';
}
$last_hour = round($contest['last_min'] / 60, 2);
@@ -52,44 +43,33 @@ EOD;
$click_zan_block = getClickZanBlock('C', $contest['id'], $contest['zan']);
echo '
';
echo '', $contest_name_link, ' | ';
- echo '', ' $contest['last_min'])).'">'.$contest['start_time_str'].'', ' | ';
+ echo '', ''.$contest['start_time_str'].'', ' | ';
echo '', UOJLocale::get('hours', $last_hour), ' | ';
- echo '', '';
-
- if (isset($REQUIRE_LIB['bootstrap5'])) {
- echo '';
- } else {
- echo '';
- }
-
- echo ' ×'.$contest['player_num'].'', ' | ';
+ echo '', '', '', ' ×'.$contest['player_num'].'', ' | ';
echo '', ' '.$click_zan_block.' ', ' | ';
echo '
';
}
?>
-
+
+
-
= UOJLocale::get('contests') ?>
-';
- } else {
- echo '
';
-}
- ?>
-
+
+
-
= UOJLocale::get('contests::current or upcoming contests') ?>
+
+
+
+
+
+ = UOJLocale::get('contests::current or upcoming contests') ?>
+
';
@@ -100,12 +80,18 @@ if (isSuperUser($myUser)) {
$table_header .= '
'.UOJLocale::get('appraisal').' | ';
$table_header .= '';
- $table_config = array('page_len' => 40);
- if (isset($REQUIRE_LIB['bootstrap5'])) {
- $table_config['div_classes'] = array('card', 'mb-3');
- $table_config['table_classes'] = array('table', 'uoj-table', 'mb-0', 'text-center');
- }
- echoLongTable(array('*'), 'contests', "status != 'finished'", 'order by start_time asc, id asc', $table_header,
+ $table_config = [
+ 'page_len' => 40,
+ 'div_classes' => ['card', 'mb-3'],
+ 'table_classes' => ['table', 'uoj-table', 'mb-0', 'text-center'],
+ ];
+
+ echoLongTable(
+ ['*'],
+ 'contests',
+ "status != 'finished'",
+ 'order by start_time asc, id asc',
+ $table_header,
echoContest,
$table_config
);
@@ -128,9 +114,16 @@ EOD;
}
?>
-
= UOJLocale::get('contests::ended contests') ?>
+
+ = UOJLocale::get('contests::ended contests') ?>
+
-
-
- = UOJLocale::get('announcements') ?>
-
-
+
+ = UOJLocale::get('announcements') ?>
+
-
-
-
+
-
-
-
+
= UOJLocale::get('top solver') ?>
-
-
= UOJLocale::get('top solver') ?>
-
- true,
'top10' => true,
'by_accepted' => true,
- 'table_classes' => isset($REQUIRE_LIB['bootstrap5'])
- ? array('table', 'text-center')
- : array('table', 'table-bordered', 'table-hover', 'table-striped', 'table-text-center'),
- )) ?>
+ 'table_classes' => ['table', 'text-center'],
+ ]) ?>
-
-
@@ -115,23 +85,11 @@
-
-
-
-
- = UOJLocale::get('countdowns') ?>
-
-
-
+
-
- '', 'groups_hidden' => '']) ?>
-
+ '', 'groups_hidden' => '']) ?>
-
-
-
+
-
-
- = UOJLocale::get('friend links') ?>
-
-
-
+
diff --git a/web/app/controllers/login.php b/web/app/controllers/login.php
index da3e244..24cf370 100644
--- a/web/app/controllers/login.php
+++ b/web/app/controllers/login.php
@@ -1,6 +1,9 @@
-