|
73 | 73 | </a> |
74 | 74 | {{end}} |
75 | 75 | <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> |
76 | | - <button class="ui basic small compact dropdown jump icon button mr-2"> |
77 | | - <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span> |
78 | | - <div class="menu"> |
79 | | - {{if .Repository.CanEnableEditor}} |
80 | | - {{if .CanAddFile}} |
81 | | - <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
82 | | - {{.locale.Tr "repo.editor.new_file"}} |
83 | | - </a> |
84 | | - {{end}} |
85 | | - {{if .CanUploadFile}} |
86 | | - <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
87 | | - {{.locale.Tr "repo.editor.upload_file"}} |
88 | | - </a> |
89 | | - {{end}} |
90 | | - {{if .CanAddFile}} |
91 | | - <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
92 | | - {{.locale.Tr "repo.editor.patch"}} |
93 | | - </a> |
| 76 | + {{if or .CanAddFile .CanUploadFile}} |
| 77 | + <button class="ui basic small compact dropdown jump icon button mr-2"> |
| 78 | + <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span> |
| 79 | + <div class="menu"> |
| 80 | + {{if .Repository.CanEnableEditor}} |
| 81 | + {{if .CanAddFile}} |
| 82 | + <a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
| 83 | + {{.locale.Tr "repo.editor.new_file"}} |
| 84 | + </a> |
| 85 | + {{end}} |
| 86 | + {{if .CanUploadFile}} |
| 87 | + <a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
| 88 | + {{.locale.Tr "repo.editor.upload_file"}} |
| 89 | + </a> |
| 90 | + {{end}} |
| 91 | + {{if .CanAddFile}} |
| 92 | + <a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
| 93 | + {{.locale.Tr "repo.editor.patch"}} |
| 94 | + </a> |
| 95 | + {{end}} |
94 | 96 | {{end}} |
95 | | - {{end}} |
96 | | - {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} |
97 | | - <a class="item"href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> |
98 | | - {{.locale.Tr "repo.file_history"}} |
99 | | - </a> |
100 | | - {{end}} |
101 | | - </div> |
102 | | - {{svg "octicon-triangle-down" 14 "dropdown icon"}} |
103 | | - </button> |
| 97 | + </div> |
| 98 | + {{svg "octicon-triangle-down" 14 "dropdown icon"}} |
| 99 | + </button> |
| 100 | + {{end}} |
104 | 101 | {{else}} |
105 | 102 | <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> |
106 | 103 | {{end}} |
|
133 | 130 | {{end}} |
134 | 131 | </div> |
135 | 132 | {{end}} |
| 133 | + {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} |
| 134 | + <a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> |
| 135 | + {{svg "octicon-history" 16 "mr-3"}}{{.locale.Tr "repo.file_history"}} |
| 136 | + </a> |
| 137 | + {{end}} |
136 | 138 | </div> |
137 | 139 | </div> |
138 | 140 | {{if .IsViewFile}} |
|
0 commit comments