From b301cb17a355e6f44e480f04f8ce89a7e43c58eb Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 10 Mar 2023 12:41:04 -0500 Subject: [PATCH] Fix and move "Use this template" button (#23398) (#23408) Backport #23398 Before: Screenshot 2023-03-09 at 23 21 25 After: Screenshot 2023-03-09 at 23 24 34 Co-authored-by: silverwind Co-authored-by: techknowlogick --- templates/repo/home.tmpl | 16 ++++++---------- web_src/less/_repository.less | 2 +- web_src/less/helpers.less | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 2a79c51ddf..73afbd663d 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -63,7 +63,7 @@ {{end}} {{template "repo/sub_menu" .}}
-
+
{{template "repo/branch_dropdown" dict "root" .}} {{$n := len .TreeNames}} {{$l := Subtract $n 1}} @@ -99,20 +99,16 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}} {{end}} + {{if and (eq $n 0) (.Repository.IsTemplate)}} + + {{.locale.Tr "repo.use_template"}} + + {{end}} {{if ne $n 0}} {{EllipsisString .Repository.Name 30}}{{range $i, $v := .TreeNames}}/{{if eq $i $l}}{{EllipsisString $v 30}}{{else}}{{$p := index $.Paths $i}}{{EllipsisString $v 30}}{{end}}{{end}} {{end}}
- {{if eq $n 0}} - {{if .Repository.IsTemplate}} - - {{end}} - {{end}} {{if eq $n 0}}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 74079170a1..b5d9a1029f 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -2869,7 +2869,7 @@ } .repo-button-row > * { - margin-top: 10px; + margin-top: 8px; } .wiki .repo-button-row { diff --git a/web_src/less/helpers.less b/web_src/less/helpers.less index baa5959946..08589fdaab 100644 --- a/web_src/less/helpers.less +++ b/web_src/less/helpers.less @@ -172,6 +172,27 @@ .gt-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; } .gt-py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; } +.gt-gap-0 { gap: 0 !important; } +.gt-gap-1 { gap: .125rem !important; } +.gt-gap-2 { gap: .25rem !important; } +.gt-gap-3 { gap: .5rem !important; } +.gt-gap-4 { gap: 1rem !important; } +.gt-gap-5 { gap: 2rem !important; } + +.gt-gap-x-0 { column-gap: 0 !important; } +.gt-gap-x-1 { column-gap: .125rem !important; } +.gt-gap-x-2 { column-gap: .25rem !important; } +.gt-gap-x-3 { column-gap: .5rem !important; } +.gt-gap-x-4 { column-gap: 1rem !important; } +.gt-gap-x-5 { column-gap: 2rem !important; } + +.gt-gap-y-0 { row-gap: 0 !important; } +.gt-gap-y-1 { row-gap: .125rem !important; } +.gt-gap-y-2 { row-gap: .25rem !important; } +.gt-gap-y-3 { row-gap: .5rem !important; } +.gt-gap-y-4 { row-gap: 1rem !important; } +.gt-gap-y-5 { row-gap: 2rem !important; } + .gt-content-center { align-content: center !important; } @media @mediaSm {