gitea源码

empty.tmpl 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content repository quickstart">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. <div class="sixteen wide column content">
  7. {{template "base/alert" .}}
  8. {{if .Repository.IsArchived}}
  9. <div class="ui warning message tw-text-center">
  10. {{if .Repository.ArchivedUnix.IsZero}}
  11. {{ctx.Locale.Tr "repo.archive.title"}}
  12. {{else}}
  13. {{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
  14. {{end}}
  15. </div>
  16. {{end}}
  17. {{if .Repository.IsBroken}}
  18. <div class="ui segment center">{{ctx.Locale.Tr "repo.broken_message"}}</div>
  19. {{else if .RepoHasContentsWithoutBranch}}
  20. <div class="ui segment center">{{ctx.Locale.Tr "repo.no_branch"}}</div>
  21. {{else if .CanWriteCode}}
  22. <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.quick_guide"}}</h4>
  23. <div class="ui attached guide table segment empty-repo-guide">
  24. <div class="item">
  25. <h3>{{ctx.Locale.Tr "repo.clone_this_repo"}} <small>{{ctx.Locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository"}}</small></h3>
  26. <div class="repo-button-row">
  27. {{if and .CanWriteCode (not .Repository.IsArchived)}}
  28. <a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/">
  29. {{ctx.Locale.Tr "repo.editor.new_file"}}
  30. </a>
  31. {{if .RepositoryUploadEnabled}}
  32. <a class="ui small button" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/">
  33. {{ctx.Locale.Tr "repo.editor.upload_file"}}
  34. </a>
  35. {{end}}
  36. {{end}}
  37. {{template "repo/clone_buttons" .}}
  38. </div>
  39. </div>
  40. {{if not .Repository.IsArchived}}
  41. <div class="divider tw-my-0"></div>
  42. <div class="item">
  43. <h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3>
  44. <div class="markup">
  45. {{$gitRemoteName := $.SystemConfig.Repository.GitGuideRemoteName.Value ctx}}
  46. <pre><code>touch README.md
  47. git init{{if ne .Repository.ObjectFormatName "sha1"}} --object-format={{.Repository.ObjectFormatName}}{{end}}{{/* for sha256 repo, it needs to set "object-format" explicitly*/}}
  48. {{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
  49. git add README.md
  50. git commit -m "first commit"
  51. git remote add {{$gitRemoteName}} <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
  52. git push -u {{$gitRemoteName}} {{.Repository.DefaultBranch}}</code></pre>
  53. </div>
  54. </div>
  55. <div class="divider"></div>
  56. <div class="item">
  57. <h3>{{ctx.Locale.Tr "repo.push_exist_repo"}}</h3>
  58. <div class="markup">
  59. <pre><code>git remote add {{$gitRemoteName}} <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
  60. git push -u {{$gitRemoteName}} {{.Repository.DefaultBranch}}</code></pre>
  61. </div>
  62. </div>
  63. {{end}}
  64. </div>
  65. {{else}}
  66. <div class="ui segment center">{{ctx.Locale.Tr "repo.empty_message"}}</div>
  67. {{end}}
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. {{template "base/footer" .}}