diff --git a/modules/core/client/app/trans-string-cn.js b/modules/core/client/app/trans-string-cn.js
index ae900430..88714911 100644
--- a/modules/core/client/app/trans-string-cn.js
+++ b/modules/core/client/app/trans-string-cn.js
@@ -63,6 +63,9 @@
TITLE_FINISHED: '完成下载数',
TITLE_IMDB_VOTES: 'IMDB 评分',
+ //TorrentsController & views
+ MOVIE_PAGE_INFO_ERROR: '获取电影分页列表失败',
+
//TorrentsUploadsController
TORRENTS_UPLOAD_SUCCESSFULLY: '文件上传成功',
TORRENTS_UPLOAD_FAILED: '文件上传失败',
diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js
index 71dafe30..eeda78c0 100644
--- a/modules/core/client/app/trans-string-en.js
+++ b/modules/core/client/app/trans-string-en.js
@@ -63,6 +63,9 @@
TITLE_FINISHED: 'Finished users',
TITLE_IMDB_VOTES: 'IMDB Votes',
+ //TorrentsController & views
+ MOVIE_PAGE_INFO_ERROR: 'Get movie page info faild',
+
//TorrentsUploadsController & views
TORRENTS_UPLOAD_SUCCESSFULLY: 'Successfully uploads file',
TORRENTS_UPLOAD_FAILED: 'Failed to uploads file',
diff --git a/modules/core/client/less/margin.less b/modules/core/client/less/margin.less
new file mode 100644
index 00000000..5ed5ee03
--- /dev/null
+++ b/modules/core/client/less/margin.less
@@ -0,0 +1,80 @@
+.margin-top-10 {
+ margin-top: 10px;
+}
+
+.margin-top-20 {
+ margin-top: 20px;
+}
+
+.margin-top-30 {
+ margin-top: 30px;
+}
+
+.margin-top-40 {
+ margin-top: 40px;
+}
+
+.margin-top-50 {
+ margin-top: 50px;
+}
+
+.margin-bottom-10 {
+ margin-bottom: 10px;
+}
+
+.margin-bottom-20 {
+ margin-bottom: 20px;
+}
+
+.margin-bottom-30 {
+ margin-bottom: 30px;
+}
+
+.margin-bottom-40 {
+ margin-bottom: 40px;
+}
+
+.margin-bottom-50 {
+ margin-bottom: 50px;
+}
+
+.padding-top-10 {
+ padding-top: 10px;
+}
+
+.padding-top-20 {
+ padding-top: 20px;
+}
+
+.padding-top-30 {
+ padding-top: 30px;
+}
+
+.padding-top-40 {
+ padding-top: 40px;
+}
+
+.padding-top-50 {
+ padding-top: 50px;
+}
+
+.padding-bottom-10 {
+ padding-bottom: 10px;
+}
+
+.padding-bottom-20 {
+ padding-bottom: 20px;
+}
+
+.padding-bottom-30 {
+ padding-bottom: 30px;
+}
+
+.padding-bottom-40 {
+ padding-bottom: 40px;
+}
+
+.padding-bottom-50 {
+ padding-bottom: 50px;
+}
+
diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less
index 1e7f2a40..49c74f03 100644
--- a/modules/core/client/less/mt.less
+++ b/modules/core/client/less/mt.less
@@ -1,3 +1,5 @@
+@import (reference) "../../../../public/lib/bootstrap/less/variables.less";
+
.bodysize {
background-color: #fff;
min-height: 600px;
@@ -59,9 +61,10 @@
}
}
-.post-info-img {
+.torrent-post-info {
cursor: pointer;
&:hover {
+ background-color: #efefef;
background-color: rgba(224, 224, 224, .3);
}
> img {
@@ -121,4 +124,15 @@
.torrent-finished {
color: #33FFFF;
}
+
+ &.small-info {
+ @media (min-width: @screen-md-min) {
+ padding: 5px 0;
+ font-size: 12px;
+ .list-inline > li {
+ padding-left: 1px;
+ padding-right: 1px;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html
index 7c48a297..f96358d8 100644
--- a/modules/core/client/views/home.client.view.html
+++ b/modules/core/client/views/home.client.view.html
@@ -50,7 +50,9 @@
{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}:
- IMDB {{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}
+ IMDB {{vm.movieinfo.vote_average}} / {{vm.movieinfo.vote_count}} {{ 'TMDB_FIELDS.VOTE_UNIT' | translate}}
+
@@ -133,16 +135,18 @@
-
+
- - 356
- - 24
+ - {{item.torrent_seeds}}
+ - {{item.torrent_leechers}}
- 1622
+ class="glyphicon glyphicon-ok torrent-finished">{{item.torrent_finished}}
@@ -150,8 +154,9 @@
-
{{item.torrent_title}}
-
- {{item.torrent_release}}IMDB {{item.torrent_imdb_votes}}
+ - {{item.torrent_release}}
+ IMDB {{item.torrent_imdb_votes}}
diff --git a/modules/torrents/client/config/torrents.client.routes.js b/modules/torrents/client/config/torrents.client.routes.js
index 3b227077..eddba17a 100644
--- a/modules/torrents/client/config/torrents.client.routes.js
+++ b/modules/torrents/client/config/torrents.client.routes.js
@@ -14,6 +14,10 @@
url: '/torrents',
template: '
'
})
+ .state('torrents.movie', {
+ url: '/torrents/movie',
+ templateUrl: '/modules/torrents/client/views/movie-list.client.view.html'
+ })
.state('torrents.uploads', {
url: '/torrents/uploads',
templateUrl: '/modules/torrents/client/views/uploads-torrents.client.view.html'
diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js
new file mode 100644
index 00000000..fbc613d8
--- /dev/null
+++ b/modules/torrents/client/controllers/torrents.client.controller.js
@@ -0,0 +1,48 @@
+(function () {
+ 'use strict';
+
+ angular
+ .module('torrents')
+ .controller('TorrentsController', TorrentsController);
+
+ TorrentsController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'Notification', 'TorrentsService', 'TMDBConfig'];
+
+ function TorrentsController($scope, $state, $translate, Authentication, Notification, TorrentsService, TMDBConfig) {
+ var vm = this;
+ vm.user = Authentication.user;
+ vm.tmdbConfig = TMDBConfig.tmdbConfig;
+ vm.topNumber = 6;
+ vm.pageNumber = 50;
+
+ // If user is not signed in then redirect back home
+ if (!Authentication.user) {
+ $state.go('authentication.signin');
+ }
+
+ vm.getMovieTopInfo = function () {
+ TorrentsService.query({
+ limit: vm.topNumber
+ }, function (items) {
+ vm.movieTopInfo = items;
+ }, function (err) {
+ Notification.error({
+ message: '
' + $translate.instant('TOP_MOVIE_INFO_ERROR')
+ });
+ });
+ };
+
+ vm.getMoviePageInfo = function (p) {
+ TorrentsService.query({
+ skip: (p - 1) * vm.pageNumber + vm.topNumber,
+ limit: p * vm.pageNumber
+ }, function (items) {
+ vm.moviesPageInfo = items;
+ }, function (err) {
+ Notification.error({
+ message: '
' + $translate.instant('MOVIE_PAGE_INFO_ERROR')
+ });
+ });
+
+ };
+ }
+}());
diff --git a/modules/torrents/client/views/movie-list.client.view.html b/modules/torrents/client/views/movie-list.client.view.html
new file mode 100644
index 00000000..e1ee37cd
--- /dev/null
+++ b/modules/torrents/client/views/movie-list.client.view.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
![{{item.torrent_title}}]()
+
+
+
+
+
+ -
+ {{item.torrent_title}}
+
- {{item.torrent_release}}
+ IMDB {{item.torrent_imdb_votes}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js
index ef783d68..092589e0 100644
--- a/modules/torrents/server/controllers/torrents.server.controller.js
+++ b/modules/torrents/server/controllers/torrents.server.controller.js
@@ -263,6 +263,9 @@ exports.list = function (req, res) {
if (req.query.limit !== undefined) {
limit = req.query.limit;
}
+ if (req.query.status !== undefined) {
+ status = req.query.status;
+ }
Torrent.find({'torrent_status': status}).sort('-createdat').populate('user', 'displayName').skip(skip).limit(limit).exec(function (err, torrents) {
if (err) {