From 2367452bcda7372105eec06bba0f1453f0ea2517 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 24 Sep 2022 08:26:39 +0800 Subject: [PATCH] feat: frontend version switch --- web/app/controllers/index.php | 4 ++- web/app/controllers/submissions_list.php | 5 +++- web/app/libs/uoj-html-lib.php | 4 ++- web/app/views/main-nav.php | 36 ++++++++++++++++++++---- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/web/app/controllers/index.php b/web/app/controllers/index.php index 40c3918..eb1ab1e 100644 --- a/web/app/controllers/index.php +++ b/web/app/controllers/index.php @@ -3,7 +3,9 @@ $countdowns = DB::selectAll("select * from countdowns order by endtime asc"); $friend_links = DB::selectAll("select * from friend_links order by level desc, id asc"); - $REQUIRE_LIB['bootstrap5'] = ''; + if (!isset($_COOKIE['bootstrap4'])){ + $REQUIRE_LIB['bootstrap5'] = ''; + } ?>
diff --git a/web/app/controllers/submissions_list.php b/web/app/controllers/submissions_list.php index 974ef1a..d99fbe7 100644 --- a/web/app/controllers/submissions_list.php +++ b/web/app/controllers/submissions_list.php @@ -38,7 +38,10 @@ $cond = '1'; } - $REQUIRE_LIB['bootstrap5'] = ''; + + if (!isset($_COOKIE['bootstrap4'])){ + $REQUIRE_LIB['bootstrap5'] = ''; + } ?>
diff --git a/web/app/libs/uoj-html-lib.php b/web/app/libs/uoj-html-lib.php index 0a1b592..8b76315 100644 --- a/web/app/libs/uoj-html-lib.php +++ b/web/app/libs/uoj-html-lib.php @@ -63,7 +63,9 @@ function becomeMsgPage($msg, $title = '消息') { if (UOJContext::isAjax()) { die($msg); } else { - $REQUIRE_LIB['bootstrap5'] = ''; + if (!isset($_COOKIE['bootstrap4'])){ + $REQUIRE_LIB['bootstrap5'] = ''; + } echoUOJPageHeader($title); echo $msg; diff --git a/web/app/views/main-nav.php b/web/app/views/main-nav.php index b49bbb4..a99b576 100644 --- a/web/app/views/main-nav.php +++ b/web/app/views/main-nav.php @@ -36,7 +36,7 @@ mb-4" role="navigation"> + + +