summaryrefslogtreecommitdiffstats
path: root/templates/repo/release
diff options
context:
space:
mode:
authorPhilip Couling <couling@gmail.com>2017-01-15 14:57:00 +0000
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-15 22:57:00 +0800
commit64375d875b4d46a6081026290da8efd82c84b25f (patch)
treede35ef6470c9f8762f2dcd1912fc56dc4a499bad /templates/repo/release
parentdce03c19cb6c0f067a75f04a1bc1e7cb3528c585 (diff)
downloadgitea-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/release')
-rw-r--r--templates/repo/release/list.tmpl9
-rw-r--r--templates/repo/release/new.tmpl4
2 files changed, 13 insertions, 0 deletions
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>