From e119f194709700ccea5bd4654e41206da853fac0 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 5 Oct 2017 02:29:31 +0800 Subject: [PATCH] feat(torrents): add music torrent MTV flag --- .../directives/music-disk.client.directive.js | 15 +++++-- modules/core/client/less/mt.less | 44 +++++++++++++++++++ .../core/client/views/home.client.view.html | 6 +-- .../torrent-info.client.controller.js | 26 ++++++----- .../views/admin/admin-list.client.view.html | 2 +- .../views/list-torrents.client.view.html | 4 +- .../views/view-torrent.client.view.html | 4 +- .../admin/user-leeching.client.view.html | 2 +- .../views/admin/user-seeding.client.view.html | 2 +- .../views/admin/user-uplist.client.view.html | 2 +- .../views/admin/user-warning.client.view.html | 2 +- .../views/status/downloading.client.view.html | 2 +- .../views/status/seeding.client.view.html | 2 +- .../views/status/uploaded.client.view.html | 2 +- .../views/status/warning.client.view.html | 2 +- 15 files changed, 87 insertions(+), 30 deletions(-) diff --git a/modules/core/client/directives/music-disk.client.directive.js b/modules/core/client/directives/music-disk.client.directive.js index f60852ba..0d34cca5 100644 --- a/modules/core/client/directives/music-disk.client.directive.js +++ b/modules/core/client/directives/music-disk.client.directive.js @@ -17,10 +17,18 @@ function link(scope, element, attrs) { scope.$watch(attrs.musicDisk, function (s) { - if (s) { + if (s && s.torrent_type === 'music') { + var border_color = '#515151'; + if (s.torrent_tags.indexOf('MTV') !== -1) { + var div1 = angular.element('
MTV
'); + div1.addClass('music-badge'); + + border_color = '#d9534f'; + } + var cir1 = angular.element('
'); cir1.css('border-radius', '50%'); - cir1.css('border', 'solid 2px #515151'); + cir1.css('border', 'solid 2px ' + border_color); cir1.css('background-color', '#ddd'); cir1.css('padding', '1px'); cir1.css('cursor', 'pointer'); @@ -47,7 +55,7 @@ var cir4 = angular.element('
'); cir4.css('border-radius', '50%'); - cir4.css('border', 'solid 2px #515151'); + cir4.css('border', 'solid 2px ' + border_color); cir4.css('background-color', '#fff'); cir4.css('height', '100%'); cir4.css('width', '100%'); @@ -57,6 +65,7 @@ cir2.append(cir3); cir3.append(cir4); + element.parent().append(div1); element.replaceWith(cir1); } }); diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index ec6a439e..e10b017b 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -164,6 +164,17 @@ body { background-color: #555; } } + .music-badge { + position: absolute; + top: 30px; + right: 20px; + font-size: 20px; + color: #fff; + padding: 0 5px; + background-color: @label-danger-bg; + border: solid 1px #fff; + border-radius: 6px; + } } } @@ -239,6 +250,17 @@ body { } } } + .music-badge { + position: absolute; + top: 50px; + right: 20px; + font-size: 14px; + color: #fff; + padding: 0 5px; + background-color: @label-danger-bg; + border: solid 1px #fff; + border-radius: 4px; + } } .torrent-votes { @@ -531,6 +553,17 @@ body { /* csslint ignore:end */ } } + .music-badge { + position: absolute; + top: 35px; + left: 50px; + font-size: 12px; + color: #fff; + padding: 0 4px; + background-color: @label-danger-bg; + border: solid 1px #fff; + border-radius: 3px; + } } .se-info { position: absolute; @@ -711,6 +744,17 @@ body { width: 66.66px; margin: 16.66px 0; } + .music-badge { + position: absolute; + top: 10px; + right: 10px; + font-size: 12px; + color: #fff; + padding: 0 5px; + background-color: @label-danger-bg; + border: solid 1px #fff; + border-radius: 3px; + } .media-object { height: 100px; width: 66.66px; diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index a73042af..f42b5014 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -431,7 +431,7 @@
- {{vm.TGI.getTorrentTitle(vm.musicTopOne)}}
@@ -483,7 +483,7 @@