You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.9 KiB

  1. {{template "base/head" .}}
  2. <div class="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">
  10. {{.i18n.Tr "repo.archive.title"}}
  11. </div>
  12. {{end}}
  13. {{if .CanWriteCode}}
  14. <h4 class="ui top attached header">
  15. {{.i18n.Tr "repo.quick_guide"}}
  16. </h4>
  17. <div class="ui attached guide table segment">
  18. <div class="item">
  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>
  20. <div class="ui action small input">
  21. {{if not $.DisableHTTP}}
  22. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  23. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  24. </button>
  25. {{end}}
  26. {{if not $.DisableSSH}}
  27. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  28. SSH
  29. </button>
  30. {{end}}
  31. {{if not $.DisableHTTP}}
  32. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  33. {{else}}
  34. <input id="repo-clone-url" value="{{$.CloneLink.SSH}}" readonly>
  35. {{end}}
  36. {{if not (and $.DisableHTTP $.DisableSSH)}}
  37. <button class="ui basic button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
  38. <i class="octicon octicon-clippy"></i>
  39. </button>
  40. {{end}}
  41. </div>
  42. </div>
  43. {{if not .Repository.IsArchived}}
  44. <div class="ui divider"></div>
  45. <div class="item">
  46. <h3>{{.i18n.Tr "repo.create_new_repo_command"}}</h3>
  47. <div class="markdown">
  48. <pre><code>touch README.md
  49. git init
  50. git add README.md
  51. git commit -m "first commit"
  52. git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span>
  53. git push -u origin master</code></pre>
  54. </div>
  55. </div>
  56. <div class="ui divider"></div>
  57. <div class="item">
  58. <h3>{{.i18n.Tr "repo.push_exist_repo"}}</h3>
  59. <div class="markdown">
  60. <pre><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span>
  61. git push -u origin master</code></pre>
  62. </div>
  63. </div>
  64. {{end}}
  65. {{else}}
  66. <div class="ui segment center">
  67. {{.i18n.Tr "repo.empty_message"}}
  68. </div>
  69. {{end}}
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. {{template "base/footer" .}}