From 54a0735e99045790bd933ee65b9845ede2ebcc9e Mon Sep 17 00:00:00 2001 From: OldHawk Date: Tue, 3 Oct 2017 17:25:05 +0800 Subject: [PATCH] feat(core): list music top list and newest in home page --- modules/core/client/app/trans-string-en.js | 1 + modules/core/client/app/trans-string-zh.js | 1 + .../controllers/home.client.controller.js | 2 +- .../directives/music-disk.client.directive.js | 4 +- modules/core/client/less/mt.less | 35 +++++- .../core/client/views/home.client.view.html | 117 ++++++++++++++++++ .../views/view-torrent.client.view.html | 2 +- 7 files changed, 158 insertions(+), 4 deletions(-) diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 00d83174..2f8e95da 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -65,6 +65,7 @@ TOP_MOVIE_INFO_ERROR: 'Get movie top info failed', NEWEST_MOVIE_LIST: 'Newest Movie Torrents', NEWEST_TV_LIST: 'Newest TV Serial Torrents', + NEWEST_MUSIC_LIST: 'Newest Music Torrents', //element title/alt TITLE_ALT: { diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 9db3cadc..21538e86 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -65,6 +65,7 @@ TOP_MOVIE_INFO_ERROR: '获取电影Top列表失败', NEWEST_MOVIE_LIST: '最新电影种子', NEWEST_TV_LIST: '最新电视剧种子', + NEWEST_MUSIC_LIST: '最新音乐种子', //element title/alt TITLE_ALT: { diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index d5322477..59bced17 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -222,7 +222,7 @@ torrent_status: 'reviewed', torrent_type: 'music', newest: true, - limit: 14 + limit: 13 }, function (items) { if (items.rows.length > 0) { vm.musicNewList = items.rows; diff --git a/modules/core/client/directives/music-disk.client.directive.js b/modules/core/client/directives/music-disk.client.directive.js index a8911125..f60852ba 100644 --- a/modules/core/client/directives/music-disk.client.directive.js +++ b/modules/core/client/directives/music-disk.client.directive.js @@ -31,7 +31,9 @@ if (attrs.src) { cir2.css('background-image', 'url(' + attrs.src + ')'); } - cir2.css('background-size', '100% 100%'); + cir2.css('background-size', 'cover'); + cir2.css('background-position', 'center'); + cir2.css('background-repeat', 'no-repeat'); cir2.css('height', '100%'); cir2.css('width', '100%'); cir2.css('padding', '36%'); diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index 3c4a2c07..1f3c903a 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -207,7 +207,7 @@ body { } } .music { - margin: 35px 0; + margin: 38px 0 42px 0; overflow: hidden; opacity: 0.8; &::before { @@ -438,6 +438,9 @@ body { } .newest-item-big { position: relative; + &.music-margin { + padding: 30px 0 33px 0 !important; + } img { width: 100%; } @@ -481,6 +484,36 @@ body { .se-info { right: 5px; } + .music { + max-width: 80px; + overflow: hidden; + &::before { + content: ' '; + padding-top: 100%; /* vertical value as 100% equals width */ + float: left; + } + div { + overflow: hidden; + &::before { + content: ' '; + padding-top: 100%; /* vertical value as 100% equals width */ + float: left; + } + } + } + .music-info { + position: absolute; + top: 0; + right: 0; + left: 90px; + height: 100%; + font-size: 12px; + >div { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + } } .se-info { position: absolute; diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 64a0717a..005a7174 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -473,6 +473,123 @@ + +
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
{{'NEWEST_MUSIC_LIST' | translate}}
+ + + + +
+
+ {{vm.TGI.getTorrentTitle(nm)}} + +
+
+
{{nm.resource_detail_info.artist}}
+
{{nm.resource_detail_info.subtitle}}
+
+
+ + + +
+
+ {{$index + 1}}. {{nm.resource_detail_info.title}} +
+
+
+ +
+ {{$index + 1}}. {{nm.resource_detail_info.title}} +
+
+
+
+
+
+
+
+
-
+
{{ 'TMDB_FIELDS.VOTE_AVERAGE' | translate}}: