From 0a026a9cd8d9f2bc104b4dd84a65480ab3801334 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Sun, 16 Jun 2024 12:36:41 +0000 Subject: [PATCH] Reorder repo tabs (#4139) More info in the linked PR. --- Make positioning of the repo tabs make more sense. This is an isolated implementation for one of many changes discussed in the referenced issue, it will work good without the other changes too. ## Changes - Actions are moved to the edge. This tab is the least relevant to both visitors and developers. The first don't really need it at all, the second only visit it when something goes unexpected (run did not happen or attached to the wrong event), or just to see the run queue to know when their actions is going to get processed. This is not a tab with always-relevant information. - put Packages after releases. The Packages are like a download page for Releases, but for released packages instead of binaries/source code. It is relevant to Releases, so it should stay close, but it is secondary to Releases by importance. For example, because they don't actually contain release notes unlike Releases. - the above makes Projects appear next to Issues and Pull requests which I think is nice as they're related. ## Preview ### v7 https://codeberg.org/attachments/c434e8fd-aaab-4c27-9071-2a3ba68ad4b7 ### This PR https://codeberg.org/attachments/74743c03-883e-40cf-8cb1-384d1d8cf63c Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4139 Reviewed-by: Earl Warren Reviewed-by: Otto Reviewed-by: Beowulf --- release-notes/8.0.0/4139.md | 5 ++++ templates/repo/header.tmpl | 48 ++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 release-notes/8.0.0/4139.md diff --git a/release-notes/8.0.0/4139.md b/release-notes/8.0.0/4139.md new file mode 100644 index 0000000000..116a36d881 --- /dev/null +++ b/release-notes/8.0.0/4139.md @@ -0,0 +1,5 @@ +Reorder repo tabs for better UX: +- Actions is now the last tab +- Packages are located after Releases +- This puts Projects after Pull requests +(tab positions may depend on which units are enabled in the repo) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 82e7679cd2..d8c53d08be 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -85,9 +85,9 @@ {{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
{{if .Permission.CanRead $.UnitTypeCode}} - - {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} - + + {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} + {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} @@ -114,21 +114,6 @@ {{end}} - {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} - - {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} - {{if .Repository.NumOpenActionRuns}} - {{CountFmt .Repository.NumOpenActionRuns}} - {{end}} - - {{end}} - - {{if .Permission.CanRead $.UnitTypePackages}} - - {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} - - {{end}} - {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} {{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project"}} @@ -139,12 +124,18 @@ {{end}} {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} - - {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} - {{if .NumReleases}} - {{CountFmt .NumReleases}} - {{end}} - + + {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} + {{if .NumReleases}} + {{CountFmt .NumReleases}} + {{end}} + + {{end}} + + {{if .Permission.CanRead $.UnitTypePackages}} + + {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} + {{end}} {{if .Permission.CanRead $.UnitTypeWiki}} @@ -165,6 +156,15 @@ {{end}} + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} + + {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} + {{if .Repository.NumOpenActionRuns}} + {{CountFmt .Repository.NumOpenActionRuns}} + {{end}} + + {{end}} + {{template "custom/extra_tabs" .}} {{if and RepoFlagsEnabled .SignedUser.IsAdmin}}