File tree Expand file tree Collapse file tree 2 files changed +26
-17
lines changed Expand file tree Collapse file tree 2 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -826,7 +826,15 @@ func renderCode(ctx *context.Context) {
826
826
ctx .Data ["PageIsViewCode" ] = true
827
827
828
828
if ctx .Repo .Repository .IsEmpty {
829
+ << << << < HEAD:routers / web / repo / view .go
829
830
ctx .HTML (http .StatusOK , tplRepoEMPTY )
831
+ == == == =
832
+ if ctx .Repo .CanWrite (models .UnitTypeCode ) {
833
+ ctx .Data ["CanAddFile" ] = true
834
+ ctx .Data ["CanUploadFile" ] = setting .Repository .Upload .Enabled
835
+ }
836
+ ctx .HTML (200 , tplRepoEMPTY )
837
+ >> >> >> > 7 d4422307 (Add buttons on empty repository page ):routers / repo / view .go
830
838
return
831
839
}
832
840
Original file line number Diff line number Diff line change 15
15
{{.i18n.Tr "repo.quick_guide"}}
16
16
</h4>
17
17
<div class="ui attached guide table segment">
18
-
19
18
<div class="item">
20
19
<h3>{{.i18n.Tr "repo.clone_this_repo"}} <small>{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3>
21
- <div class="ui action small input">
22
- <div class="right fitted item mr-0" id="file-buttons">
23
- <div class="ui tiny primary buttons">
24
- {{if .Repository.CanEnableEditor}}
25
- {{if .CanAddFile}}
26
- <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
27
- {{.i18n.Tr "repo.editor.new_file"}}
28
- </a>
29
- {{end}}
30
- {{if .CanUploadFile}}
31
- <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
32
- {{.i18n.Tr "repo.editor.upload_file"}}
33
- </a>
34
- {{end}}
20
+ <div class="left fitted item mr-0 dib" id="file-buttons">
21
+ <div class="ui primary buttons">
22
+ {{if .Repository.CanEnableEditor}}
23
+ {{if .CanAddFile}}
24
+ <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/" class="ui basic clone button no-transition">
25
+ {{.i18n.Tr "repo.editor.new_file"}}
26
+ </a>
35
27
{{end}}
36
- </div>
28
+ {{if .CanUploadFile}}
29
+ <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/" class="ui basic clone button no-transition">
30
+ {{.i18n.Tr "repo.editor.upload_file"}}
31
+ </a>
32
+ {{end}}
33
+ {{end}}
34
+ </div>
35
+ </div>
36
+ <div class="fitted item dib">
37
+ <div class="ui action small input">
38
+ {{template "repo/clone_buttons" .}}
37
39
</div>
38
- {{template "repo/clone_buttons" .}}
39
40
</div>
40
41
</div>
41
42
You can’t perform that action at this time.
0 commit comments