new.tmpl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. {{if .PageIsEditRelease}}
  64. <a class="ui blue basic button" href="{{.RepoLink}}/releases">
  65. {{.i18n.Tr "repo.release.cancel"}}
  66. </a>
  67. <button class="ui green button">
  68. {{.i18n.Tr "repo.release.edit_release"}}
  69. </button>
  70. <a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
  71. {{$.i18n.Tr "repo.release.delete_release"}}
  72. </a>
  73. {{else}}
  74. <button class="ui green button">
  75. {{.i18n.Tr "repo.release.publish"}}
  76. </button>
  77. <input class="ui grey button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/>
  78. {{end}}
  79. </div>
  80. </div>
  81. </div>
  82. </form>
  83. </div>
  84. </div>
  85. {{if .PageIsEditRelease}}
  86. <div class="ui small basic delete modal">
  87. <div class="ui icon header">
  88. <i class="trash icon"></i>
  89. {{.i18n.Tr "repo.release.deletion"}}
  90. </div>
  91. <div class="content">
  92. <p>{{.i18n.Tr "repo.release.deletion_desc"}}</p>
  93. </div>
  94. {{template "base/delete_modal_actions" .}}
  95. </div>
  96. {{end}}
  97. {{template "base/footer" .}}