diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-03-23 00:09:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 00:09:51 +0800 |
commit | 8567cba0d978e6ab68c337c0a80244704a15718a (patch) | |
tree | db8794db6a32057adadda9460bf5923aee9ae89f /templates | |
parent | 1a03fa7a4f353eb2f965cdcac39f630c281eca1e (diff) | |
download | gitea-8567cba0d978e6ab68c337c0a80244704a15718a.tar.gz gitea-8567cba0d978e6ab68c337c0a80244704a15718a.zip |
Implement delete release attachments and update release attachments' name (#14130)
* Implement delete release attachment
* Add attachments on release edit page
* Fix bug
* Finish del release attachments
* Fix frontend lint
* Fix tests
* Support edit release attachments
* Added tests
* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag
* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease
* Fix middle align
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/release/list.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/release/new.tmpl | 17 |
2 files changed, 22 insertions, 3 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 5271f650ee..72a69a756a 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -152,12 +152,14 @@ {{if .Attachments}} {{range .Attachments}} <li> - <span class="ui text right poping up" data-content="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}"> - {{svg "octicon-info"}} + <span class="ui text middle aligned right"> + <span class="ui text grey">{{.Size | FileSize}}</span> + <span class="poping up" data-content="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}"> + {{svg "octicon-info"}} + </span> </span> <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}"> <strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16 "mr-2"}}</span>{{.Name}}</strong> - <span class="ui text grey right">{{.Size | FileSize}}</span> </a> </li> {{end}} diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 485cc7138a..8489d89597 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -57,6 +57,23 @@ {{$.i18n.Tr "loading"}} </div> </div> + {{range .attachments}} + <div class="field" id="attachment-{{.ID}}"> + <div class="ui right df ac wrap_remove"> + <a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}"> + {{$.i18n.Tr "remove"}} + </a> + </div> + <div class="df ac"> + <input name="attachment-edit-{{.UUID}}" class="mr-3 attachment_edit" required value="{{.Name}}"/> + <input name="attachment-del-{{.UUID}}" type="hidden" value="false"/> + <span class="ui text grey mr-3">{{.Size | FileSize}}</span> + <span class="poping up" data-content="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}"> + {{svg "octicon-info"}} + </span> + </div> + </div> + {{end}} {{if .IsAttachmentEnabled}} <div class="field"> <div class="files"></div> |