From b7b295b2dbe30710429201a13ae5e16e1165e619 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 30 May 2018 20:59:25 +0800 Subject: [PATCH] feat(torrents): show resource screenshots image on torrent detail page --- .../torrent-info.client.controller.js | 2 +- modules/torrents/client/less/torrents.less | 2 +- .../services/torrent-get-info.client.service.js | 7 +++++++ .../client/views/view-torrent.client.view.html | 16 ++++++++-------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index a0effe67..9c33a514 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -1317,7 +1317,7 @@ * @returns {*} */ vm.getOverviewMarkedContent = function (c) { - return marked(c, {sanitize: true}); + return marked(c, {sanitize: false}); }; /** diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index d6cb6faa..edf184a3 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -112,7 +112,7 @@ .img-container { display: none; - margin-top: 30px; + margin-top: 10px; @media (min-width: @screen-md) { margin-left: 60px; } diff --git a/modules/torrents/client/services/torrent-get-info.client.service.js b/modules/torrents/client/services/torrent-get-info.client.service.js index e8775fea..8e2923f8 100644 --- a/modules/torrents/client/services/torrent-get-info.client.service.js +++ b/modules/torrents/client/services/torrent-get-info.client.service.js @@ -307,6 +307,13 @@ if (item && item.resource_detail_info) { result = item.resource_detail_info.overview || item.resource_detail_info.detail || null; + + if (item.screenshots_image && item.screenshots_image.length > 0) { + angular.forEach(item.screenshots_image, function (si) { + var str = '
![' + si + '](' + si + ')'; + result += str; + }); + } } return result; } diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index bccf858e..44d5db77 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -178,10 +178,10 @@
{{ 'TMDB_FIELDS.OVERVIEW' | translate}}:
-
- {{vm.TGI.getTorrentOverview(vm.torrentLocalInfo)}} -
-
+ + + +
@@ -201,10 +201,6 @@
-
- -
-
@@ -222,6 +218,10 @@
+ +
+ +