From d9a913f03a4edcb0ccba34b65a70c65cbbedad4a Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 24 Feb 2023 15:31:11 +0800 Subject: [PATCH] fix: 5394bbb2f72621b6dd3eba53e8c8e80f39e13114 --- web/app/controllers/blogs.php | 2 +- web/app/models/UOJBlog.php | 8 ++++++++ web/css/uoj-bs5.css | 12 ------------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/web/app/controllers/blogs.php b/web/app/controllers/blogs.php index 32280ef..744dcc7 100644 --- a/web/app/controllers/blogs.php +++ b/web/app/controllers/blogs.php @@ -25,7 +25,7 @@ function echoBlog($info) { echo '
', UOJUser::getLink($poster), '
'; echo '
'; echo '', ' ', $blog->getReplyCnt(), ' '; - echo '', ' ', $blog->info['zan'], ' '; + echo '', ' ', $blog->getDisplayZanCnt(), ' '; echo '
'; echo ''; echo ''; diff --git a/web/app/models/UOJBlog.php b/web/app/models/UOJBlog.php index 82c1fa1..6762fef 100644 --- a/web/app/models/UOJBlog.php +++ b/web/app/models/UOJBlog.php @@ -122,6 +122,14 @@ class UOJBlog { } } + public function getDisplayZanCnt() { + $display_zan = $this->info['zan'] > 0 ? "+{$this->info['zan']}" : $this->info['zan']; + + if ($this->info['zan'] < 0) $display_zan = '-'; + + return $display_zan; + } + public function queryNewestComment() { return DB::selectFirst([ "select * from blogs_comments", diff --git a/web/css/uoj-bs5.css b/web/css/uoj-bs5.css index b0c852e..2a5b3a4 100644 --- a/web/css/uoj-bs5.css +++ b/web/css/uoj-bs5.css @@ -619,15 +619,3 @@ form.form-horizontal { [data-bs-theme='dark'] .uoj-username-brown { color: #996f1c; } - -/* Dark: Table Colors */ - -[data-bs-theme='dark'] .table-success { - --bs-table-bg: #d1e7ddb9; - --bs-table-border-color: #bcd0c7b9; -} - -[data-bs-theme='dark'] .table-warning { - --bs-table-bg: #fff3cdb9; - --bs-table-border-color: #e6dbb9b9; -}