diff options
author | Philip Couling <couling@gmail.com> | 2017-01-15 14:57:00 +0000 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-15 22:57:00 +0800 |
commit | 64375d875b4d46a6081026290da8efd82c84b25f (patch) | |
tree | de35ef6470c9f8762f2dcd1912fc56dc4a499bad /templates/repo | |
parent | dce03c19cb6c0f067a75f04a1bc1e7cb3528c585 (diff) | |
download | gitea-64375d875b4d46a6081026290da8efd82c84b25f.tar.gz gitea-64375d875b4d46a6081026290da8efd82c84b25f.zip |
Attach to release (#673)
* Moved attachaments POST url from /issues/attachments to /attachments
* Implemented attachment upload on release page
* Implemented downloading attachments on the release page
* Added zip and gzip files to default allowed attachments
* Implemented uploading attachments on edit release
* Renamed UploadIssueAttachment to UploadAttachment
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/comment_tab.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/release/list.tmpl | 9 | ||||
-rw-r--r-- | templates/repo/release/new.tmpl | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl index b009060cd1..3af3d8a041 100644 --- a/templates/repo/issue/comment_tab.tmpl +++ b/templates/repo/issue/comment_tab.tmpl @@ -13,5 +13,5 @@ </div> {{if .IsAttachmentEnabled}} <div class="files"></div> - <div class="ui basic button dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/issues/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> + <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> {{end}} diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 4879e04811..c18bc4884d 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -59,6 +59,15 @@ <li> <a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</a> </li> + {{if .Attachments}} + {{range .Attachments}} + <li> + <a target="_blank" rel="noopener" href="{{AppSubUrl}}/attachments/{{.UUID}}"> + <span class="ui image octicon octicon-desktop-download" title='{{.Name}}'></span> {{.Name}} + </a> + </li> + {{end}} + {{end}} </ul> </div> {{else}} diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index 3a9e6fadd8..5f82cf2f52 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -48,6 +48,10 @@ <label>{{.i18n.Tr "repo.release.content"}}</label> <textarea name="content">{{.content}}</textarea> </div> + {{if .IsAttachmentEnabled}} + <div class="files"></div> + <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> + {{end}} </div> <div class="ui container"> <div class="ui divider"></div> |