From bfa160fc98a23923b6ce1cd4d99e8970d937d6ec Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 22 Mar 2024 01:04:03 +0800 Subject: [PATCH] Refactor repo header/list (#29969) 1. Use general "mobile-only" and "not-mobile" CSS styles, remove some`@media (max-width: 767.98px)` tricks 2. Use `CountFmt` for repo list, just like the repo header (and it matches GitHub, to avoid big numbers bloat the page) --- options/locale/locale_en-US.ini | 4 +--- templates/admin/repo/list.tmpl | 6 +++--- templates/base/head_navbar.tmpl | 10 +++++----- templates/explore/repo_list.tmpl | 17 ++++++++++++----- templates/repo/header.tmpl | 30 ++++++++++++++++-------------- web_src/css/base.css | 7 ------- web_src/css/helpers.css | 12 ++++++++++++ web_src/css/modules/navbar.css | 7 ------- web_src/css/repo/header.css | 23 ++--------------------- 9 files changed, 51 insertions(+), 65 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 08b87134fd..3383bc0bcc 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1063,6 +1063,7 @@ watchers = Watchers stargazers = Stargazers stars_remove_warning = This will remove all stars from this repository. forks = Forks +stars = Stars reactions_more = and %d more unit_disabled = The site administrator has disabled this repository section. language_other = Other @@ -2966,9 +2967,6 @@ repos.unadopted.no_more = No more unadopted repositories found repos.owner = Owner repos.name = Name repos.private = Private -repos.watches = Watches -repos.stars = Stars -repos.forks = Forks repos.issues = Issues repos.size = Size repos.lfs_size = LFS Size diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index e977c8307c..4b27d87a45 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -19,13 +19,13 @@ {{ctx.Locale.Tr "admin.repos.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType false}} - {{ctx.Locale.Tr "admin.repos.watches"}} + {{ctx.Locale.Tr "repo.watchers"}} - {{ctx.Locale.Tr "admin.repos.stars"}} + {{ctx.Locale.Tr "repo.stars"}} {{SortArrow "moststars" "feweststars" $.SortType false}} - {{ctx.Locale.Tr "admin.repos.forks"}} + {{ctx.Locale.Tr "repo.forks"}} {{SortArrow "mostforks" "fewestforks" $.SortType false}} {{ctx.Locale.Tr "admin.repos.issues"}} diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 4f48dc82c3..ffa2ef844f 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -11,7 +11,7 @@ -