feat(config): add torrent type config of software and eBook

This commit is contained in:
OldHawk
2017-09-21 11:24:47 +08:00
parent e2d4cd37c7
commit 96c9efc376
5 changed files with 93 additions and 16 deletions

View File

@@ -242,11 +242,16 @@ module.exports = {
* @url: window location url of type
* @divider: divider status of submenu item
* @position: position of submenu item(ordered index)
*
* if you add a config json item, please add translate string:
* MENU_TORRENTS_SUB
* TORRENT_TYPE_LABEL
*/
torrentType: {
name: 'TYPE',
value: [
{
enable: true,
name: 'MOVIE',
value: 'movie',
title: 'MENU_TORRENTS_SUB.MOVIE',
@@ -256,6 +261,7 @@ module.exports = {
position: 1
},
{
enable: true,
name: 'TVSERIAL',
value: 'tvserial',
title: 'MENU_TORRENTS_SUB.TVSERIAL',
@@ -265,6 +271,7 @@ module.exports = {
position: 2
},
{
enable: true,
name: 'MUSIC',
value: 'music',
title: 'MENU_TORRENTS_SUB.MUSIC',
@@ -274,6 +281,7 @@ module.exports = {
position: 3
},
{
enable: true,
name: 'VARIETY',
value: 'variety',
title: 'MENU_TORRENTS_SUB.VARIETY',
@@ -283,6 +291,27 @@ module.exports = {
position: 4
},
{
enable: true,
name: 'SOFTWARE',
value: 'software',
title: 'MENU_TORRENTS_SUB.SOFTWARE',
state: 'torrents.software',
url: '/software',
divider: true,
position: 4
},
{
enable: true,
name: 'EBOOK',
value: 'ebook',
title: 'MENU_TORRENTS_SUB.EBOOK',
state: 'torrents.ebook',
url: '/ebook',
divider: false,
position: 4
},
{
enable: true,
name: 'OTHER',
value: 'other',
title: 'MENU_TORRENTS_SUB.OTHER',
@@ -520,6 +549,17 @@ module.exports = {
{name: 'INDIA', icon: ''},
{name: 'ARAB', icon: ''}
]
},
{
name: 'PLATFORM',
cats: ['software'],
value: [
{name: 'Windows', icon: ''},
{name: 'MacOS', icon: ''},
{name: 'Linux', icon: ''},
{name: 'iOS', icon: ''},
{name: 'Android', icon: ''}
]
}
],
checkbox: [

View File

@@ -41,6 +41,8 @@
TVSERIAL: 'TVSerial',
MUSIC: 'Music',
VARIETY: 'Variety',
SOFTWARE: 'Software',
EBOOK: 'eBook',
OTHER: 'Other'
},
@@ -473,6 +475,8 @@
TVSERIAL: 'TVSerial',
MUSIC: 'Music',
VARIETY: 'Variety',
SOFTWARE: 'Software',
EBOOK: 'eBook',
OTHER: 'Other'
},
TORRENT_STATUS_LABEL: {
@@ -892,6 +896,15 @@
SELF: 'Music Sub Category',
CD: 'CD',
MTV: 'MTV'
},
PLATFORM: {
SELF: 'Platform',
Windows: 'Windows',
MacOS: 'MacOS',
Linux: 'Linux',
iOS: 'iOS',
Android: 'Android'
}
}
};

View File

@@ -41,6 +41,8 @@
TVSERIAL: '电视剧',
MUSIC: '音乐',
VARIETY: '综艺',
SOFTWARE: '软件',
EBOOK: '电子书',
OTHER: '其它'
},
@@ -473,6 +475,8 @@
TVSERIAL: '电视剧',
MUSIC: '音乐',
VARIETY: '综艺',
SOFTWARE: '软件',
EBOOK: '电子书',
OTHER: '其它'
},
TORRENT_STATUS_LABEL: {
@@ -892,6 +896,15 @@
SELF: '音乐类型',
CD: 'CD',
MTV: 'MTV'
},
PLATFORM: {
SELF: 'Platform',
Windows: 'Windows',
MacOS: 'MacOS',
Linux: 'Linux',
iOS: 'iOS',
Android: 'Android'
}
}
};

View File

@@ -18,15 +18,24 @@
position: 0
});
menuService.addMenuItem('topbar', {
title: 'MENU_UPLOAD',
state: 'torrents.uploads',
roles: ['*'],
position: 3
});
// Add the dropdown list item
angular.forEach(torrentTypeConfig.value, function (cfg) {
menuService.addSubMenuItem('topbar', 'torrents', {
title: cfg.title,
state: cfg.state,
divider: cfg.divider,
roles: ['*'],
position: cfg.position
});
if (cfg.enable) {
menuService.addSubMenuItem('topbar', 'torrents', {
title: cfg.title,
state: cfg.state,
divider: cfg.divider,
roles: ['*'],
position: cfg.position
});
}
});
}
}());

View File

@@ -30,15 +30,17 @@
});
angular.forEach(torrentTypeConfig.value, function (cfg) {
$stateProvider
.state(cfg.state, {
url: cfg.url,
templateUrl: '/modules/torrents/client/views/torrent-list.client.view.html',
data: {
pageTitle: 'PAGETITLE.MOVIE_LIST',
torrentType: cfg.value
}
});
if (cfg.enable) {
$stateProvider
.state(cfg.state, {
url: cfg.url,
templateUrl: '/modules/torrents/client/views/torrent-list.client.view.html',
data: {
pageTitle: 'PAGETITLE.MOVIE_LIST',
torrentType: cfg.value
}
});
}
});
$stateProvider