From 65e190ae8bd6c72d8701a58d67b256c87b92c189 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) (cherry picked from commit bfa160fc98a23923b6ce1cd4d99e8970d937d6ec) Conflicts: templates/explore/repo_list.tmpl templates/repo/header.tmpl web_src/css/repo/header.css Resolved the template conflicts by porting the changes to Forgejo (in case of `header.tmpl`, applying the changes in `header_fork.tmpl). In case of the CSS change, opted to take Gitea's version and drop the entire media query. --- 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 | 28 +++++++++++++++------------- templates/repo/header_fork.tmpl | 6 +++--- 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 | 32 ++------------------------------ 10 files changed, 53 insertions(+), 76 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e93be5221..7cb8dfc08 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1083,6 +1083,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 @@ -3008,9 +3009,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 e977c8307..4b27d87a4 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 ad80d3367..fac2809d1 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -11,7 +11,7 @@ -