mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-08 15:33:11 +02:00
add movie detail info subtitles/users badge number
This commit is contained in:
@@ -378,53 +378,6 @@ exports.announce = function (req, res) {
|
||||
done(null);
|
||||
},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
mongodb write
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
//function (done) {
|
||||
// if (req.currentPeer !== undefined) {
|
||||
// req.currentPeer.save(function (err) {
|
||||
// if (err) {
|
||||
// console.error('************ SAVE ERROR: 182');
|
||||
// console.error(err);
|
||||
// done(182);
|
||||
// return;
|
||||
// } else {
|
||||
// done(null);
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// done(null);
|
||||
// }
|
||||
//},
|
||||
//
|
||||
//function (done) {
|
||||
// req.torrent.save(function (err) {
|
||||
// if (err) {
|
||||
// console.error('************ SAVE ERROR: 183');
|
||||
// console.error(err);
|
||||
// done(183);
|
||||
// return;
|
||||
// } else {
|
||||
// done(null);
|
||||
// }
|
||||
// });
|
||||
//},
|
||||
//
|
||||
//function (done) {
|
||||
// req.passkeyuser.save(function (err) {
|
||||
// if (err) {
|
||||
// console.error('************ SAVE ERROR: 184');
|
||||
// console.error(err);
|
||||
// done(184);
|
||||
// return;
|
||||
// } else {
|
||||
// done(null);
|
||||
// }
|
||||
// });
|
||||
//},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
sendPeers
|
||||
compact mode
|
||||
|
||||
36
modules/core/client/less/badge.less
Normal file
36
modules/core/client/less/badge.less
Normal file
@@ -0,0 +1,36 @@
|
||||
@import (reference) "../../../../public/lib/bootstrap/less/variables.less";
|
||||
|
||||
@badge-margin: 2px;
|
||||
|
||||
.badge_info {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: @brand-info;
|
||||
}
|
||||
.badge_primary {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: @brand-primary;
|
||||
}
|
||||
.badge_success {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: @brand-success;
|
||||
}
|
||||
.badge_warning {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: @brand-warning;
|
||||
}
|
||||
.badge_danger {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: @brand-danger;
|
||||
}
|
||||
.badge_seeder {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: #33CC00;
|
||||
}
|
||||
.badge_leecher {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: #FF3300;
|
||||
}
|
||||
.badge_finished {
|
||||
margin: 0 @badge-margin;
|
||||
background-color: #0366d6;
|
||||
}
|
||||
@@ -24,14 +24,7 @@
|
||||
vm.pageNumber = 50;
|
||||
vm.releaseYear = undefined;
|
||||
|
||||
vm.torrentTabs = [
|
||||
{title: $translate.instant('TAB_VIDEO_INFO'), templateUrl: 'videoInfo.html'},
|
||||
{title: $translate.instant('TAB_USER_SUBTITLE'), templateUrl: 'subtitleInfo.html'},
|
||||
{title: $translate.instant('TAB_USER_INFO'), templateUrl: 'userInfo.html'},
|
||||
{title: $translate.instant('TAB_OTHER_TORRENTS'), templateUrl: 'otherTorrents.html'},
|
||||
{title: $translate.instant('TAB_MY_PANEL'), templateUrl: 'myPanel.html'},
|
||||
{title: $translate.instant('TAB_ADMIN_PANEL'), templateUrl: 'adminPanel.html'}
|
||||
];
|
||||
vm.torrentTabs = [];
|
||||
|
||||
// If user is not signed in then redirect back home
|
||||
if (!Authentication.user) {
|
||||
@@ -252,6 +245,55 @@
|
||||
$('.backdrop').css('backgroundImage', 'url(' + vm.tmdbConfig.backdrop_img_base_url + res.torrent_backdrop_img + ')');
|
||||
}
|
||||
vm.initInfo(res.torrent_tmdb_id);
|
||||
|
||||
vm.torrentTabs.push(
|
||||
{
|
||||
title: $translate.instant('TAB_VIDEO_INFO'),
|
||||
templateUrl: 'videoInfo.html',
|
||||
ng_show: true,
|
||||
badges: []
|
||||
},
|
||||
{
|
||||
title: $translate.instant('TAB_USER_SUBTITLE'),
|
||||
templateUrl: 'subtitleInfo.html',
|
||||
ng_show: true,
|
||||
badges: [
|
||||
{
|
||||
value: vm.torrentLocalInfo._subtitles.length,
|
||||
class: 'badge_info'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: $translate.instant('TAB_USER_INFO'),
|
||||
templateUrl: 'userInfo.html',
|
||||
ng_show: true,
|
||||
badges: [
|
||||
{
|
||||
value: '↑ ' + vm.torrentLocalInfo.torrent_seeds + ' ↓ ' + vm.torrentLocalInfo.torrent_leechers + ' √ ' + vm.torrentLocalInfo.torrent_finished,
|
||||
class: 'badge_info'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: $translate.instant('TAB_OTHER_TORRENTS'),
|
||||
templateUrl: 'otherTorrents.html',
|
||||
ng_show: true,
|
||||
badges: []
|
||||
},
|
||||
{
|
||||
title: $translate.instant('TAB_MY_PANEL'),
|
||||
templateUrl: 'myPanel.html',
|
||||
ng_show: vm.torrentLocalInfo.isCurrentUserOwner,
|
||||
badges: []
|
||||
},
|
||||
{
|
||||
title: $translate.instant('TAB_ADMIN_PANEL'),
|
||||
templateUrl: 'adminPanel.html',
|
||||
ng_show: vm.user.roles.indexOf('admin') >= 0,
|
||||
badges: []
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
console.log(vm.torrentLocalInfo);
|
||||
|
||||
@@ -135,7 +135,10 @@
|
||||
|
||||
<div class="container">
|
||||
<uib-tabset>
|
||||
<uib-tab index="$index" ng-repeat="tab in vm.torrentTabs" heading="{{tab.title}}" disabled="tab.disabled">
|
||||
<uib-tab index="$index" ng-repeat="tab in vm.torrentTabs" disabled="tab.disabled" ng-show="tab.ng_show">
|
||||
<uib-tab-heading>
|
||||
{{tab.title}} <span class="badge {{b.class}}" ng-repeat="b in tab.badges">{{b.value}}</span>
|
||||
</uib-tab-heading>
|
||||
<div ng-include="tab.templateUrl">
|
||||
</div>
|
||||
</uib-tab>
|
||||
|
||||
Reference in New Issue
Block a user