diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 70a3f958..f377704b 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -384,6 +384,8 @@ TORRENT_RATING_SUCCESSFULLY: 'Rating torrent successfully', TORRENT_RATING_FAILED: 'Rating torrent failed', EDIT_THIS_OVERVIEW: 'Edit this overview', + EDIT_THIS_SCREENSHOTS: 'Edit screenshots', + SAVE_THIS_SCREENSHOTS: 'Save screenshots', VIEW_ORIGINAL_MEDIA_INFO: 'View original media info', VIEW_FORMATTED_MEDIA_INFO: 'View formatted media info', EDIT_THIS_MEDIA_INFO: 'Edit media info', diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js index bfc8d591..450cb1d5 100644 --- a/modules/core/client/app/trans-string-zh-tw.js +++ b/modules/core/client/app/trans-string-zh-tw.js @@ -384,6 +384,8 @@ TORRENT_RATING_SUCCESSFULLY: '為種子投票成功', TORRENT_RATING_FAILED: '為種子投票失敗', EDIT_THIS_OVERVIEW: '編輯詳情介紹', + EDIT_THIS_SCREENSHOTS: '編輯資源截圖', + SAVE_THIS_SCREENSHOTS: '保存資源截圖', VIEW_ORIGINAL_MEDIA_INFO: '查看原始的媒體信息', VIEW_FORMATTED_MEDIA_INFO: '查看格式化的媒體信息', EDIT_THIS_MEDIA_INFO: '編輯媒體信息', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 61eacd9c..b161637e 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -384,6 +384,8 @@ TORRENT_RATING_SUCCESSFULLY: '为种子投票成功', TORRENT_RATING_FAILED: '为种子投票失败', EDIT_THIS_OVERVIEW: '编辑详情介绍', + EDIT_THIS_SCREENSHOTS: '编辑资源截图', + SAVE_THIS_SCREENSHOTS: '保存资源截图', VIEW_ORIGINAL_MEDIA_INFO: '查看原始的媒体信息', VIEW_FORMATTED_MEDIA_INFO: '查看格式化的媒体信息', EDIT_THIS_MEDIA_INFO: '编辑媒体信息', diff --git a/modules/core/client/directives/mt-images-uploader.client.directive.js b/modules/core/client/directives/mt-images-uploader.client.directive.js index c05855fb..07cc07b6 100644 --- a/modules/core/client/directives/mt-images-uploader.client.directive.js +++ b/modules/core/client/directives/mt-images-uploader.client.directive.js @@ -58,6 +58,7 @@ //define method called from parent scope //init all variable scope.$parent.clearResourceImages = function () { + scope.ngModel = []; initVariable(); }; scope.$parent.$parent.clearResourceImages = scope.$parent.clearResourceImages; @@ -69,10 +70,9 @@ * initVariable */ function initVariable() { - scope.ngModel = []; scope.uFile = undefined; scope.uProgress = 0; - scope.uResourceImages = []; + scope.uResourceImages = angular.copy(scope.ngModel); } /** diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index a0effe67..4f44be70 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -1483,6 +1483,78 @@ }); }; + /** + * beginEditScreenshots + */ + vm.beginEditScreenshots = function () { + vm.isEditScreenshots = true; + + var imgDiv = angular.element('.torrent-img-list'); + if (imgDiv) { + imgDiv.css('display', 'none'); + } + }; + + /** + * beginSaveScreenshots + */ + vm.beginSaveScreenshots = function () { + TorrentsService.update({ + _id: vm.torrentLocalInfo._id, + screenshots_image: vm.torrentLocalInfo.screenshots_image + }, function (response) { + successCallback(response); + }, function (errorResponse) { + errorCallback(errorResponse); + }); + + function successCallback(res) { + vm.torrentLocalInfo = res; + vm.isEditScreenshots = false; + Notification.success({ + message: ' ' + $translate.instant('TORRENT_UPDATE_SUCCESSFULLY') + }); + } + + function errorCallback(res) { + vm.error_msg = res.data.message; + vm.isEditScreenshots = false; + Notification.error({ + message: res.data.message, + title: ' ' + $translate.instant('TORRENT_UPDATE_ERROR') + }); + } + + }; + + /** + * uploadTorrentScreenshotsImage + * @param ufile + * @param progressback + * @param callback + * @param errback + */ + vm.uploadTorrentScreenshotsImage = function (ufile, progressback, callback, errback) { + Upload.upload({ + url: '/api/torrents/uploadTorrentImage', + data: { + newTorrentImageFile: ufile + } + }).then(function (res) { + if (callback) { + callback(res.data.filename); + } + }, function (res) { + if (errback && res.status > 0) { + errback(res); + } + }, function (evt) { + if (progressback) { + progressback(parseInt(100.0 * evt.loaded / evt.total, 10)); + } + }); + }; + /** * buildPeersPager */ diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index e32c3906..5bb6cebc 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -150,7 +150,7 @@ color: #666; background-color: #fafafa; border-top: 1px dashed #ddd; - overflow-x: scroll; + overflow-x: auto; .image-item { position: relative; display: table-cell; @@ -211,8 +211,8 @@ .film-strip { border-top: solid 26px; border-bottom: solid 26px; - border-left: none; - border-right: none; + border-left: solid 0 transparent; + border-right: solid 0 transparent; border-image: url("/modules/torrents/client/img/film-strip-back.png") 42 30; border-image-repeat: repeat; background-color: #2a2a2a; diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index b0ffc44a..25a387eb 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -215,9 +215,30 @@ -