From 777cb52ae2564808bd7b3aaf9ae91fb8d560e382 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 4 May 2017 10:32:37 +0800 Subject: [PATCH] load ranking data finished --- modules/core/client/app/trans-string-cn.js | 10 +- modules/core/client/app/trans-string-en.js | 12 +- modules/core/client/less/mt.less | 76 +++++-- .../controllers/ranking.client.controller.js | 11 +- .../client/views/ranking.client.view.html | 193 ++++++++++++++---- .../views/view-torrent.client.view.html | 20 +- 6 files changed, 258 insertions(+), 64 deletions(-) diff --git a/modules/core/client/app/trans-string-cn.js b/modules/core/client/app/trans-string-cn.js index eff13e81..7e007f34 100644 --- a/modules/core/client/app/trans-string-cn.js +++ b/modules/core/client/app/trans-string-cn.js @@ -89,7 +89,15 @@ STARTED: '开始时间', ACTIVE: '活动状态', CLIENT: '客户端', - CONNECTABLE: '可连接' + CONNECTABLE: '可连接', + + //ranking + UPLOAD: '已上传', + DOWNLOAD: '已下载', + SEEDED: '正在做种', + LEECHED: '正在下载', + SCORE: '积分', + JOINED: '加入时间' }, //page title diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index e6152a39..91f8c0c0 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -81,7 +81,7 @@ VOTES: 'Votes', //peer - USERNAME: 'Username', + USERNAME: 'DisplayName', UPLOADED: 'Uploaded/Speed', DOWNLOADED: 'Downloaded/Speed', RATIO: 'Ratio', @@ -89,7 +89,15 @@ STARTED: 'Started', ACTIVE: 'Active', CLIENT: 'Client', - CONNECTABLE: 'Connectable' + CONNECTABLE: 'Connectable', + + //ranking + UPLOAD: 'Uploaded', + DOWNLOAD: 'Downloaded', + SEEDED: 'Seeded', + LEECHED: 'Leeched', + SCORE: 'Score', + JOINED: 'Joined' }, //page title diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index bc9405ca..1324ab5a 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -224,6 +224,16 @@ } } +.table-valign-middle { + > tbody { + > tr { + > td { + vertical-align: middle; + } + } + } +} + .tb-peers { background-color: #fff; thead { @@ -359,24 +369,51 @@ padding-left: 15px; } -.nav-tabs { - > li { - > a { - margin-right: 5px; - padding: 10px 30px; - border-top: 3px solid #fff; - &:hover - &:focus { - border-top: 3px solid #ddd; +.torrent-info-tabs { + .nav-tabs { + > li { + > a { + margin-right: 5px; + padding: 10px 30px; + border-top: 3px solid #fff; + &:hover + &:focus { + border-top: 3px solid #ddd; + } + } + &.active { + > a { + &, + &:hover, + &:focus { + border-top: 3px solid @brand-danger; + background-color: @comment-background-default; + } + } } } - &.active { + } +} + +.tab-ranking { + .nav-tabs { + > li { > a { - &, - &:hover, + margin-right: 5px; + padding: 10px 30px; + border-top: 3px solid #fff; + &:hover &:focus { - border-top: 3px solid @brand-danger; - background-color: @comment-background-default; + border-top: 3px solid #ddd; + } + } + &.active { + > a { + &, + &:hover, + &:focus { + border-top: 3px solid @brand-danger; + } } } } @@ -444,4 +481,15 @@ .page-header { padding-bottom: 0; +} + +.ranking-user-img { + cursor: pointer; + border-radius: 3px; + height: 32px; + width: 32px; +} + +.ranking-active-col { + color: @mt-base-color; } \ No newline at end of file diff --git a/modules/ranking/client/controllers/ranking.client.controller.js b/modules/ranking/client/controllers/ranking.client.controller.js index f90e22d7..e2e5eafc 100644 --- a/modules/ranking/client/controllers/ranking.client.controller.js +++ b/modules/ranking/client/controllers/ranking.client.controller.js @@ -5,11 +5,18 @@ .module('users.admin') .controller('RankingController', RankingController); - RankingController.$inject = ['$scope', 'RankingService']; + RankingController.$inject = ['$scope', 'RankingService', '$translate']; - function RankingController($scope, RankingService) { + function RankingController($scope, RankingService, $translate) { var vm = this; + vm.rankingTabs = [ + {title: $translate.instant('PAGE_HEADER_RANKING_UPLOAD'), templateUrl: 'upload_ranking.html'}, + {title: $translate.instant('PAGE_HEADER_RANKING_DOWNLOAD'), templateUrl: 'download_ranking.html'}, + {title: $translate.instant('PAGE_HEADER_RANKING_RATIO'), templateUrl: 'ratio_ranking.html'}, + {title: $translate.instant('PAGE_HEADER_RANKING_SCORE'), templateUrl: 'score_ranking.html'} + ]; + RankingService.get(function (data) { console.log(data); diff --git a/modules/ranking/client/views/ranking.client.view.html b/modules/ranking/client/views/ranking.client.view.html index 44f673b7..6897ec3f 100644 --- a/modules/ranking/client/views/ranking.client.view.html +++ b/modules/ranking/client/views/ranking.client.view.html @@ -1,49 +1,170 @@
-
-
-
{{'PAGE_HEADER_RANKING_UPLOAD' | translate}}
-
-

...

-
- - -
-
+
+ + + + {{tab.title}} + +
+
+
+
-
-
-
{{'PAGE_HEADER_RANKING_DOWNLOAD' | translate}}
-
-

...

-
- -
+ -
-
-
{{'PAGE_HEADER_RANKING_RATIO' | translate}}
-
-

...

+ -
-
-
{{'PAGE_HEADER_RANKING_SCORE' | translate}}
-
-

...

+ - -
+
\ No newline at end of file diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index 018df4b6..f5e9cca1 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -136,15 +136,17 @@
- - - - {{tab.title}} {{b.value}} - -
-
-
-
+
+ + + + {{tab.title}} {{b.value}} + +
+
+
+
+