add thumbnail preview section to issue attachments (#13826)
* add thumbnail preview section to attachments * dont show thumbnail if the image is already shown inline * update router to pass the `content` to the attachemnts template * limit attachment preview height to 150px (same as width) * remove unused css (referance removed in https://github.com/go-gitea/gitea/pull/11141/files#diff-9faae32445ed9673de2830c9fc35e93f44487f0a0068202988adaf00a5bac850L66 ) * dont show divider after edit if no attachemnts Co-authored-by: James <inbox.dev@jhodges.co.uk> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
825efa2605
commit
b35c1b5784
6 changed files with 56 additions and 81 deletions
|
@ -1048,17 +1048,14 @@ async function initRepository() {
|
|||
if (data.attachments !== '') {
|
||||
$content.append(`
|
||||
<div class="dropzone-attachments">
|
||||
<div class="ui clearing divider"></div>
|
||||
<div class="ui middle aligned padded grid">
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
$content.find('.dropzone-attachments .grid').html(data.attachments);
|
||||
$content.find('.dropzone-attachments').replaceWith(data.attachments);
|
||||
}
|
||||
} else if (data.attachments === '') {
|
||||
$content.find('.dropzone-attachments').remove();
|
||||
} else {
|
||||
$content.find('.dropzone-attachments .grid').html(data.attachments);
|
||||
$content.find('.dropzone-attachments').replaceWith(data.attachments);
|
||||
}
|
||||
if (dz) {
|
||||
dz.emit('submit');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue