From ad83146064183365a677ff9db6f3348795b29980 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 17 Oct 2022 23:00:18 +0200 Subject: [PATCH 1/5] use flexbox --- templates/repo/branch_dropdown.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 2010fe261e15c..a836adebd0d44 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -14,15 +14,15 @@ data-branch-url-suffix="{{if .branchURLSuffix}}{{.branchURLSuffix}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}" data-tag-url-prefix="{{if .tagURLPrefix}}{{.tagURLPrefix}}{{else if $release}}{{$.root.RepoLink}}/compare/{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/tag/{{end}}" data-tag-url-suffix="{{if .tagURLSuffix}}{{.tagURLSuffix}}{{else if $release}}...{{if $release.IsDraft}}{{PathEscapeSegments $release.Target}}{{else}}{{if $release.TagName}}{{PathEscapeSegments $release.TagName}}{{else}}{{PathEscapeSegments $release.Sha1}}{{end}}{{end}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}"> -
- +
+ {{if $release}} {{.root.locale.Tr "repo.release.compare"}} {{else}} {{svg "octicon-tag"}} {{.root.locale.Tr "repo.tag"}}: {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.branch"}}: {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.tree"}}: - {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} +  {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} {{end}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} From e2a618efc6656880d57a6253a2dc3c1754134c62 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 17 Oct 2022 23:03:47 +0200 Subject: [PATCH 2/5] move space into separate span --- templates/repo/branch_dropdown.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index a836adebd0d44..4385bb4126dfc 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -22,7 +22,8 @@ {{svg "octicon-tag"}} {{.root.locale.Tr "repo.tag"}}: {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.branch"}}: {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.tree"}}: -  {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} +   + {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} {{end}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} From 0f51cfdfb845bd253bb40ab741ae1116ca852d70 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 18 Oct 2022 23:06:02 +0200 Subject: [PATCH 3/5] remove prefix --- templates/repo/branch_dropdown.tmpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 4385bb4126dfc..bb6b12e438db3 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -19,11 +19,10 @@ {{if $release}} {{.root.locale.Tr "repo.release.compare"}} {{else}} - {{svg "octicon-tag"}} {{.root.locale.Tr "repo.tag"}}: - {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.branch"}}: - {{svg "octicon-git-branch"}} {{.root.locale.Tr "repo.tree"}}: -   - {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} + {{svg "octicon-tag"}} + {{svg "octicon-git-branch"}} + {{svg "octicon-git-branch"}} + {{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}} {{end}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} From 77a7e36cf07eb356521fe918b398d863d1956ebc Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 18 Oct 2022 23:21:37 +0200 Subject: [PATCH 4/5] change to button and add margin to repo-path --- templates/repo/branch_dropdown.tmpl | 4 ++-- templates/repo/home.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index bb6b12e438db3..8aefbe70950b9 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -14,7 +14,7 @@ data-branch-url-suffix="{{if .branchURLSuffix}}{{.branchURLSuffix}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}" data-tag-url-prefix="{{if .tagURLPrefix}}{{.tagURLPrefix}}{{else if $release}}{{$.root.RepoLink}}/compare/{{else}}{{$.root.RepoLink}}/{{if $.root.PageIsCommits}}commits{{else}}src{{end}}/tag/{{end}}" data-tag-url-suffix="{{if .tagURLSuffix}}{{.tagURLSuffix}}{{else if $release}}...{{if $release.IsDraft}}{{PathEscapeSegments $release.Target}}{{else}}{{if $release.TagName}}{{PathEscapeSegments $release.TagName}}{{else}}{{PathEscapeSegments $release.Sha1}}{{end}}{{end}}{{else}}{{if $.root.TreePath}}/{{PathEscapeSegments $.root.TreePath}}{{end}}{{end}}"> -
+
+
From e41ce3199930e93d80f57c4d0ed9006c1bb752ff Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 18 Oct 2022 23:28:26 +0200 Subject: [PATCH 5/5] fix margin mismatch --- templates/repo/branch_dropdown.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 8aefbe70950b9..edb077a014bd2 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -2,7 +2,7 @@ {{$defaultBranch := $.root.BranchName}}{{if and .root.IsViewTag (not .noTag)}}{{$defaultBranch = .root.TagName}}{{end}}{{if eq $defaultBranch ""}}{{$defaultBranch = $.root.Repository.DefaultBranch}}{{end}} {{$type := ""}}{{if and .root.IsViewTag (not .noTag)}}{{$type = "tag"}}{{else if .root.IsViewBranch}}{{$type = "branch"}}{{else}}{{$type = "tree"}}{{end}} {{$showBranchesInDropdown := not .root.HideBranchesInDropdown}} -
+