本站源代码
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

110 lines
4.3KB

  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 stackable 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. {{if .IsAttachmentEnabled}}
  52. <div class="files"></div>
  53. <div class="ui basic button dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/attachments" data-accepts="{{.AttachmentAllowedTypes}}" data-max-file="{{.AttachmentMaxFiles}}" data-max-size="{{.AttachmentMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div>
  54. {{end}}
  55. </div>
  56. <div class="ui container">
  57. <div class="ui divider"></div>
  58. <div class="ui text right">
  59. <div class="prerelease field">
  60. <div class="ui checkbox">
  61. <input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}>
  62. <label><strong>{{.i18n.Tr "repo.release.prerelease_desc"}}</strong></label>
  63. </div>
  64. </div>
  65. <span class="help">{{.i18n.Tr "repo.release.prerelease_helper"}}</span>
  66. <div class="field">
  67. {{if .PageIsEditRelease}}
  68. <a class="ui blue basic button" href="{{.RepoLink}}/releases">
  69. {{.i18n.Tr "repo.release.cancel"}}
  70. </a>
  71. {{if .IsDraft}}
  72. <input class="ui grey button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/>
  73. <button class="ui green button">
  74. {{.i18n.Tr "repo.release.publish"}}
  75. </button>
  76. {{else}}
  77. <button class="ui green button">
  78. {{.i18n.Tr "repo.release.edit_release"}}
  79. </button>
  80. {{end}}
  81. <a class="ui red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
  82. {{$.i18n.Tr "repo.release.delete_release"}}
  83. </a>
  84. {{else}}
  85. <button class="ui green button">
  86. {{.i18n.Tr "repo.release.publish"}}
  87. </button>
  88. <input class="ui grey button" type="submit" name="draft" value="{{.i18n.Tr "repo.release.save_draft"}}"/>
  89. {{end}}
  90. </div>
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. {{if .PageIsEditRelease}}
  97. <div class="ui small basic delete modal">
  98. <div class="ui icon header">
  99. <i class="trash icon"></i>
  100. {{.i18n.Tr "repo.release.deletion"}}
  101. </div>
  102. <div class="content">
  103. <p>{{.i18n.Tr "repo.release.deletion_desc"}}</p>
  104. </div>
  105. {{template "base/delete_modal_actions" .}}
  106. </div>
  107. {{end}}
  108. {{template "base/footer" .}}
上海开阖软件有限公司 沪ICP备12045867号-1