From dd6e8ab57bedf94cacec176b28420d5cb25fc0e9 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 10 Sep 2023 18:27:23 +0800 Subject: [PATCH] Improve "language stats" UI (#26968) Before: * The layout is quite complex * The UI flickers when switch the stats (https://try.gitea.io/) After: * Simplify the code * The UI doesn't flicker --- templates/repo/sub_menu.tmpl | 68 ++++++++-------- web_src/css/repo.css | 114 ++++++--------------------- web_src/js/features/common-global.js | 10 +-- web_src/js/features/repo-common.js | 12 +-- web_src/js/features/repo-legacy.js | 2 - 5 files changed, 62 insertions(+), 144 deletions(-) diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index da5f37fa05..3a1400575c 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -1,48 +1,44 @@ {{if and (not .HideRepoInfo) (not .IsBlame)}} -
+
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}}