diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js index f6f6a88400..60db184339 100644 --- a/src/topics/thumbs.js +++ b/src/topics/thumbs.js @@ -52,6 +52,7 @@ Thumbs.get = async function (tids) { const name = path.basename(thumb); return hasTimestampPrefix.test(name) ? name.slice(14) : name; })(), + path: thumb, url: thumb.startsWith('http') ? thumb : path.posix.join(upload_url, thumb), }))); diff --git a/src/views/modals/topic-thumbs.tpl b/src/views/modals/topic-thumbs.tpl index e7ecd24e13..1329cf7c95 100644 --- a/src/views/modals/topic-thumbs.tpl +++ b/src/views/modals/topic-thumbs.tpl @@ -3,7 +3,7 @@
[[modules:thumbs.modal.no-thumbs]]
{{{ end }}} {{{ each thumbs }}} -
+
diff --git a/test/topics/thumbs.js b/test/topics/thumbs.js index 8486947b76..272d5cac32 100644 --- a/test/topics/thumbs.js +++ b/test/topics/thumbs.js @@ -82,6 +82,7 @@ describe('Topic thumbs', () => { assert.deepStrictEqual(thumbs, [{ id: topicObj.topicData.tid, name: 'test.png', + path: `${relativeThumbPaths[0]}`, url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`, }]); }); @@ -92,6 +93,7 @@ describe('Topic thumbs', () => { [{ id: topicObj.topicData.tid, name: 'test.png', + path: `${relativeThumbPaths[0]}`, url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`, }], [], @@ -200,16 +202,19 @@ describe('Topic thumbs', () => { { id: tid, name: 'test.png', + path: relativeThumbPaths[0], url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`, }, { id: tid, name: 'example.org', + path: 'https://example.org', url: 'https://example.org', }, { id: tid, name: 'test2.png', + path: relativeThumbPaths[1], url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[1]}`, }, ]);