|
|
@ -48,22 +48,23 @@ |
|
|
|
<label>{{.i18n.Tr "repo.release.content"}}</label> |
|
|
|
<label>{{.i18n.Tr "repo.release.content"}}</label> |
|
|
|
<textarea name="content">{{.content}}</textarea> |
|
|
|
<textarea name="content">{{.content}}</textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{{if .attachments}} |
|
|
|
<div class="field"> |
|
|
|
<table class="ui table"> |
|
|
|
{{if .attachments}} |
|
|
|
<thead></thead> |
|
|
|
<table class="ui table"> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
{{range .attachments}} |
|
|
|
{{range .attachments}} |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}" rel="nofollow">{{.Name}}</a> |
|
|
|
<a target="_blank" href="{{AppSubUrl}}/attachments/{{.UUID}}" rel="nofollow">{{.Name}}</a> |
|
|
|
<a class="ui text red right delete-attachment-button" href="#"><i class="octicon octicon-x" data-uuid="{{.UUID}}"></i></a> |
|
|
|
<a class="ui text red right delete-attachment-button" href="#"><i class="octicon octicon-x" data-uuid="{{.UUID}}"></i></a> |
|
|
|
<input name="files" type="hidden" value="{{.UUID}}"> |
|
|
|
<input name="files" type="hidden" value="{{.UUID}}"> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
|
|
|
|
</div> |
|
|
|
{{if .IsAttachmentEnabled}} |
|
|
|
{{if .IsAttachmentEnabled}} |
|
|
|
<div class="files"></div> |
|
|
|
<div class="files"></div> |
|
|
|
<div class="ui basic button dropzone" id="dropzone" data-upload-url="{{AppSubUrl}}/releases/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}}/releases/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> |
|
|
@ -122,9 +123,18 @@ |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
// Delete attachment field |
|
|
|
// Delete attachment row |
|
|
|
$('.delete-attachment-button').click(function (e) { |
|
|
|
$('.delete-attachment-button').click(function (e) { |
|
|
|
$(this).parentsUntil('tbody').remove(); |
|
|
|
var $row = $(this).parentsUntil('tbody'); |
|
|
|
|
|
|
|
var $tbody = $row.parentsUntil('table'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$row.remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove the entire table if this was the last row |
|
|
|
|
|
|
|
if ($tbody.children().length == 0) { |
|
|
|
|
|
|
|
$tbody.parentsUntil('.field').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|