summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-03-10 12:41:04 -0500
committerGitHub <noreply@github.com>2023-03-11 01:41:04 +0800
commitb301cb17a355e6f44e480f04f8ce89a7e43c58eb (patch)
tree2489f3ea9736c5d26be789142a6d8e97390b061f /templates
parente259daeff85f70ab1744efbbf28fcfcd21e2ac3b (diff)
downloadgitea-b301cb17a355e6f44e480f04f8ce89a7e43c58eb.tar.gz
gitea-b301cb17a355e6f44e480f04f8ce89a7e43c58eb.zip
Fix and move "Use this template" button (#23398) (#23408)
Backport #23398 Before: <img width="1157" alt="Screenshot 2023-03-09 at 23 21 25" src="https://user-images.githubusercontent.com/115237/224174168-869966cc-fa59-4231-b449-23bd9db12862.png"> After: <img width="1145" alt="Screenshot 2023-03-09 at 23 24 34" src="https://user-images.githubusercontent.com/115237/224174173-7f5b9c22-44c4-4eed-990c-da49d749eb0e.png"> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl16
1 files changed, 6 insertions, 10 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" .}}
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
- <div class="gt-df gt-ac">
+ <div class="gt-df gt-ac gt-fw gt-gap-y-3">
{{template "repo/branch_dropdown" dict "root" .}}
{{$n := len .TreeNames}}
{{$l := Subtract $n 1}}
@@ -99,20 +99,16 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</button>
{{end}}
+ {{if and (eq $n 0) (.Repository.IsTemplate)}}
+ <a role="button" class="ui primary compact button" href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}">
+ {{.locale.Tr "repo.use_template"}}
+ </a>
+ {{end}}
{{if ne $n 0}}
<span class="ui breadcrumb repo-path gt-ml-2"><a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section" title="{{$v}}">{{EllipsisString $v 30}}</span>{{else}}{{$p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span>
{{end}}
</div>
<div class="gt-df gt-ac">
- {{if eq $n 0}}
- {{if .Repository.IsTemplate}}
- <div class="ui tiny primary buttons">
- <a href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}" class="ui button">
- {{.locale.Tr "repo.use_template"}}
- </a>
- </div>
- {{end}}
- {{end}}
<!-- Only show clone panel in repository home page -->
{{if eq $n 0}}
<div class="ui action tiny input" id="clone-panel">