From 848607a87d6e63a65ecc60259daba780b90131b9 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 5 Dec 2022 12:05:33 +0800 Subject: [PATCH] feat(web/list): problem difficulty --- web/app/controllers/list.php | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/web/app/controllers/list.php b/web/app/controllers/list.php index 16feceb..5728a43 100644 --- a/web/app/controllers/list.php +++ b/web/app/controllers/list.php @@ -54,9 +54,7 @@ function getProblemTR($info) { ) ); } - if (isset($_COOKIE['show_difficulty'])) { - $html .= HTML::tag('td', [], $problem->getExtraConfig('difficulty')); - } + $html .= HTML::tag('td', [], UOJProblem::getDifficultyHTML($problem->info['difficulty'])); $html .= HTML::tag('td', [], ClickZans::getCntBlock($problem->info['zan'])); $html .= HTML::tag_end('tr'); return $html; @@ -68,9 +66,7 @@ $header .= '' . UOJLocale::get('problems::problem') . ''; if (isset($_COOKIE['show_submit_mode'])) { $header .= '' . UOJLocale::get('problems::ac ratio') . ''; } -if (isset($_COOKIE['show_difficulty'])) { - $header .= '' . UOJLocale::get('problems::difficulty') . ''; -} +$header .= '' . UOJLocale::get('problems::difficulty') . ''; $header .= '' . UOJLocale::get('appraisal') . ''; $header .= ''; @@ -84,6 +80,7 @@ $pag_config = [ 'problems.submit_num as submit_num', 'problems.ac_num as ac_num', 'problems.zan as zan', + 'problems.difficulty as difficulty', 'problems.extra_config as extra_config', 'problems.uploader as uploader', ], @@ -163,13 +160,6 @@ $pag = new Paginator($pag_config); - -
- /> - -
@@ -200,19 +190,6 @@ $pag = new Paginator($pag_config); } location.reload(); }); - $('#input-show_difficulty').click(function() { - if (this.checked) { - $.cookie('show_difficulty', '', { - path: '/list', - expires: 365, - }); - } else { - $.removeCookie('show_difficulty', { - path: '/list', - }); - } - location.reload(); - }); pagination() ?>