summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorTyrone Yeh <tyrone_yeh@draytek.com>2022-09-06 15:01:58 +0800
committerGitHub <noreply@github.com>2022-09-06 08:01:58 +0100
commitf1ea6c92d18699dfe935556f065be288d3bc2e78 (patch)
tree3b8bdf81ee0e4ed306c96efb4d35f85a587a9e5b /templates/repo
parent795bd946e26bd537aea44a342ffaff19689dfc2a (diff)
downloadgitea-f1ea6c92d18699dfe935556f065be288d3bc2e78.tar.gz
gitea-f1ea6c92d18699dfe935556f065be288d3bc2e78.zip
Fix sub folder in repository missing add file dropdown (#21069)
In repository sub folder missing add file dropdown menu, Probably broken since #20602
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/home.tmpl51
1 files changed, 26 insertions, 25 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index fd1b60bef8..69af36ac68 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -73,32 +73,33 @@
</a>
{{end}}
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button tooltip" data-content="{{.locale.Tr "repo.find_file.go_to_file"}}">{{svg "octicon-file-moved" 15}}</a>
- {{if or .CanAddFile .CanUploadFile}}
- <button class="ui basic small compact dropdown jump icon button mr-2">
- <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
- <div class="menu">
- {{if .Repository.CanEnableEditor}}
- {{if .CanAddFile}}
- <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{.locale.Tr "repo.editor.new_file"}}
- </a>
- {{end}}
- {{if .CanUploadFile}}
- <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{.locale.Tr "repo.editor.upload_file"}}
- </a>
- {{end}}
- {{if .CanAddFile}}
- <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
- {{.locale.Tr "repo.editor.patch"}}
- </a>
- {{end}}
+ {{end}}
+ {{if or .CanAddFile .CanUploadFile}}
+ <button class="ui basic small compact dropdown jump icon button mr-2">
+ <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
+ <div class="menu">
+ {{if .Repository.CanEnableEditor}}
+ {{if .CanAddFile}}
+ <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{.locale.Tr "repo.editor.new_file"}}
+ </a>
{{end}}
- </div>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- </button>
- {{end}}
- {{else}}
+ {{if .CanUploadFile}}
+ <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{.locale.Tr "repo.editor.upload_file"}}
+ </a>
+ {{end}}
+ {{if .CanAddFile}}
+ <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
+ {{.locale.Tr "repo.editor.patch"}}
+ </a>
+ {{end}}
+ {{end}}
+ </div>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </button>
+ {{end}}
+ {{if ne $n 0}}
<span class="ui breadcrumb repo-path"><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>