new.tmpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {{template "base/head" .}}
  2. <div class="repository new release">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <h2 class="ui dividing header">
  6. {{if .PageIsEditRelease}}
  7. {{.i18n.Tr "repo.release.edit_release"}}
  8. <div class="sub header">{{.i18n.Tr "repo.release.edit_subheader"}}</div>
  9. {{else}}
  10. {{.i18n.Tr "repo.release.new_release"}}
  11. <div class="sub header">{{.i18n.Tr "repo.release.new_subheader"}}</div>
  12. {{end}}
  13. </h2>
  14. {{template "base/alert" .}}
  15. <form class="ui form grid" action="{{.Link}}" method="post">
  16. {{.CsrfTokenHtml}}
  17. <div class="ui seven wide column target">
  18. <div class="inline field {{if .Err_TagName}}error{{end}}">
  19. {{if .PageIsEditRelease}}
  20. <b>{{.tag_name}}</b><span class="at">@</span><strong>{{.tag_target}}</strong>
  21. {{else}}
  22. <input id="tag-name" name="tag_name" value="{{.tag_name}}" placeholder="{{.i18n.Tr "repo.release.tag_name"}}" autofocus required>
  23. <span class="at">@</span>
  24. <div class="ui selection dropdown">
  25. <input type="hidden" name="tag_target" value="{{.tag_target}}"/>
  26. <i class="octicon octicon-git-branch"></i>
  27. <div class="text">
  28. {{.i18n.Tr "repo.release.target"}} :
  29. <strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong>
  30. </div>
  31. <i class="dropdown icon"></i>
  32. <div class="menu">
  33. {{range .Branches}}
  34. <div class="item" data-value="{{.}}">{{.}}</div>
  35. {{end}}
  36. </div>
  37. </div>
  38. <span class="help">{{.i18n.Tr "repo.release.tag_helper"}}</span>
  39. {{end}}
  40. </div>
  41. </div>
  42. <div class="eleven wide column">
  43. <div class="field {{if .Err_Title}}error{{end}}">
  44. <label>{{.i18n.Tr "repo.release.title"}}</label>
  45. <input name="title" placeholder="{{.i18n.Tr "repo.release.title"}}" value="{{.title}}" autofocus required>
  46. </div>
  47. <div class="field">
  48. <label>{{.i18n.Tr "repo.release.content"}}</label>
  49. <textarea name="content">{{.content}}</textarea>
  50. </div>
  51. </div>
  52. <div class="ui container">
  53. <div class="ui divider"></div>
  54. <div class="ui text right">
  55. <div class="prerelease field">
  56. <div class="ui checkbox">
  57. <input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}>
  58. <label><strong>{{.i18n.Tr "repo.release.prerelease_desc"}}</strong></label>
  59. </div>
  60. </div>
  61. <span class="help">{{.i18n.Tr "repo.release.prerelease_helper"}}</span>
  62. <div class="field">
  63. <a class="ui blue basic button" href="{{.RepoLink}}/releases">
  64. {{.i18n.Tr "repo.release.cancel"}}
  65. </a>
  66. {{/* Release didn't save as draft at first time is not possible to be draft again because the Git tag had been created. */}}
  67. {{if or (not .PageIsEditRelease) .IsDraft}}
  68. <input class="ui grey button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/>
  69. {{end}}
  70. {{if .PageIsEditRelease}}
  71. <button class="ui green button">
  72. {{if .IsDraft}}
  73. {{.i18n.Tr "repo.release.publish"}}
  74. {{else}}
  75. {{.i18n.Tr "repo.release.edit_release"}}
  76. {{end}}
  77. </button>
  78. <a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
  79. {{$.i18n.Tr "repo.release.delete_release"}}
  80. </a>
  81. {{else}}
  82. <button class="ui green button">
  83. {{.i18n.Tr "repo.release.publish"}}
  84. </button>
  85. {{end}}
  86. </div>
  87. </div>
  88. </div>
  89. </form>
  90. </div>
  91. </div>
  92. {{if .PageIsEditRelease}}
  93. <div class="ui small basic delete modal">
  94. <div class="ui icon header">
  95. <i class="trash icon"></i>
  96. {{.i18n.Tr "repo.release.deletion"}}
  97. </div>
  98. <div class="content">
  99. <p>{{.i18n.Tr "repo.release.deletion_desc"}}</p>
  100. </div>
  101. {{template "base/delete_modal_actions" .}}
  102. </div>
  103. {{end}}
  104. {{template "base/footer" .}}