diff --git a/config/env/torrents.js b/config/env/torrents.js index 5da5b186..7d9e4935 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -281,6 +281,7 @@ module.exports = { * @showVipBanner: setting whether show vip AD banner * @showForumNewTopicsAndNewestTorrents: setting whether show forum new topics and newest torrents in home page * @showTopLevelTorrents: setting whether show top level torrents list + * @showAlbumsList: setting whether show albums list of home * @bodyBackgroundImage: background image url of home page body * @buttonList: a function list area of home page */ @@ -288,6 +289,7 @@ module.exports = { showVipBanner: false, showForumNewTopicsAndNewestTorrents: false, showTopLevelTorrents: false, + showAlbumsList: true, bodyBackgroundImage: 'https://image.tmdb.org/t/p/w1280/cnKAGbX1rDkAquF2V1wVkptHDJO.jpg', buttonList: [ { diff --git a/modules/albums/client/controllers/album-view.client.controller.js b/modules/albums/client/controllers/album-view.client.controller.js index 2acc815c..a335a3b8 100644 --- a/modules/albums/client/controllers/album-view.client.controller.js +++ b/modules/albums/client/controllers/album-view.client.controller.js @@ -10,8 +10,8 @@ '$compile', 'marked']; function AlbumItemController($scope, $state, $translate, MeanTorrentConfig, AlbumsService, NotifycationService, DownloadService, - mtDebug, TorrentGetInfoServices, Authentication, ResourcesTagsServices, ModalConfirmService, localStorageService, - $compile, marked) { + mtDebug, TorrentGetInfoServices, Authentication, ResourcesTagsServices, ModalConfirmService, localStorageService, + $compile, marked) { var vm = this; vm.DLS = DownloadService; vm.TGI = TorrentGetInfoServices; @@ -219,5 +219,20 @@ }); }); }; + + /** + * beginToggleHomeStatus + * @param item + */ + vm.beginToggleHomeStatus = function (item) { + AlbumsService.toggleHomeItemStatus({ + _id: item._id + }, function (res) { + vm.album = res; + NotifycationService.showSuccessNotify('ALBUMS.HOME_STATUS_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showSuccessNotify('ALBUMS.HOME_STATUS_ERROR'); + }); + }; } }()); diff --git a/modules/albums/client/controllers/albums.client.controller.js b/modules/albums/client/controllers/albums.client.controller.js index 35e4b9bf..5c58e8b7 100644 --- a/modules/albums/client/controllers/albums.client.controller.js +++ b/modules/albums/client/controllers/albums.client.controller.js @@ -29,7 +29,7 @@ }; /** - * getCollectionsList + * getAlbumsList */ vm.getAlbumsList = function () { AlbumsService.query({}, function (data) { @@ -66,7 +66,7 @@ } }); - console.log(vm.albumsTypeList); + mtDebug.info(vm.albumsTypeList); function getTorrentsCount(ct) { var i = 0; @@ -92,6 +92,5 @@ } return result; }; - } }()); diff --git a/modules/albums/client/less/albums.less b/modules/albums/client/less/albums.less index f40c56c7..10157b41 100644 --- a/modules/albums/client/less/albums.less +++ b/modules/albums/client/less/albums.less @@ -15,6 +15,7 @@ max-width: 400px; border: solid 1px #666; min-height: 160px; + max-height: 226px; z-index: 1; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); &:hover { diff --git a/modules/albums/client/services/albums.client.service.js b/modules/albums/client/services/albums.client.service.js index c8060c33..9b151461 100644 --- a/modules/albums/client/services/albums.client.service.js +++ b/modules/albums/client/services/albums.client.service.js @@ -69,6 +69,14 @@ rlevel: '@rlevel' }, interceptor: {response: removeCache} + }, + toggleHomeItemStatus: { + method: 'PUT', + url: '/api/albums/:albumId/toggleHomeItemStatus', + params: { + albumId: '@_id' + }, + interceptor: {response: removeCache} } }); diff --git a/modules/albums/client/views/album-view.client.view.html b/modules/albums/client/views/album-view.client.view.html index 23fd3067..48d9e965 100644 --- a/modules/albums/client/views/album-view.client.view.html +++ b/modules/albums/client/views/album-view.client.view.html @@ -56,6 +56,10 @@ + diff --git a/modules/albums/client/views/albums.client.view.html b/modules/albums/client/views/albums.client.view.html index 101df3b8..f629e3d9 100644 --- a/modules/albums/client/views/albums.client.view.html +++ b/modules/albums/client/views/albums.client.view.html @@ -3,25 +3,29 @@