diff options
author | bobemoe <inbox.github@jhodges.co.uk> | 2020-12-13 19:12:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 21:12:27 +0200 |
commit | b35c1b5784b99fa71d0ea3ddf8ac253dc44c0d82 (patch) | |
tree | 696671b9bc38427fa0fcc30cc3adcc990854b169 /web_src | |
parent | 825efa2605421a54ad1c5960de9e121a34d68d1a (diff) | |
download | gitea-b35c1b5784b99fa71d0ea3ddf8ac253dc44c0d82.tar.gz gitea-b35c1b5784b99fa71d0ea3ddf8ac253dc44c0d82.zip |
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>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/index.js | 7 | ||||
-rw-r--r-- | web_src/less/_repository.less | 46 |
2 files changed, 5 insertions, 48 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index 55cf08cb61..d4928a01a3 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -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'); diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 8876dcdcb0..b35718c29d 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1016,50 +1016,10 @@ font-style: italic; } - > .bottom.segment { - background: var(--color-box-body); - - .ui.images::after { - clear: both; - content: ' '; - display: block; - } - - a { - display: block; - float: left; - margin: 5px; - padding: 5px; - height: 150px; - border: solid 1px var(--color-secondary); - border-radius: 3px; - max-width: 150px; - background-color: var(--color-body); - - &::before { - content: ' '; - display: inline-block; - height: 100%; - vertical-align: middle; - } - } - - .ui.image { - max-height: 100%; - width: auto; - margin: 0; - vertical-align: middle; - } - - span.ui.image { - font-size: 128px; - color: var(--color-text); - } - - span.ui.image:hover { - color: var(--color-text); - } + .dropzone-attachments .thumbnails .ui.image { + max-height: 150px; } + } .ui.form { |