|
60 | 60 | </div>
|
61 | 61 | {{end}}
|
62 | 62 | {{template "repo/sub_menu" .}}
|
63 |
| - <div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins no-vertical-tabs"> |
64 |
| - {{template "repo/branch_dropdown" dict "root" .}} |
65 |
| - {{ $n := len .TreeNames}} |
66 |
| - {{ $l := Subtract $n 1}} |
67 |
| - <!-- If home page, show new PR. If not, show breadcrumb --> |
68 |
| - {{if eq $n 0}} |
69 |
| - {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} |
70 |
| - <div class="fitted item mx-0"> |
| 63 | + <div class="repo-button-row df ac sb fw"> |
| 64 | + <div class="df ac"> |
| 65 | + {{template "repo/branch_dropdown" dict "root" .}} |
| 66 | + {{ $n := len .TreeNames}} |
| 67 | + {{ $l := Subtract $n 1}} |
| 68 | + <!-- If home page, show new PR. If not, show breadcrumb --> |
| 69 | + {{if eq $n 0}} |
| 70 | + {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} |
71 | 71 | <a href="{{.BaseRepo.Link}}/compare/{{PathEscapeSegments .BaseRepo.DefaultBranch}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}{{if .BaseRepo.IsFork}}/{{PathEscape .Repository.Name}}{{end}}:{{end}}{{PathEscapeSegments .BranchName}}">
|
72 |
| - <button id="new-pull-request" class="ui compact basic button">{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}</button> |
73 |
| - </a> |
74 |
| - </div> |
75 |
| - {{end}} |
76 |
| - <div class="fitted item mx-0"> |
77 |
| - <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button"> |
78 |
| - {{.locale.Tr "repo.find_file.go_to_file"}} |
79 |
| - </a> |
80 |
| - </div> |
81 |
| - {{else}} |
82 |
| - <div class="fitted item"><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></div> |
83 |
| - {{end}} |
84 |
| - <div class="right fitted item mr-0" id="file-buttons"> |
85 |
| - <div class="ui tiny primary buttons"> |
86 |
| - {{if .Repository.CanEnableEditor}} |
87 |
| - {{if .CanAddFile}} |
88 |
| - <a href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" class="ui button"> |
89 |
| - {{.locale.Tr "repo.editor.new_file"}} |
90 |
| - </a> |
91 |
| - {{end}} |
92 |
| - {{if .CanUploadFile}} |
93 |
| - <a href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" class="ui button"> |
94 |
| - {{.locale.Tr "repo.editor.upload_file"}} |
95 |
| - </a> |
96 |
| - {{end}} |
97 |
| - {{if .CanAddFile}} |
98 |
| - <a href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" class="ui button"> |
99 |
| - {{.locale.Tr "repo.editor.patch"}} |
100 |
| - </a> |
101 |
| - {{end}} |
102 |
| - {{end}} |
103 |
| - {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} |
104 |
| - <a href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}" class="ui button"> |
105 |
| - {{.locale.Tr "repo.file_history"}} |
| 72 | + <button id="new-pull-request" class="ui compact basic button tooltip" data-content="{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}"><span class="text">{{svg "octicon-git-pull-request"}}</span></button> |
106 | 73 | </a>
|
107 | 74 | {{end}}
|
108 |
| - </div> |
109 |
| - |
| 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> |
| 94 | + {{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> |
| 104 | + {{else}} |
| 105 | + <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 | + {{end}} |
110 | 107 | </div>
|
111 |
| - <div class="fitted item"> |
| 108 | + <div class="df ac"> |
112 | 109 | {{if eq $n 0}}
|
113 | 110 | {{if .Repository.IsTemplate}}
|
114 | 111 | <div class="ui tiny primary buttons">
|
|
118 | 115 | </div>
|
119 | 116 | {{end}}
|
120 | 117 | {{end}}
|
121 |
| - </div> |
122 |
| - <div class="fitted item"> |
123 | 118 | <!-- Only show clone panel in repository home page -->
|
124 | 119 | {{if eq $n 0}}
|
125 | 120 | <div class="ui action tiny input" id="clone-panel">
|
126 |
| - {{template "repo/clone_buttons" .}} |
127 |
| - {{template "repo/clone_script" .}} |
128 |
| - {{if not .DisableDownloadSourceArchives}} |
129 |
| - <button id="download-btn" class="ui basic jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right"> |
| 121 | + {{template "repo/clone_buttons" .}} |
| 122 | + {{template "repo/clone_script" .}} |
| 123 | + {{if not .DisableDownloadSourceArchives}} |
| 124 | + <button id="download-btn" class="ui basic small compact jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right"> |
130 | 125 | {{svg "octicon-download"}}
|
131 | 126 | <div class="menu">
|
132 | 127 | <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.BranchName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_zip"}}</a>
|
|
135 | 130 | <a class="item" href="vscode://vscode.git/clone?url={{$.RepoCloneLink.HTTPS}}">{{svg "gitea-vscode" 16 "mr-3"}}{{.locale.Tr "repo.clone_in_vsc"}}</a>
|
136 | 131 | </div>
|
137 | 132 | </button>
|
138 |
| - {{end}} |
| 133 | + {{end}} |
139 | 134 | </div>
|
140 | 135 | {{end}}
|
141 | 136 | </div>
|
|
0 commit comments