gitea源码

new.tmpl 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content repository new release">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <h2 class="ui dividing header">
  6. {{if .PageIsEditRelease}}
  7. {{ctx.Locale.Tr "repo.release.edit_release"}}
  8. <div class="sub header">{{ctx.Locale.Tr "repo.release.edit_subheader"}}</div>
  9. {{else}}
  10. {{ctx.Locale.Tr "repo.release.new_release"}}
  11. <div class="sub header">{{ctx.Locale.Tr "repo.release.new_subheader"}}</div>
  12. {{end}}
  13. </h2>
  14. {{template "base/alert" .}}
  15. <form class="ui form" action="{{.Link}}" method="post">
  16. {{.CsrfTokenHtml}}
  17. <div class="ui seven wide 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}}" aria-label="{{ctx.Locale.Tr "repo.release.tag_name"}}" placeholder="{{ctx.Locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255">
  23. <input id="tag-name-editor" type="hidden" data-existing-tags="{{JsonUtils.EncodeToString .Tags}}" data-tag-helper="{{ctx.Locale.Tr "repo.release.tag_helper"}}" data-tag-helper-new="{{ctx.Locale.Tr "repo.release.tag_helper_new"}}" data-tag-helper-existing="{{ctx.Locale.Tr "repo.release.tag_helper_existing"}}">
  24. <div id="tag-target-selector" class="tw-inline-block">
  25. <span class="at">@</span>
  26. <div class="ui selection dropdown">
  27. <input type="hidden" name="tag_target" value="{{.tag_target}}">
  28. {{svg "octicon-git-branch"}}
  29. <div class="text">
  30. {{ctx.Locale.Tr "repo.release.target"}} :
  31. <strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong>
  32. </div>
  33. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  34. <div class="menu">
  35. {{range .Branches}}
  36. <div class="item" data-value="{{.}}">{{.}}</div>
  37. {{end}}
  38. </div>
  39. </div>
  40. </div>
  41. <div>
  42. <span id="tag-helper" class="help tw-mt-2 tw-pb-0">{{ctx.Locale.Tr "repo.release.tag_helper"}}</span>
  43. </div>
  44. {{end}}
  45. </div>
  46. </div>
  47. <div class="eleven wide tw-pt-0">
  48. <div class="field {{if .Err_Title}}error{{end}}">
  49. <input name="title" aria-label="{{ctx.Locale.Tr "repo.release.title"}}" placeholder="{{ctx.Locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
  50. </div>
  51. <div class="field">
  52. {{template "shared/combomarkdowneditor" (dict
  53. "MarkdownPreviewInRepo" $.Repository
  54. "MarkdownPreviewMode" "comment"
  55. "TextareaName" "content"
  56. "TextareaContent" .content
  57. "TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message")
  58. "DropzoneParentContainer" "form"
  59. )}}
  60. </div>
  61. {{range .attachments}}
  62. <div class="field flex-text-block" id="attachment-{{.ID}}">
  63. <div class="flex-text-inline tw-flex-1">
  64. <input name="attachment-edit-{{.UUID}}" class="attachment_edit" required value="{{.Name}}">
  65. <input name="attachment-del-{{.UUID}}" type="hidden" value="false">
  66. <span class="ui text grey tw-whitespace-nowrap">{{.Size | FileSize}}</span>
  67. <span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
  68. {{svg "octicon-info"}}
  69. </span>
  70. </div>
  71. <a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}">
  72. {{ctx.Locale.Tr "remove"}}
  73. </a>
  74. </div>
  75. {{end}}
  76. {{if .IsAttachmentEnabled}}
  77. <div class="field">
  78. {{template "repo/upload" .}}
  79. </div>
  80. {{end}}
  81. </div>
  82. <div class="divider"></div>
  83. <div class="ui">
  84. <div>
  85. {{if not .PageIsEditRelease}}
  86. <div class="tag-message field">
  87. <div class="ui checkbox">
  88. <input type="checkbox" name="add_tag_msg">
  89. <label><strong>{{ctx.Locale.Tr "repo.release.add_tag_msg"}}</strong></label>
  90. </div>
  91. </div>
  92. {{else}}
  93. <input type="hidden" name="add_tag_msg" value="false">
  94. {{end}}
  95. <div class="prerelease field">
  96. <div class="ui checkbox">
  97. <input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}>
  98. <label><strong>{{ctx.Locale.Tr "repo.release.prerelease_desc"}}</strong></label>
  99. </div>
  100. </div>
  101. <span class="help">{{ctx.Locale.Tr "repo.release.prerelease_helper"}}</span>
  102. <div class="divider tw-mt-0"></div>
  103. <div class="flex-text-block tw-justify-end">
  104. {{if .PageIsEditRelease}}
  105. <a class="ui small button" href="{{.RepoLink}}/releases">
  106. {{ctx.Locale.Tr "repo.release.cancel"}}
  107. </a>
  108. <a class="ui small red button link-action" data-modal-confirm="#repo-release-delete-modal" data-url="{{$.RepoLink}}/releases/delete?id={{.ID}}">
  109. {{ctx.Locale.Tr "repo.release.delete_release"}}
  110. </a>
  111. {{if .IsDraft}}
  112. <button class="ui small button" type="submit" name="draft" value="1">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
  113. <button class="ui small primary button">{{ctx.Locale.Tr "repo.release.publish"}}</button>
  114. {{else}}
  115. <button class="ui small primary button">{{ctx.Locale.Tr "repo.release.edit_release"}}</button>
  116. {{end}}
  117. {{else}}
  118. {{if .ShowCreateTagOnlyButton}}
  119. <button class="ui small button" name="tag_only" value="1">{{ctx.Locale.Tr "repo.release.add_tag"}}</button>
  120. {{end}}
  121. <button class="ui small button" name="draft" value="1">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
  122. <button class="ui small primary button">{{ctx.Locale.Tr "repo.release.publish"}}</button>
  123. {{end}}
  124. </div>
  125. </div>
  126. </div>
  127. </form>
  128. </div>
  129. </div>
  130. {{if .PageIsEditRelease}}
  131. <div class="ui small modal" id="repo-release-delete-modal">
  132. <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.release.deletion"}}</div>
  133. <div class="content"><p>{{ctx.Locale.Tr "repo.release.deletion_desc"}}</p></div>
  134. {{template "base/modal_actions_confirm" .}}
  135. </div>
  136. {{end}}
  137. {{template "base/footer" .}}