diff --git a/modules/core/client/directives/editable-line.client.directive.js b/modules/core/client/directives/editable-line.client.directive.js index 22496fb8..c2372ebb 100644 --- a/modules/core/client/directives/editable-line.client.directive.js +++ b/modules/core/client/directives/editable-line.client.directive.js @@ -27,9 +27,9 @@ $scope.input = jQuery($element).find('.editable-line-input'); $scope.originalDivBackground = $scope.div.css('background-color'); - $scope.div.awesomeCursor('wrench', { + $scope.div.awesomeCursor('pencil', { color: '#ff6000', - flip: 'horizontal', + flip: 'vertical', outline: '#ff3e00' }); diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index f4e89091..59cdc559 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -95,6 +95,11 @@ * $watch 'vm.torrentLocalInfo' */ $scope.$watch('vm.torrentLocalInfo', function (newValue, oldValue) { + if(vm.torrentLocalInfo) { + vm.torrentLocalInfo.resource_detail_info.custom_title = vm.TGI.getTorrentCustomTitle(vm.torrentLocalInfo); + vm.torrentLocalInfo.resource_detail_info.custom_subtitle = vm.TGI.getTorrentCustomSubTitle(vm.torrentLocalInfo); + } + if (vm.torrentLocalInfo && vm.torrentLocalInfo._replies) { var hasme = false; var meitem = null; @@ -517,13 +522,13 @@ } ] }, - { - icon: 'fa-user-md', - title: $translate.instant('TAB_MY_PANEL'), - templateUrl: 'myPanel.html', - ng_show: vm.torrentLocalInfo.isCurrentUserOwner, - badges: [] - }, + // { + // icon: 'fa-user-md', + // title: $translate.instant('TAB_MY_PANEL'), + // templateUrl: 'myPanel.html', + // ng_show: vm.torrentLocalInfo.isCurrentUserOwner, + // badges: [] + // }, { icon: 'fa-cog', title: $translate.instant('TAB_ADMIN_PANEL'), @@ -1011,6 +1016,69 @@ }); }; + /** + * isOwner + * @param o, topic or reply + * @returns {boolean} + */ + vm.isOwner = function (o) { + if (o) { + if (o.isCurrentUserOwner) { + return true; + } else { + return false; + } + } else { + return false; + } + }; + + /** + * canEdit + * @returns {boolean} + */ + vm.canEdit = function () { + if (vm.user.isOper) { + return true; + } else { + return false; + } + }; + + /** + * onTorrentTitleEdited + */ + $scope.onTorrentTitleEdited = function (modifyed) { + if (vm.torrentLocalInfo && modifyed) { + TorrentsService.update({ + _id: vm.torrentLocalInfo._id, + custom_title: vm.torrentLocalInfo.resource_detail_info.custom_title + }, function (res) { + vm.torrentLocalInfo = res; + NotifycationService.showSuccessNotify('TORRENT_UPDATE_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_UPDATE_ERROR'); + }); + } + }; + + /** + * onTorrentSubTitleEdited + */ + $scope.onTorrentSubTitleEdited = function (modifyed) { + if (vm.torrentLocalInfo && modifyed) { + TorrentsService.update({ + _id: vm.torrentLocalInfo._id, + custom_subtitle: vm.torrentLocalInfo.resource_detail_info.custom_subtitle + }, function (res) { + vm.torrentLocalInfo = res; + NotifycationService.showSuccessNotify('TORRENT_UPDATE_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_UPDATE_ERROR'); + }); + } + }; + /** * doUpdateTorrentInfo * @param minfo diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index 05542481..e20fe2bf 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -1,5 +1,9 @@ @import (reference) "../../../core/client/less/mt-var.less"; +.text-bold { + font-weight: bold; +} + .filter-tags { padding-bottom: 10px; margin-bottom: 15px; diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index fa1b84de..9c21fa15 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -579,13 +579,27 @@