From 9c365243f5578bb0d6fe50e2dcbe2ea8ad68bac4 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 6 Apr 2017 09:46:11 +0800 Subject: [PATCH] add movie keyword on search panel --- modules/core/client/app/trans-string-cn.js | 3 ++ modules/core/client/app/trans-string-en.js | 2 ++ modules/core/client/less/mt.less | 11 +++++-- .../core/client/views/home.client.view.html | 2 +- .../controllers/torrents.client.controller.js | 8 +++-- .../client/views/movie-list.client.view.html | 10 ++++++- .../controllers/torrents.server.controller.js | 30 +++++++++++++------ 7 files changed, 50 insertions(+), 16 deletions(-) diff --git a/modules/core/client/app/trans-string-cn.js b/modules/core/client/app/trans-string-cn.js index 8c42e5f2..21bbb022 100644 --- a/modules/core/client/app/trans-string-cn.js +++ b/modules/core/client/app/trans-string-cn.js @@ -72,6 +72,7 @@ INFO: '种子信息', SIZE: '大小', SEEDS_LEECHERS_FINISHED: '做种/下载/完成', + PUBLISHER: 'Publisher', LIFETIME: '存活时间', VOTES: '评分' }, @@ -79,6 +80,8 @@ //TorrentsController & views MOVIE_PAGE_INFO_ERROR: '获取电影分页列表失败', TAGS_SEARCH: '电影 - 标签检索', + CA_KEYWORD: '关键字', + PH_KEYWORD: '搜索关键字', //TorrentsUploadsController TORRENTS_UPLOAD_SUCCESSFULLY: '文件上传成功', diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 6f8bb388..31170ac6 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -80,6 +80,8 @@ //TorrentsController & views MOVIE_PAGE_INFO_ERROR: 'Get movie page info faild', TAGS_SEARCH: 'Movie - Tags Search', + CA_KEYWORD: 'Keyword', + PH_KEYWORD: 'Search keyword', //TorrentsUploadsController & views TORRENTS_UPLOAD_SUCCESSFULLY: 'Successfully uploads file', diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index 651bda45..9b22dab5 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -177,10 +177,10 @@ > .td-text-overflow { .text-long { @media (min-width: @screen-lg-min) { - max-width: 620px; + max-width: 600px; } @media (max-width: @screen-lg-min) { - max-width: 500px; + max-width: 580px; } white-space: nowrap; overflow: hidden; @@ -206,6 +206,13 @@ font-weight: normal; display: inline-block; } + .label-tag { + color: #0366d6; + background-color: #f1f8ff; + &:hover { + color: #f00; + } + } } .list-all-genres { .genres-item:not(:first-child) { diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 9c98d156..99cffde4 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -125,7 +125,7 @@
- +
diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index f367837c..32ad9b46 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -36,8 +36,10 @@ vm.getMoviePageInfo = function (p) { TorrentsService.query({ - skip: (p - 1) * vm.pageNumber + 0, - limit: p * vm.pageNumber + skip: (p - 1) * vm.pageNumber + vm.topNumber, + limit: p * vm.pageNumber, + torrent_status: 'reviewed', + torrent_type: 'movie' }, function (items) { vm.moviePageInfo = items; console.log(items); @@ -60,7 +62,7 @@ }); }); - if(!find){ + if (!find) { angular.forEach(vm.resourcesTags.movie.checkbox, function (item) { angular.forEach(item.value, function (sitem) { if (sitem.name === tag) { diff --git a/modules/torrents/client/views/movie-list.client.view.html b/modules/torrents/client/views/movie-list.client.view.html index 23bbf507..1b169a0b 100644 --- a/modules/torrents/client/views/movie-list.client.view.html +++ b/modules/torrents/client/views/movie-list.client.view.html @@ -39,6 +39,14 @@
+
{{ 'CA_KEYWORD' | translate}}:
+
+
+
+ +
+
+
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
@@ -109,7 +117,7 @@ {{ item.torrent_release}} - {{ 'RESOURCESTAGS.' + vm.getTagTitle(t) + '.' + t | translate}} + {{ 'RESOURCESTAGS.' + vm.getTagTitle(t) + '.' + t | translate}}
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 092589e0..925faf2a 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -256,6 +256,7 @@ exports.list = function (req, res) { var skip = 0; var limit = 0; var status = 'reviewed'; + var stype = 'movie'; if (req.query.skip !== undefined) { skip = req.query.skip; @@ -266,16 +267,27 @@ exports.list = function (req, res) { if (req.query.status !== undefined) { status = req.query.status; } + if (req.query.stype !== undefined) { + stype = req.query.stype; + } - Torrent.find({'torrent_status': status}).sort('-createdat').populate('user', 'displayName').skip(skip).limit(limit).exec(function (err, torrents) { - if (err) { - return res.status(422).send({ - message: errorHandler.getErrorMessage(err) - }); - } else { - res.json(torrents); - } - }); + Torrent.find({ + 'torrent_status': status, + 'torrent_type': stype + }) + .sort('-createdat') + .populate('user', 'displayName') + .skip(skip) + .limit(limit) + .exec(function (err, torrents) { + if (err) { + return res.status(422).send({ + message: errorHandler.getErrorMessage(err) + }); + } else { + res.json(torrents); + } + }); }; /**