diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-19 21:40:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 21:40:42 +0800 |
commit | e422342eebc18034ef586ec58f1e2fff0340091d (patch) | |
tree | 307264b46c1683915429083d54e9634ee4f2fc4d /templates/repo/empty.tmpl | |
parent | 01214c8ada993bf5f54a4149979d140443d69410 (diff) | |
download | gitea-e422342eebc18034ef586ec58f1e2fff0340091d.tar.gz gitea-e422342eebc18034ef586ec58f1e2fff0340091d.zip |
Allow adding new files to an empty repo (#24164)
![image](https://user-images.githubusercontent.com/2114189/232561612-2bfcfd0a-fc04-47ba-965f-5d0bcea46c54.png)
Diffstat (limited to 'templates/repo/empty.tmpl')
-rw-r--r-- | templates/repo/empty.tmpl | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index cb883e8df5..0acb08933a 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -21,8 +21,21 @@ <div class="ui attached guide table segment empty-repo-guide"> <div class="item"> <h3>{{.locale.Tr "repo.clone_this_repo"}} <small>{{.locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3> - <div class="ui action small input"> - {{template "repo/clone_buttons" .}} + + <div class="gt-df"> + {{if and .CanWriteCode (not .Repository.IsArchived)}} + <a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/"> + {{.locale.Tr "repo.editor.new_file"}} + </a> + {{if .RepositoryUploadEnabled}} + <a class="ui small button" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/"> + {{.locale.Tr "repo.editor.upload_file"}} + </a> + {{end}} + {{end}} + <div class="ui action small input gt-df gt-f1"> + {{template "repo/clone_buttons" .}} + </div> </div> </div> |